summaryrefslogtreecommitdiff
path: root/unotools
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-09-21 09:56:14 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-09-21 14:51:37 +0200
commit96ff90857a066da70b04684f71237056e12eddfe (patch)
tree42558928d3593502fed98970f9632b20bf73300f /unotools
parent9994120c8d0fe8c5a029390ad7411b99c18ff5c9 (diff)
reduce cost of some getProperty calls (tdf#125892)
use OUStringLiteral to avoid cost of repeated OUString construction from ascii literal Change-Id: I4f8a4714c093e890adaa5524172bdc91231a561a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122379 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'unotools')
-rw-r--r--unotools/source/config/lingucfg.cxx12
1 files changed, 6 insertions, 6 deletions
diff --git a/unotools/source/config/lingucfg.cxx b/unotools/source/config/lingucfg.cxx
index bfb7959bc488..3b9232690fc2 100644
--- a/unotools/source/config/lingucfg.cxx
+++ b/unotools/source/config/lingucfg.cxx
@@ -213,7 +213,7 @@ namespace {
struct NamesToHdl
{
const char *pFullPropName; // full qualified name as used in configuration
- const char *pPropName; // property name only (atom) of above
+ OUString aPropName; // property name only (atom) of above
sal_Int32 nHdl; // numeric handle representing the property
};
@@ -257,9 +257,9 @@ NamesToHdl const aNamesToHdl[] =
{/* 31 */ "GrammarChecking/IsInteractiveCheck", UPN_IS_GRAMMAR_INTERACTIVE, UPH_IS_GRAMMAR_INTERACTIVE},
/* similar to entry 0 (thus no own configuration entry) but with different property name and type */
-{ nullptr, UPN_DEFAULT_LANGUAGE, UPH_DEFAULT_LANGUAGE},
+{ nullptr, UPN_DEFAULT_LANGUAGE, UPH_DEFAULT_LANGUAGE},
-{ nullptr, nullptr, -1}
+{ nullptr, "", -1}
};
uno::Sequence< OUString > SvtLinguConfigItem::GetPropertyNames()
@@ -304,16 +304,16 @@ bool SvtLinguConfigItem::GetHdlByName(
}
else
{
- while (pEntry && pEntry->pPropName != nullptr)
+ while (pEntry && pEntry->pFullPropName != nullptr)
{
- if (rPropertyName.equalsAscii( pEntry->pPropName ))
+ if (rPropertyName == pEntry->aPropName )
{
rnHdl = pEntry->nHdl;
break;
}
++pEntry;
}
- return pEntry && pEntry->pPropName != nullptr;
+ return pEntry && pEntry->pFullPropName != nullptr;
}
}