diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-06-26 15:20:32 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-06-28 12:48:40 +0200 |
commit | 1ec6de1cff6a5f2c15aa85c12c6e327282ca8703 (patch) | |
tree | f9d1f693747ff00139213a1e000d04deda8b9a9a /i18npool | |
parent | 47e04cf31c6165dd55dc20962ad9c72962b958bd (diff) |
tdf#125706 Fields slow down down load, cache NativeNumberSupplierService
Cache the NativeNumberSupplierService in DefaultNumberingProvider.
Takes the load time from 5s to 4.5s.
Change-Id: I13de1cd4db8785a1c94d40fb163bcc9b80a5c7f5
Reviewed-on: https://gerrit.libreoffice.org/74741
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'i18npool')
-rw-r--r-- | i18npool/inc/defaultnumberingprovider.hxx | 6 | ||||
-rw-r--r-- | i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx | 5 |
2 files changed, 8 insertions, 3 deletions
diff --git a/i18npool/inc/defaultnumberingprovider.hxx b/i18npool/inc/defaultnumberingprovider.hxx index eb9446c7098b..f01378ab075e 100644 --- a/i18npool/inc/defaultnumberingprovider.hxx +++ b/i18npool/inc/defaultnumberingprovider.hxx @@ -28,7 +28,10 @@ namespace com::sun::star::container { class XHierarchicalNameAccess; } namespace com::sun::star::uno { class XComponentContext; } -namespace i18npool { class TransliterationImpl; } +namespace i18npool { + class TransliterationImpl; + class NativeNumberSupplierService; +} namespace i18npool { @@ -74,6 +77,7 @@ private: css::uno::Reference < css::uno::XComponentContext > m_xContext; css::uno::Reference < css::container::XHierarchicalNameAccess > xHierarchicalNameAccess; rtl::Reference<TransliterationImpl> translit; + rtl::Reference<NativeNumberSupplierService> mxNatNum; /// @throws css::uno::RuntimeException OUString makeNumberingIdentifier( sal_Int16 index ); /// @throws css::uno::RuntimeException diff --git a/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx b/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx index ce6eb1dde781..5e21a5a4dc5d 100644 --- a/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx +++ b/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx @@ -905,8 +905,9 @@ DefaultNumberingProvider::makeNumberingString( const Sequence<beans::PropertyVal } if (natNum) { - rtl::Reference<NativeNumberSupplierService> xNatNum(new NativeNumberSupplierService); - result += xNatNum->getNativeNumberStringParams(OUString::number(number), locale, + if (!mxNatNum) + mxNatNum.set(new NativeNumberSupplierService); + result += mxNatNum->getNativeNumberStringParams(OUString::number(number), locale, natNum, sNatNumParams); } else if (tableSize) { if ( number > tableSize && !bRecycleSymbol) |