From bc5c21c212e83deba9d92bdc507b3ff1964429ca Mon Sep 17 00:00:00 2001 From: David Schulz Date: Wed, 28 Nov 2018 07:56:06 +0100 Subject: [PATCH] Core: Add compare function to Search::TextPosition and TextRange Change-Id: Ia41fb1f2855745075ab7364916ecd69ce4d11401 Reviewed-by: Eike Ziller --- src/plugins/coreplugin/find/searchresultitem.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/plugins/coreplugin/find/searchresultitem.h b/src/plugins/coreplugin/find/searchresultitem.h index dd4788687d2..35ed7c7b592 100644 --- a/src/plugins/coreplugin/find/searchresultitem.h +++ b/src/plugins/coreplugin/find/searchresultitem.h @@ -45,6 +45,9 @@ public: int line = -1; // (0 or -1 for no line number) int column = -1; // 0-based starting position for a mark (-1 for no mark) int offset = -1; + + bool operator<(const TextPosition &other) + { return line < other.line || (line == other.line && column < other.column); } }; class TextRange @@ -79,6 +82,9 @@ public: TextPosition begin; TextPosition end; + + bool operator<(const TextRange &other) + { return begin < other.begin; } }; } // namespace Search