diff options
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/image/ImplImageTree.cxx | 12 |
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( |