vcl/source/window/layout.cxx |   11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

New commits:
commit b7efccde76ca7bfa181fff39c52282e87e940614
Author:     Xisco Fauli <xiscofa...@libreoffice.org>
AuthorDate: Thu May 26 16:45:30 2022 +0200
Commit:     Miklos Vajna <vmik...@collabora.com>
CommitDate: Fri May 27 08:04:51 2022 +0200

    tdf#147844: Use sanity check only if LibreOfficeKit is active
    
    Regression from 2b58a0979f9206cfca6d78cb2f3d5e65cd735f8b
    "Add sanity check to avoid potential crash in the Collabora Online
    server"
    
    Change-Id: I2fcfb634b47f9d76f8efbbd64a8e69ea236894c3
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135024
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <vmik...@collabora.com>

diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx
index b67ffeabbfd4..4c9b23dbdb94 100644
--- a/vcl/source/window/layout.cxx
+++ b/vcl/source/window/layout.cxx
@@ -14,6 +14,7 @@
 #include <config_features.h>
 #include <com/sun/star/accessibility/AccessibleRole.hpp>
 #include <comphelper/base64.hxx>
+#include <comphelper/lok.hxx>
 #include <o3tl/enumarray.hxx>
 #include <o3tl/enumrange.hxx>
 #include <o3tl/string_view.hxx>
@@ -283,10 +284,14 @@ void VclBox::setAllocation(const Size &rAllocation)
 // Though the dialogs are rendered in javascript for LOK Android some widgets 
like weld::DrawingArea
 // is sent as bitmap but it is rendered from only the visible part
 // when it gets negative, it shrinks instead of expands and it becomes 
invisible
-        if (nExtraSpace < 0)
+
+        if( comphelper::LibreOfficeKit::isActive() )
         {
-            SAL_WARN("vcl.layout", "nExtraSpace went negative, setting to zero 
for VclBox: " << GetHelpId());
-            nExtraSpace = 0;
+            if (nExtraSpace < 0)
+            {
+                SAL_WARN("vcl.layout", "nExtraSpace went negative, setting to 
zero for VclBox: " << GetHelpId());
+                nExtraSpace = 0;
+            }
         }
     }
 

Reply via email to