summaryrefslogtreecommitdiff
path: root/sw/source/uibase/inc/swcont.hxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-09-04 13:51:18 +0100
committerCaolán McNamara <caolanm@redhat.com>2015-09-04 14:54:25 +0100
commitb14cdcbf6834461f6f079c153fc7d32402c28236 (patch)
tree9c30f168398a8e3162c1b614e0860cc160a9cbef /sw/source/uibase/inc/swcont.hxx
parent262e7be01461887202f629d1ccc57751b1a085c5 (diff)
natural sort contents of writer navigator
i.e. graphic1, graphic2, graphic10 not i.e. graphic1, graphic10, graphic2 Change-Id: Ic8596144b594a933cb1366e29d3c45a4c90d7d07
Diffstat (limited to 'sw/source/uibase/inc/swcont.hxx')
-rw-r--r--sw/source/uibase/inc/swcont.hxx25
1 files changed, 13 insertions, 12 deletions
diff --git a/sw/source/uibase/inc/swcont.hxx b/sw/source/uibase/inc/swcont.hxx
index c36fb85ebd03..836e0dbdfc1e 100644
--- a/sw/source/uibase/inc/swcont.hxx
+++ b/sw/source/uibase/inc/swcont.hxx
@@ -21,6 +21,7 @@
#define INCLUDED_SW_SOURCE_UIBASE_INC_SWCONT_HXX
#include <rtl/ustring.hxx>
+#include <vcl/lstbox.hxx>
class SwContentType;
@@ -72,18 +73,18 @@ public:
virtual bool IsProtect() const;
const SwContentType* GetParent() const {return pParent;}
const OUString& GetName() const {return sContentName;}
- bool operator==(const SwContent& /*rCont*/) const
- {
- // they're never equal, otherwise they'd fall out of the array
- return false;
- }
- bool operator<(const SwContent& rCont) const
- {
- // at first sort by position and then by name
- return nYPosition != rCont.nYPosition ?
- nYPosition < rCont.nYPosition :
- sContentName < rCont.sContentName;
- }
+ bool operator==(const SwContent& /*rCont*/) const
+ {
+ // they're never equal, otherwise they'd fall out of the array
+ return false;
+ }
+ bool operator<(const SwContent& rCont) const
+ {
+ // at first sort by position and then by name
+ if (nYPosition != rCont.nYPosition)
+ return nYPosition < rCont.nYPosition;
+ return ListBox::NaturalSortCompare(sContentName, rCont.sContentName) < 0;
+ }
long GetYPos() const {return nYPosition;}