summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-02-13 15:21:53 +0000
committerCaolán McNamara <caolanm@redhat.com>2020-02-13 20:55:28 +0100
commit8eab16d46f0c70cf9f7afb307ab4a56c49919ac4 (patch)
treef5934147b117f92d58892df2d66988df101d8b2b /vcl
parentc32a61b8d4461f4c936f7ea0f07624e1286f29bf (diff)
extract NaturalSortCompare from ListBox
Change-Id: I260c83778aea06eba9ae774739c6dc31fe5366d6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88613 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/control/imp_listbox.cxx10
-rw-r--r--vcl/source/window/printdlg.cxx4
2 files changed, 9 insertions, 5 deletions
diff --git a/vcl/source/control/imp_listbox.cxx b/vcl/source/control/imp_listbox.cxx
index c1ad5e82dae1..c4486f9262a0 100644
--- a/vcl/source/control/imp_listbox.cxx
+++ b/vcl/source/control/imp_listbox.cxx
@@ -25,6 +25,7 @@
#include <vcl/scrbar.hxx>
#include <vcl/lstbox.hxx>
#include <vcl/i18nhelp.hxx>
+#include <vcl/naturalsort.hxx>
#include <listbox.hxx>
#include <controldata.hxx>
@@ -110,10 +111,13 @@ namespace
};
}
-sal_Int32 ListBox::NaturalSortCompare(const OUString &rA, const OUString &rB)
+namespace vcl
{
- const comphelper::string::NaturalStringSorter &rSorter = theSorter::get();
- return rSorter.compare(rA, rB);
+ sal_Int32 NaturalSortCompare(const OUString &rA, const OUString &rB)
+ {
+ const comphelper::string::NaturalStringSorter &rSorter = theSorter::get();
+ return rSorter.compare(rA, rB);
+ }
}
sal_Int32 ImplEntryList::InsertEntry( sal_Int32 nPos, ImplEntryType* pNewEntry, bool bSort )
diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx
index 68bf33771b8c..2870f7ada6e3 100644
--- a/vcl/source/window/printdlg.cxx
+++ b/vcl/source/window/printdlg.cxx
@@ -23,7 +23,7 @@
#include <bitmaps.hlst>
#include <vcl/commandevent.hxx>
-#include <vcl/lstbox.hxx>
+#include <vcl/naturalsort.hxx>
#include <vcl/print.hxx>
#include <vcl/wall.hxx>
#include <vcl/decoview.hxx>
@@ -57,7 +57,7 @@ enum
namespace {
bool lcl_ListBoxCompare( const OUString& rStr1, const OUString& rStr2 )
{
- return ListBox::NaturalSortCompare( rStr1, rStr2 ) < 0;
+ return vcl::NaturalSortCompare( rStr1, rStr2 ) < 0;
}
}