From b8b5e1e4149c409f42b02c09a7e4ff720af9873e Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 15 Jun 2023 10:52:32 +0200 Subject: 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: I652f02f6f1f354e2dab4f0ca866e8499cd3c50f5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153124 Tested-by: Jenkins Reviewed-by: Noel Grandin --- i18npool/source/localedata/LocaleNode.cxx | 12 ++++++------ i18npool/source/localedata/LocaleNode.hxx | 3 +++ i18npool/source/localedata/filewriter.cxx | 24 ++++++++++++++++++++++++ i18npool/source/localedata/localedata.cxx | 20 +++++++++----------- 4 files changed, 42 insertions(+), 17 deletions(-) (limited to 'i18npool') diff --git a/i18npool/source/localedata/LocaleNode.cxx b/i18npool/source/localedata/LocaleNode.cxx index d89a7515c8da..7b7dbd56c446 100644 --- a/i18npool/source/localedata/LocaleNode.cxx +++ b/i18npool/source/localedata/LocaleNode.cxx @@ -2223,7 +2223,7 @@ void LCNumberingLevelNode::generateCode (const OFileWriter &of) const OUString useLocale = getAttr().getValueByName("ref"); if (!useLocale.isEmpty()) { useLocale = useLocale.replace( '-', '_'); - of.writeRefFunction2("getContinuousNumberingLevels_", useLocale); + of.writeOUStringRefFunction2("getContinuousNumberingLevels_", useLocale); return; } @@ -2243,7 +2243,7 @@ void LCNumberingLevelNode::generateCode (const OFileWriter &of) const { const char* name = attr[j]; OUString value = q.getValueByName( name ); - of.writeParameter("continuous", name, value, sal::static_int_cast(i) ); + of.writeOUStringLiteralParameter("continuous", name, value, sal::static_int_cast(i) ); } } @@ -2258,7 +2258,7 @@ void LCNumberingLevelNode::generateCode (const OFileWriter &of) const // generate code. (intermediate arrays) for( i=0; i(i) ); of.writeAsciiString("[] = {\n"); for( sal_Int32 j=0; j(i)); of.writeAsciiString(",\n"); } - of.writeAsciiString("\t0\n};\n\n"); + of.writeAsciiString("\t\n};\n\n"); } // generate code. (top-level array) of.writeAsciiString("\n"); - of.writeAsciiString("static const sal_Unicode** LCContinuousNumberingLevelsArray[] = {\n" ); + of.writeAsciiString("static const rtl::OUStringConstExpr* LCContinuousNumberingLevelsArray[] = {\n" ); for( i=0; i > pv( nStyles ); @@ -1228,20 +1228,18 @@ LocaleDataImpl::getContinuousNumberingLevels( const lang::Locale& rLocale ) i = Sequence( nAttributes ); } - sal_Unicode const *** pStyle = p0; + OUString const ** pStyle = p0; for( int i=0; i