diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-06-14 11:57:27 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-06-14 19:16:48 +0200 |
commit | f210fd9645258bac88a5fd1c0ffcf11ee428733b (patch) | |
tree | c06f482170b885d4ef5c71cf7a50b1c23524a330 /i18npool | |
parent | d900f60fa9f0a1772069cbe6e2536311393bff6d (diff) |
speed up startup time
by avoid conversion of static locale data from sal_Unicode to OUString
data - we can declare the data as OUStringConstExpr arrays and then
no conversion is necessary.
Change-Id: Ia8186b2e6540287eae1312bf9755d5e6bea359c8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153057
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'i18npool')
-rw-r--r-- | i18npool/source/localedata/LocaleNode.cxx | 8 | ||||
-rw-r--r-- | i18npool/source/localedata/localedata.cxx | 6 |
2 files changed, 7 insertions, 7 deletions
diff --git a/i18npool/source/localedata/LocaleNode.cxx b/i18npool/source/localedata/LocaleNode.cxx index a6e22bf8cedc..e0cac2020d4c 100644 --- a/i18npool/source/localedata/LocaleNode.cxx +++ b/i18npool/source/localedata/LocaleNode.cxx @@ -618,7 +618,7 @@ void LCFormatNode::generateCode (const OFileWriter &of) const { case 0: of.writeOUStringRefFunction("getAllFormats0_", useLocale, "replaceTo0"); - of.writeRefFunction("getDateAcceptancePatterns_", useLocale); + of.writeOUStringRefFunction("getDateAcceptancePatterns_", useLocale); break; case 1: of.writeOUStringRefFunction("getAllFormats1_", useLocale, "replaceTo1"); @@ -1288,14 +1288,14 @@ void LCFormatNode::generateCode (const OFileWriter &of) const for (sal_Int16 i = 0; i < nbOfDateAcceptancePatterns; ++i) { - of.writeParameter("DateAcceptancePattern", theDateAcceptancePatterns[i], i); + of.writeOUStringLiteralParameter("DateAcceptancePattern", theDateAcceptancePatterns[i], i); } of.writeAsciiString("static const sal_Int16 DateAcceptancePatternsCount = "); of.writeInt( nbOfDateAcceptancePatterns); of.writeAsciiString(";\n"); - of.writeAsciiString("static const sal_Unicode* DateAcceptancePatternsArray[] = {\n"); + of.writeAsciiString("static constexpr rtl::OUStringConstExpr DateAcceptancePatternsArray[] = {\n"); for (sal_Int16 i = 0; i < nbOfDateAcceptancePatterns; ++i) { of.writeAsciiString("\t"); @@ -1305,7 +1305,7 @@ void LCFormatNode::generateCode (const OFileWriter &of) const } of.writeAsciiString("};\n\n"); - of.writeFunction("getDateAcceptancePatterns_", "DateAcceptancePatternsCount", "DateAcceptancePatternsArray"); + of.writeOUStringFunction("getDateAcceptancePatterns_", "DateAcceptancePatternsCount", "DateAcceptancePatternsArray"); } ++mnSection; diff --git a/i18npool/source/localedata/localedata.cxx b/i18npool/source/localedata/localedata.cxx index 8e10d2e5cf19..12149ca14ff7 100644 --- a/i18npool/source/localedata/localedata.cxx +++ b/i18npool/source/localedata/localedata.cxx @@ -875,17 +875,17 @@ LocaleDataImpl::getAllFormats( const Locale& rLocale ) Sequence< OUString > SAL_CALL LocaleDataImpl::getDateAcceptancePatterns( const Locale& rLocale ) { - MyFunc_Type func = reinterpret_cast<MyFunc_Type>(getFunctionSymbol( rLocale, "getDateAcceptancePatterns" )); + MyFuncOUString_Type func = reinterpret_cast<MyFuncOUString_Type>(getFunctionSymbol( rLocale, "getDateAcceptancePatterns" )); if (func) { sal_Int16 patternsCount = 0; - sal_Unicode **patternsArray = func( patternsCount ); + OUString const *patternsArray = func( patternsCount ); Sequence< OUString > seq( patternsCount ); auto seqRange = asNonConstRange(seq); for (sal_Int16 i = 0; i < patternsCount; ++i) { - seqRange[i] = OUString( patternsArray[i] ); + seqRange[i] = patternsArray[i]; } return seq; } |