sc/inc/typedstrdata.hxx | 8 ++++++++ sc/source/core/data/column3.cxx | 12 ++++++------ 2 files changed, 14 insertions(+), 6 deletions(-)
New commits: commit cb53cc2a92886b83dcf5f9de762c82b1144f912c Author: Noel Grandin <[email protected]> AuthorDate: Fri Mar 18 09:22:15 2022 +0200 Commit: Noel Grandin <[email protected]> CommitDate: Fri Mar 18 10:13:18 2022 +0100 tdf#133603 reduce some ref-counting during XLSX save Change-Id: I02ed854ba57c7f513205f65ec84cb4e08d3b068f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131728 Tested-by: Noel Grandin <[email protected]> Reviewed-by: Noel Grandin <[email protected]> diff --git a/sc/inc/typedstrdata.hxx b/sc/inc/typedstrdata.hxx index c1a3738ce7fe..7918b5501fca 100644 --- a/sc/inc/typedstrdata.hxx +++ b/sc/inc/typedstrdata.hxx @@ -25,6 +25,14 @@ public: Header }; + ScTypedStrData( + OUString&& rStr, double fVal = 0.0, double fRVal = 0.0, StringType nType = Standard, bool bDate = false ) : + maStrValue(std::move(rStr)), + mfValue(fVal), + mfRoundedValue(fRVal), + meStrType(nType), + mbIsDate( bDate ) {} + ScTypedStrData( const OUString& rStr, double fVal = 0.0, double fRVal = 0.0, StringType eType = Standard, bool bDate = false ); diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx index 9e12ad32cacf..2f4b7a2c0774 100644 --- a/sc/source/core/data/column3.cxx +++ b/sc/source/core/data/column3.cxx @@ -2510,7 +2510,7 @@ class FilterEntriesHandler if (rCell.hasString()) { - mrFilterEntries.push_back(ScTypedStrData(aStr)); + mrFilterEntries.push_back(ScTypedStrData(std::move(aStr))); return; } @@ -2532,7 +2532,7 @@ class FilterEntriesHandler OUString aErr = ScGlobal::GetErrorString(nErr); if (!aErr.isEmpty()) { - mrFilterEntries.push_back(ScTypedStrData(aErr)); + mrFilterEntries.push_back(ScTypedStrData(std::move(aErr))); return; } } @@ -2568,9 +2568,9 @@ class FilterEntriesHandler } // store the formatted/rounded value for filtering if ((nFormat % SV_COUNTRY_LANGUAGE_OFFSET) != 0 && !bDate) - mrFilterEntries.push_back(ScTypedStrData(aStr, fVal, rColumn.GetDoc().RoundValueAsShown(fVal, nFormat), ScTypedStrData::Value, bDate)); + mrFilterEntries.push_back(ScTypedStrData(std::move(aStr), fVal, rColumn.GetDoc().RoundValueAsShown(fVal, nFormat), ScTypedStrData::Value, bDate)); else - mrFilterEntries.push_back(ScTypedStrData(aStr, fVal, fVal, ScTypedStrData::Value, bDate)); + mrFilterEntries.push_back(ScTypedStrData(std::move(aStr), fVal, fVal, ScTypedStrData::Value, bDate)); } public: @@ -2784,7 +2784,7 @@ bool ScColumn::GetDataEntries( OUString aStr = aItrUp.get(); if (!aStr.isEmpty()) { - if (rStrings.insert(ScTypedStrData(aStr)).second) + if (rStrings.insert(ScTypedStrData(std::move(aStr))).second) bFound = true; } @@ -2797,7 +2797,7 @@ bool ScColumn::GetDataEntries( OUString aStr = aItrDown.get(); if (!aStr.isEmpty()) { - if (rStrings.insert(ScTypedStrData(aStr)).second) + if (rStrings.insert(ScTypedStrData(std::move(aStr))).second) bFound = true; }
