vcl/source/gdi/FileDefinitionWidgetDraw.cxx |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit a14d492c3f07c3eafb00f5478461c03ffaa4e42f
Author:     Michael Meeks <[email protected]>
AuthorDate: Thu Jan 15 12:46:53 2026 +0000
Commit:     Andras Timar <[email protected]>
CommitDate: Fri Jan 16 11:55:39 2026 +0100

    Avoid statting share/theme_definitions/online continually.
    
    It is not clear that this FileDefinition drawing code is ever used,
    but getting rid of this is perhaps helpful.
    
    Signed-off-by: Michael Meeks <[email protected]>
    Change-Id: I735c8cc9eb5280afa2e4cdd42597b6a0ea9a2718
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197368
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Andras Timar <[email protected]>

diff --git a/vcl/source/gdi/FileDefinitionWidgetDraw.cxx 
b/vcl/source/gdi/FileDefinitionWidgetDraw.cxx
index 9613fae354c8..3cd3f636b261 100644
--- a/vcl/source/gdi/FileDefinitionWidgetDraw.cxx
+++ b/vcl/source/gdi/FileDefinitionWidgetDraw.cxx
@@ -80,8 +80,10 @@ std::shared_ptr<WidgetDefinition> const&
 getWidgetDefinitionForTheme(std::u16string_view rThemenName)
 {
     static std::shared_ptr<WidgetDefinition> spDefinition;
-    if (!spDefinition)
+    static bool bAlreadyChecked = false;
+    if (!bAlreadyChecked)
     {
+        bAlreadyChecked = true;
         OUString sSharedDefinitionBasePath = lcl_getThemeDefinitionPath();
         OUString sThemeFolder = sSharedDefinitionBasePath + rThemenName + "/";
         OUString sThemeDefinitionFile = sThemeFolder + "definition.xml";

Reply via email to