summaryrefslogtreecommitdiff
path: root/vcl/source/image/ImplImageTree.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-04-13 11:29:01 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-04-13 13:44:44 +0200
commit05867c4e5f6d244f0f18db2a00e6fbc0d8141a41 (patch)
tree336ea703acc2e0b22b17865b71fadbe53808679e /vcl/source/image/ImplImageTree.cxx
parent5de22d1e559cd0f1f5fa4e247f0ce153710fbeab (diff)
tdf#80633 speed up dialog layout
some small speedups when opening Format->Paragraph Change-Id: If97725ecff45b9c2c01b405e153ec05b12882573 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132952 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/source/image/ImplImageTree.cxx')
-rw-r--r--vcl/source/image/ImplImageTree.cxx12
1 files changed, 8 insertions, 4 deletions
diff --git a/vcl/source/image/ImplImageTree.cxx b/vcl/source/image/ImplImageTree.cxx
index 4c2e63c57cae..3979206cb184 100644
--- a/vcl/source/image/ImplImageTree.cxx
+++ b/vcl/source/image/ImplImageTree.cxx
@@ -107,10 +107,14 @@ OUString createPath(std::u16string_view name, sal_Int32 pos, std::u16string_view
OUString getIconCacheUrl(std::u16string_view sVariant, ImageRequestParameters const & rParameters)
{
- OUString sUrl = "${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" SAL_CONFIGFILE("bootstrap") ":UserInstallation}/cache/"
- + rParameters.msStyle + "/" + sVariant + "/" + rParameters.msName;
- rtl::Bootstrap::expandMacros(sUrl);
- return sUrl;
+ // the macro expansion can be expensive in bulk, so cache that
+ static OUString CACHE_DIR = []()
+ {
+ OUString sDir = "${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" SAL_CONFIGFILE("bootstrap") ":UserInstallation}/cache/";
+ rtl::Bootstrap::expandMacros(sDir);
+ return sDir;
+ }();
+ return CACHE_DIR + rParameters.msStyle + "/" + sVariant + "/" + rParameters.msName;
}
OUString createIconCacheUrl(