[Libreoffice-commits] core.git: vcl/source

Luboš Luňák (via logerrit) logerrit at kemper.freedesktop.org
Mon Mar 1 14:56:32 UTC 2021


 vcl/source/font/PhysicalFontCollection.cxx |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 6457ade879b90a6d84871cefe46e17e30e68920e
Author:     Luboš Luňák <l.lunak at centrum.cz>
AuthorDate: Thu Feb 25 20:59:45 2021 +0000
Commit:     Luboš Luňák <l.lunak at collabora.com>
CommitDate: Mon Mar 1 15:55:47 2021 +0100

    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 at collabora.com>

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;


More information about the Libreoffice-commits mailing list