sc/inc/userlist.hxx              |    5 ++---
 sc/source/core/tool/userlist.cxx |   12 +++++-------
 2 files changed, 7 insertions(+), 10 deletions(-)

New commits:
commit 4900217e74e29c8e19c9a697883c21cbd50c9dbc
Author:     Mike Kaganski <mike.kagan...@collabora.com>
AuthorDate: Sun Jun 4 16:22:38 2023 +0200
Commit:     Mike Kaganski <mike.kagan...@collabora.com>
CommitDate: Sun Jun 4 19:56:38 2023 +0200

    Move uppercase to SubStr ctor
    
    Change-Id: Ifeeaead20e3ad37705fea04a6c3b9efa4339ddc5
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152543
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>

diff --git a/sc/inc/userlist.hxx b/sc/inc/userlist.hxx
index b421c33370db..5f913bc47dae 100644
--- a/sc/inc/userlist.hxx
+++ b/sc/inc/userlist.hxx
@@ -30,15 +30,14 @@
  */
 class SC_DLLPUBLIC ScUserListData final
 {
-public:
+private:
     struct SAL_DLLPRIVATE SubStr
     {
         OUString maReal;
         OUString maUpper;
-        SubStr(OUString aReal, OUString aUpper);
+        SubStr(OUString&& aReal);
     };
 
-private:
     std::vector<SubStr> maSubStrings;
     OUString aStr;
 
diff --git a/sc/source/core/tool/userlist.cxx b/sc/source/core/tool/userlist.cxx
index b91d3ba3819a..b1030eca6293 100644
--- a/sc/source/core/tool/userlist.cxx
+++ b/sc/source/core/tool/userlist.cxx
@@ -17,7 +17,8 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#include <memory>
+#include <sal/config.h>
+
 #include <unotools/charclass.hxx>
 
 #include <global.hxx>
@@ -29,8 +30,8 @@
 #include <algorithm>
 #include <utility>
 
-ScUserListData::SubStr::SubStr(OUString aReal, OUString aUpper) :
-    maReal(std::move(aReal)), maUpper(std::move(aUpper)) {}
+ScUserListData::SubStr::SubStr(OUString&& aReal) :
+    maReal(std::move(aReal)), 
maUpper(ScGlobal::getCharClass().uppercase(maReal)) {}
 
 void ScUserListData::InitTokens()
 {
@@ -40,10 +41,7 @@ void ScUserListData::InitTokens()
     {
         OUString aSub = aStr.getToken(0, ScGlobal::cListDelimiter, nIndex);
         if (!aSub.isEmpty())
-        {
-            OUString aUpStr = ScGlobal::getCharClass().uppercase(aSub);
-            maSubStrings.emplace_back(aSub, aUpStr);
-        }
+            maSubStrings.emplace_back(std::move(aSub));
     } while (nIndex >= 0);
 }
 

Reply via email to