summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2021-05-01 08:30:46 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-05-02 10:00:43 +0200
commit86b345a963a64fd9b9a3cab522b3ac2e909977fd (patch)
treeb55be7134aa02c203b0b4eea6afeab3aecfd65a6 /xmloff
parentaa38eede9d340cbb11a792ab1ebbe681521a4489 (diff)
tdf#79049 speed up OOXML workbook load (4)
Optimise LocaleDataWrapper for reads by initialising the data we in the constructor, so we don't need any kind of locking Reduces load time from 34s to 28s. Change-Id: I4bd3bddb30b70ba015fe5b1372534f9507762b74 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114960 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/style/xmlnumfe.cxx3
-rw-r--r--xmloff/source/style/xmlnumfi.cxx4
2 files changed, 3 insertions, 4 deletions
diff --git a/xmloff/source/style/xmlnumfe.cxx b/xmloff/source/style/xmlnumfe.cxx
index 1392c4e0f2f7..38c4d42d2986 100644
--- a/xmloff/source/style/xmlnumfe.cxx
+++ b/xmloff/source/style/xmlnumfe.cxx
@@ -1623,7 +1623,8 @@ void SvXMLNumFmtExport::ExportPart_Impl( const SvNumberformat& rFormat, sal_uInt
if ( nElemType == NF_KEY_NNNN )
{
// write additional text element for separator
- pLocaleData->setLanguageTag( LanguageTag( nLang ) );
+ pLocaleData.reset( new LocaleDataWrapper( pFormatter->GetComponentContext(),
+ LanguageTag( nLang ) ) );
AddToTextElement_Impl( pLocaleData->getLongDateDayOfWeekSep() );
}
}
diff --git a/xmloff/source/style/xmlnumfi.cxx b/xmloff/source/style/xmlnumfi.cxx
index a62133cfff99..f7cabc5fa29f 100644
--- a/xmloff/source/style/xmlnumfi.cxx
+++ b/xmloff/source/style/xmlnumfi.cxx
@@ -365,12 +365,10 @@ void SvXMLNumImpData::RemoveVolatileFormats()
const LocaleDataWrapper& SvXMLNumImpData::GetLocaleData( LanguageType nLang )
{
- if ( !pLocaleData )
+ if ( !pLocaleData || pLocaleData->getLanguageTag() != LanguageTag(nLang) )
pLocaleData = std::make_unique<LocaleDataWrapper>(
pFormatter ? pFormatter->GetComponentContext() : m_xContext,
LanguageTag( nLang ) );
- else
- pLocaleData->setLanguageTag( LanguageTag( nLang ) );
return *pLocaleData;
}