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

Szymon KÅ‚os (via logerrit) logerrit at kemper.freedesktop.org
Fri Apr 16 11:10:10 UTC 2021


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

New commits:
commit bbbd6ce1c61fe8b1335e16dfa7b75c6bb5d375e4
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Wed Mar 24 15:38:59 2021 +0100
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Fri Apr 16 13:09:28 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>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114153
    Tested-by: Jenkins
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>

diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx
index e47c760390ec..980e887c16e2 100644
--- a/sc/source/ui/view/viewdata.cxx
+++ b/sc/source/ui/view/viewdata.cxx
@@ -4031,7 +4031,12 @@ void ScViewData::AddPixelsWhile( tools::Long & rScrY, tools::Long nEndPixels, SC
         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