diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-10-24 09:24:06 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-10-25 08:21:10 +0200 |
commit | 621caf93ce15a49a5f08599e45b047de08ee223d (patch) | |
tree | 9bd7163dd3c9a58c0275646792c8989e3190a780 /sc/source/ui | |
parent | a958e09409b94b97c0d0aa67dd605d321dc42615 (diff) |
speedup saving large XLS file with lots of query formula(2)
reduce cost of OUString construction by avoiding
initialising a temporary and then overwriting it.
12s to 10s
Change-Id: I889152ba71947004ca7d5c96f073182c94d95ed5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175539
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/ui')
-rw-r--r-- | sc/source/ui/app/inputhdl.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/condformat/colorformat.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/condformat/condformatdlgentry.cxx | 7 | ||||
-rw-r--r-- | sc/source/ui/dbgui/filtdlg.cxx | 8 | ||||
-rw-r--r-- | sc/source/ui/miscdlgs/filldlg.cxx | 5 | ||||
-rw-r--r-- | sc/source/ui/unoobj/cellsuno.cxx | 3 | ||||
-rw-r--r-- | sc/source/ui/unoobj/datauno.cxx | 9 |
7 files changed, 13 insertions, 25 deletions
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx index d6b7544d33cb..deb6166bfbd5 100644 --- a/sc/source/ui/app/inputhdl.cxx +++ b/sc/source/ui/app/inputhdl.cxx @@ -1914,7 +1914,7 @@ static OUString lcl_Calculate( const OUString& rFormula, ScDocument& rDoc, const double n = pCalc->GetValue(); sal_uInt32 nFormat = aFormatter.GetStandardFormat( n, 0, pCalc->GetFormatType(), ScGlobal::eLnge ); - aFormatter.GetInputLineString( n, nFormat, aValue ); + aValue = aFormatter.GetInputLineString( n, nFormat ); //! display OutputString but insert InputLineString } else diff --git a/sc/source/ui/condformat/colorformat.cxx b/sc/source/ui/condformat/colorformat.cxx index 7257fca2b469..ff8afff2d48f 100644 --- a/sc/source/ui/condformat/colorformat.cxx +++ b/sc/source/ui/condformat/colorformat.cxx @@ -51,9 +51,7 @@ void GetType(const weld::ComboBox& rLstBox, const weld::Entry& rEd, ScColorScale OUString convertNumberToString(double nVal, const ScDocument* pDoc) { SvNumberFormatter* pNumberFormatter = pDoc->GetFormatTable(); - OUString aText; - pNumberFormatter->GetInputLineString(nVal, 0, aText); - return aText; + return pNumberFormatter->GetInputLineString(nVal, 0); } void SetValue( const ScDocument* pDoc, const ScColorScaleEntry* pEntry, weld::Entry& rEdit) diff --git a/sc/source/ui/condformat/condformatdlgentry.cxx b/sc/source/ui/condformat/condformatdlgentry.cxx index f04706364cac..c9b5e208ffa5 100644 --- a/sc/source/ui/condformat/condformatdlgentry.cxx +++ b/sc/source/ui/condformat/condformatdlgentry.cxx @@ -486,9 +486,7 @@ namespace { OUString convertNumberToString(double nVal, const ScDocument* pDoc) { SvNumberFormatter* pNumberFormatter = pDoc->GetFormatTable(); - OUString aText; - pNumberFormatter->GetInputLineString(nVal, 0, aText); - return aText; + return pNumberFormatter->GetInputLineString(nVal, 0); } const struct @@ -955,8 +953,7 @@ void SetDataBarEntryTypes( const ScColorScaleEntry& rEntry, weld::ComboBox& rLbT { double nVal = rEntry.GetValue(); SvNumberFormatter* pNumberFormatter = pDoc->GetFormatTable(); - OUString aText; - pNumberFormatter->GetInputLineString(nVal, 0, aText); + OUString aText = pNumberFormatter->GetInputLineString(nVal, 0); rEdit.set_text(aText); } break; diff --git a/sc/source/ui/dbgui/filtdlg.cxx b/sc/source/ui/dbgui/filtdlg.cxx index 1382057b4524..9735b15c711e 100644 --- a/sc/source/ui/dbgui/filtdlg.cxx +++ b/sc/source/ui/dbgui/filtdlg.cxx @@ -1540,17 +1540,15 @@ void ScFilterDlg::SetValString( const OUString& rQueryStr, const ScQueryEntry::I if (rItem.meType == ScQueryEntry::ByValue) { if (pDoc) - { - pDoc->GetFormatTable()->GetInputLineString(rItem.mfVal, 0, rValStr); - } + rValStr = pDoc->GetFormatTable()->GetInputLineString(rItem.mfVal, 0); } else if (rItem.meType == ScQueryEntry::ByDate) { if (pDoc) { SvNumberFormatter* pFormatter = pDoc->GetFormatTable(); - pFormatter->GetInputLineString(rItem.mfVal, - pFormatter->GetStandardFormat( SvNumFormatType::DATE), rValStr); + rValStr = pFormatter->GetInputLineString(rItem.mfVal, + pFormatter->GetStandardFormat( SvNumFormatType::DATE)); } } else diff --git a/sc/source/ui/miscdlgs/filldlg.cxx b/sc/source/ui/miscdlgs/filldlg.cxx index 9bcc5bfbf6ed..38cfb3782b32 100644 --- a/sc/source/ui/miscdlgs/filldlg.cxx +++ b/sc/source/ui/miscdlgs/filldlg.cxx @@ -169,13 +169,12 @@ void ScFillSeriesDlg::Init( sal_uInt16 nPossDir ) m_xEdStartVal->set_text( aStartStrVal); - OUString aIncrTxt; - rDoc.GetFormatTable()->GetInputLineString( fIncrement, 0, aIncrTxt ); + OUString aIncrTxt = rDoc.GetFormatTable()->GetInputLineString( fIncrement, 0 ); m_xEdIncrement->set_text( aIncrTxt ); OUString aEndTxt; if ( fEndVal != MAXDOUBLE ) - rDoc.GetFormatTable()->GetInputLineString( fEndVal, 0, aEndTxt ); + aEndTxt = rDoc.GetFormatTable()->GetInputLineString( fEndVal, 0 ); m_xEdEndVal->set_text( aEndTxt ); } diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx index 248c1763badf..9cc4117ed403 100644 --- a/sc/source/ui/unoobj/cellsuno.cxx +++ b/sc/source/ui/unoobj/cellsuno.cxx @@ -5373,8 +5373,7 @@ void SAL_CALL ScCellRangeObj::filter( const uno::Reference<sheet::XSheetFilterDe ScQueryEntry::Item& rItem = rItems.front(); if (rItem.meType != ScQueryEntry::ByString) { - OUString aStr; - pDocSh->GetDocument().GetFormatTable()->GetInputLineString(rItem.mfVal, 0, aStr); + OUString aStr = pDocSh->GetDocument().GetFormatTable()->GetInputLineString(rItem.mfVal, 0); rItem.maString = rPool.intern(aStr); } } diff --git a/sc/source/ui/unoobj/datauno.cxx b/sc/source/ui/unoobj/datauno.cxx index 170f1a58993d..db8946232706 100644 --- a/sc/source/ui/unoobj/datauno.cxx +++ b/sc/source/ui/unoobj/datauno.cxx @@ -1085,8 +1085,7 @@ void fillQueryParam( if (rItem.meType == ScQueryEntry::ByValue) { - OUString aStr; - pDoc->GetFormatTable()->GetInputLineString(rItem.mfVal, 0, aStr); + OUString aStr = pDoc->GetFormatTable()->GetInputLineString(rItem.mfVal, 0); rItem.maString = rPool.intern(aStr); } } @@ -1142,8 +1141,7 @@ void fillQueryParam( if (aItem.meType == ScQueryEntry::ByValue) { - OUString aStr; - pDoc->GetFormatTable()->GetInputLineString(aItem.mfVal, 0, aStr); + OUString aStr = pDoc->GetFormatTable()->GetInputLineString(aItem.mfVal, 0); aItem.maString = rPool.intern(aStr); } else if (aItem.meType == ScQueryEntry::ByTextColor @@ -1321,8 +1319,7 @@ void SAL_CALL ScFilterDescriptorBase::setFilterFields( if (rItem.meType != ScQueryEntry::ByString) { - OUString aStr; - rDoc.GetFormatTable()->GetInputLineString(rItem.mfVal, 0, aStr); + OUString aStr = rDoc.GetFormatTable()->GetInputLineString(rItem.mfVal, 0); rItem.maString = rPool.intern(aStr); } |