summaryrefslogtreecommitdiff
path: root/unotools
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-04-07 20:54:55 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-04-08 13:18:41 +0200
commit36e0e88b28e818faf25b8e32cc8c4dc444b8a0be (patch)
treeb7b5c8e13b6e05f871b01a3d0bf68c1d1329ef12 /unotools
parentcf5bbe3fce4a250ab25998053965bdc604c6114e (diff)
use more subView when converting to Int32
Change-Id: I54e3ddf79ba793fd4328bf8bda7f949b65349651 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132693 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'unotools')
-rw-r--r--unotools/source/config/dynamicmenuoptions.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/unotools/source/config/dynamicmenuoptions.cxx b/unotools/source/config/dynamicmenuoptions.cxx
index 8598eb494624..98c8aac403de 100644
--- a/unotools/source/config/dynamicmenuoptions.cxx
+++ b/unotools/source/config/dynamicmenuoptions.cxx
@@ -28,6 +28,7 @@
#include <com/sun/star/uno/Any.hxx>
#include <com/sun/star/uno/Sequence.hxx>
#include <com/sun/star/beans/PropertyValue.hpp>
+#include <comphelper/string.hxx>
#include <vector>
#include <algorithm>
@@ -287,14 +288,13 @@ static void lcl_SortAndExpandPropertyNames( const Sequence< OUString >& lSource
{
struct CountWithPrefixSort
{
- bool operator() ( const OUString& s1 ,
- const OUString& s2 ) const
+ bool operator() ( std::u16string_view s1, std::u16string_view s2 ) const
{
// Get order numbers from entry name without prefix.
// e.g. "m10" => 10
// "m5" => 5
- sal_Int32 n1 = s1.copy( 1 ).toInt32();
- sal_Int32 n2 = s2.copy( 1 ).toInt32();
+ sal_Int32 n1 = comphelper::string::toInt32(s1.substr( 1 ));
+ sal_Int32 n2 = comphelper::string::toInt32(s2.substr( 1 ));
// MUST be in [0,1] ... because it's a difference between
// insert-positions of given entries in sorted list!
return( n1<n2 );