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

New commits:
commit 7e0eefac2fc6203fa7e853cd4049457f1d3b377b
Author:     Tor Lillqvist <t...@collabora.com>
AuthorDate: Tue Jan 25 16:57:09 2022 +0200
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Tue Jan 25 21:33:45 2022 +0100

    Add sanity check to avoid potential crash in the Collabora Online server
    
    Make sure some coordinates don't become huge negative numbers. This
    doesn't fix the unknown root cause of course.
    
    I could not actually reproduce the crash with a server based on this
    branch, though. There already was such a sanity check here in this
    branch, but for Android only. I now made it cross-platform.
    
    Let's use the same Change-Id as in the corresponding commit in the
    co-2021 branch.
    
    Change-Id: I28e343271b3f80ac203b52db1be58d2add89eecd
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128932
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Andras Timar <andras.ti...@collabora.com>

diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx
index edebff002f8f..5c7a9d1e4355 100644
--- a/vcl/source/window/layout.cxx
+++ b/vcl/source/window/layout.cxx
@@ -267,10 +267,11 @@ 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 HAVE_FEATURE_ANDROID_LOK
         if (nExtraSpace < 0)
+        {
+            SAL_WARN("vcl.layout", "nExtraSpace went negative, setting to 
zero");
             nExtraSpace = 0;
-#endif
+        }
     }
 
     //Split into those we pack from the start onwards, and those we pack from 
the end backwards

Reply via email to