[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sc/source

Szymon KÅ‚os (via logerrit) logerrit at kemper.freedesktop.org
Wed Mar 31 08:43:54 UTC 2021


 sc/source/ui/view/viewdata.cxx |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit 41b66bb6701cc8de67b1dd0d72a10f6b92372f30
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Wed Mar 24 15:38:59 2021 +0100
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Wed Mar 31 10:43:22 2021 +0200

    Avoid infinite loop in AddPixelsWhile when removing Sheet
    
    When 2 sessions in online were used:
    A was in chart editing mode in the last sheet
    B removed last sheet
    
    infinite loop occured as GetRowHeight returned 0 due
    to invalid tab number.
    
    Change-Id: If5c4ba583dfb1154ff44e0bf651a098fa78bafda
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113044
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>

diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx
index a1ff8bc20051..b1470ad68b44 100644
--- a/sc/source/ui/view/viewdata.cxx
+++ b/sc/source/ui/view/viewdata.cxx
@@ -4044,7 +4044,12 @@ void ScViewData::AddPixelsWhile( long & rScrY, long nEndPixels, SCROW & rPosY,
         if (nHeightEndRow > nEndRow)
             nHeightEndRow = nEndRow;
         if (!nHeight)
-            nRow = nHeightEndRow + 1;
+        {
+            if (ValidTab(nTabNo) && nTabNo <= pDoc->GetMaxTableNumber())
+                nRow = nHeightEndRow + 1;
+            else
+                break;
+        }
         else
         {
             SCROW nRows = nHeightEndRow - nRow + 1;


More information about the Libreoffice-commits mailing list