From e51b4fc8c278bfa0b0671bbdb0ab35346881ebb7 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 15 Jun 2023 12:47:41 +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: Idd27071c1200d6ced2c4f43e10310df786fbc8fe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153125 Tested-by: Jenkins Reviewed-by: Noel Grandin --- i18npool/source/localedata/LocaleNode.cxx | 15 +++++++-------- i18npool/source/localedata/LocaleNode.hxx | 2 ++ i18npool/source/localedata/filewriter.cxx | 18 ++++++++++++++++++ i18npool/source/localedata/localedata.cxx | 10 +++++----- 4 files changed, 32 insertions(+), 13 deletions(-) (limited to 'i18npool') diff --git a/i18npool/source/localedata/LocaleNode.cxx b/i18npool/source/localedata/LocaleNode.cxx index 7b7dbd56c446..7531afa5aff2 100644 --- a/i18npool/source/localedata/LocaleNode.cxx +++ b/i18npool/source/localedata/LocaleNode.cxx @@ -2294,7 +2294,7 @@ void LCOutlineNumberingLevelNode::generateCode (const OFileWriter &of) const OUString useLocale = getAttr().getValueByName("ref"); if (!useLocale.isEmpty()) { useLocale = useLocale.replace( '-', '_'); - of.writeRefFunction3("getOutlineNumberingLevels_", useLocale); + of.writeOUStringRefFunction3("getOutlineNumberingLevels_", useLocale); return; } @@ -2331,7 +2331,7 @@ void LCOutlineNumberingLevelNode::generateCode (const OFileWriter &of) const { const char* name = attr[k]; OUString value = q.getValueByName( name ); - of.writeParameter("outline", name, value, + of.writeOUStringLiteralParameter("outline", name, value, sal::static_int_cast(i), sal::static_int_cast(j) ); } @@ -2372,7 +2372,7 @@ void LCOutlineNumberingLevelNode::generateCode (const OFileWriter &of) const { for( sal_Int32 j=0; j(i) ); of.writeAsciiString("Level"); @@ -2387,7 +2387,7 @@ void LCOutlineNumberingLevelNode::generateCode (const OFileWriter &of) const of.writeInt( sal::static_int_cast(j) ); of.writeAsciiString(", "); } - of.writeAsciiString("NULL };\n"); + of.writeAsciiString(" };\n"); } } @@ -2396,8 +2396,7 @@ void LCOutlineNumberingLevelNode::generateCode (const OFileWriter &of) const for( sal_Int32 i=0; i(i) ); of.writeAsciiString("[] = { "); @@ -2413,7 +2412,7 @@ void LCOutlineNumberingLevelNode::generateCode (const OFileWriter &of) const } of.writeAsciiString("\n"); - of.writeAsciiString("static const sal_Unicode*** LCOutlineNumberingLevelsArray[] = {\n" ); + of.writeAsciiString("static constexpr rtl::OUStringConstExpr const * const * LCOutlineNumberingLevelsArray[] = {\n" ); for( sal_Int32 i=0; i > aRet( nStyles ); auto aRetRange = asNonConstRange(aRet); - sal_Unicode const **** pStyle = p0; + OUString const *** pStyle = p0; for( i=0; i level(new OutlineNumberingLevel_Impl[ nLevels+1 ]); - sal_Unicode const *** pLevel = pStyle[i]; + OUString const ** pLevel = pStyle[i]; for( j = 0; j < nLevels; j++ ) { - sal_Unicode const ** pAttribute = pLevel[j]; + OUString const * pAttribute = pLevel[j]; for( int k=0; k