diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2023-06-04 14:34:47 +0200 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2023-06-04 16:50:36 +0200 |
commit | 83eee0095c337e454acd5368f70855e34ec4a174 (patch) | |
tree | d165d4b97e1b0efce6095a9844c1d2e5cb9f805c /sc | |
parent | 7bbec0dfaac7b4a579c963e0724f5355da2b8df8 (diff) |
ScUserListData::InitTokens can't produce different splits
... for the same input, because ScGlobal::cListDelimiter is a constant.
This means, that the copy ctor and assignment operator can be default,
and ScUserListData comparison can be simplified.
Change-Id: I500892ab592fd0dd24550c5189151f670efed4d3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152541
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/inc/userlist.hxx | 3 | ||||
-rw-r--r-- | sc/source/core/tool/userlist.cxx | 17 |
2 files changed, 2 insertions, 18 deletions
diff --git a/sc/inc/userlist.hxx b/sc/inc/userlist.hxx index 1cf759e463e7..b421c33370db 100644 --- a/sc/inc/userlist.hxx +++ b/sc/inc/userlist.hxx @@ -46,9 +46,6 @@ private: public: ScUserListData(OUString aStr); - // Copy ctor and assignment operator re-initialize tokens. Is this intended on copy? - ScUserListData(const ScUserListData& rData); - ScUserListData& operator=(const ScUserListData& rData); const OUString& GetString() const { return aStr; } void SetString(const OUString& rStr); diff --git a/sc/source/core/tool/userlist.cxx b/sc/source/core/tool/userlist.cxx index 984b51c1058e..b91d3ba3819a 100644 --- a/sc/source/core/tool/userlist.cxx +++ b/sc/source/core/tool/userlist.cxx @@ -34,12 +34,11 @@ ScUserListData::SubStr::SubStr(OUString aReal, OUString aUpper) : void ScUserListData::InitTokens() { - sal_Unicode cSep = ScGlobal::cListDelimiter; maSubStrings.clear(); sal_Int32 nIndex = 0; do { - OUString aSub = aStr.getToken(0, cSep, nIndex); + OUString aSub = aStr.getToken(0, ScGlobal::cListDelimiter, nIndex); if (!aSub.isEmpty()) { OUString aUpStr = ScGlobal::getCharClass().uppercase(aSub); @@ -54,18 +53,6 @@ ScUserListData::ScUserListData(OUString _aStr) : InitTokens(); } -ScUserListData::ScUserListData(const ScUserListData& rData) : - aStr(rData.aStr) -{ - InitTokens(); -} - -ScUserListData& ScUserListData::operator=(const ScUserListData& rData) -{ - SetString(rData.aStr); - return *this; -} - void ScUserListData::SetString( const OUString& rStr ) { aStr = rStr; @@ -249,7 +236,7 @@ bool ScUserList::operator==( const ScUserList& r ) const { return std::equal(maData.begin(), maData.end(), r.maData.begin(), r.maData.end(), [](const ScUserListData& lhs, const ScUserListData& rhs) { - return (lhs.GetString() == rhs.GetString()) && (lhs.GetSubCount() == rhs.GetSubCount()); + return lhs.GetString() == rhs.GetString(); }); } |