diff options
author | Luboš Luňák <l.lunak@centrum.cz> | 2021-02-25 20:59:45 +0000 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2021-03-01 15:55:47 +0100 |
commit | 6457ade879b90a6d84871cefe46e17e30e68920e (patch) | |
tree | 5d2abb9616e267ed816ab8586c7be21c9979f00b /vcl | |
parent | 9d8c04d2d5529626d649af3fcebb6d4b65193b28 (diff) |
do not repeatedly call getenv("SAL_NO_FONT_LOOKUP")
In the profiling data I see it actually takes 1% of the CPU time.
Change-Id: I55de0191ac9fb17095e7d137f4efc1735936e233
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111571
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/font/PhysicalFontCollection.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/vcl/source/font/PhysicalFontCollection.cxx b/vcl/source/font/PhysicalFontCollection.cxx index 6741f79faae2..5606b321af15 100644 --- a/vcl/source/font/PhysicalFontCollection.cxx +++ b/vcl/source/font/PhysicalFontCollection.cxx @@ -948,7 +948,8 @@ PhysicalFontFamily* PhysicalFontCollection::FindFontFamily( FontSelectPattern& r if( !Count() ) return nullptr; - if (getenv("SAL_NO_FONT_LOOKUP") != nullptr) + static bool noFontLookup = getenv("SAL_NO_FONT_LOOKUP") != nullptr; + if (noFontLookup) { // Hard code the use of Liberation Sans and skip font search. sal_Int32 nIndex = 0; |