summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2023-06-04 16:22:38 +0200
committerMike Kaganski <mike.kaganski@collabora.com>2023-06-04 19:56:38 +0200
commit4900217e74e29c8e19c9a697883c21cbd50c9dbc (patch)
treef5f4190ce3fb812b6f417077e7a1698b33aa3ced
parentcc6db9f418cae422a4733163f85801c5a14f47c8 (diff)
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.kaganski@collabora.com>
-rw-r--r--sc/inc/userlist.hxx5
-rw-r--r--sc/source/core/tool/userlist.cxx12
2 files changed, 7 insertions, 10 deletions
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);
}