[Libreoffice-commits] core.git: Branch 'libreoffice-5-4' - sc/source

Eike Rathke erack at redhat.com
Wed Jun 21 21:44:04 UTC 2017


 sc/source/ui/view/viewdata.cxx |   10 ++++++++++
 1 file changed, 10 insertions(+)

New commits:
commit 1fa02810cb946733a22519e8df0c8a2608fcd084
Author: Eike Rathke <erack at redhat.com>
Date:   Wed Jun 21 17:42:42 2017 +0200

    Resolves: tdf#108654 check nTabNo against maTabData size
    
    ScViewData::DeleteTab() and DeleteTabs() never did that and worked by accident
    for which commit 73dec49802ef8fc42c5719efaa42a33cde68e569 removed the
    grounding..
    
    Change-Id: I95460cd017d558c073df7891551d0251009dc1d4
    (cherry picked from commit 87cbbdc98d78c3c15f7161de6fec93d8680ee1de)
    Reviewed-on: https://gerrit.libreoffice.org/39066
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Jenkins <ci at libreoffice.org>

diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx
index 54fc06227563..789e84c17e46 100644
--- a/sc/source/ui/view/viewdata.cxx
+++ b/sc/source/ui/view/viewdata.cxx
@@ -546,6 +546,11 @@ void ScViewData::DeleteTab( SCTAB nTab )
     delete maTabData.at(nTab);
 
     maTabData.erase(maTabData.begin() + nTab);
+    if (static_cast<size_t>(nTabNo) >= maTabData.size())
+    {
+        EnsureTabDataSize(1);
+        nTabNo = maTabData.size() - 1;
+    }
     UpdateCurrentTab();
     mpMarkData->DeleteTab( nTab );
 }
@@ -559,6 +564,11 @@ void ScViewData::DeleteTabs( SCTAB nTab, SCTAB nSheets )
     }
 
     maTabData.erase(maTabData.begin() + nTab, maTabData.begin()+ nTab+nSheets);
+    if (static_cast<size_t>(nTabNo) >= maTabData.size())
+    {
+        EnsureTabDataSize(1);
+        nTabNo = maTabData.size() - 1;
+    }
     UpdateCurrentTab();
 }
 


More information about the Libreoffice-commits mailing list