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

Eike Rathke erack at redhat.com
Wed Jun 28 16:55:15 UTC 2017


 sc/source/ui/view/viewdata.cxx |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 0016602d20da3c60fb35dfaf0e6639cadbe64428
Author: Eike Rathke <erack at redhat.com>
Date:   Wed Jun 28 18:54:15 2017 +0200

    assert(nTab < static_cast<SCTAB>(maTabData.size())); cause of tdf#108796
    
    Have a dev friendly abort instead of a deep throw in case of the unexpected.
    
    Change-Id: Id07135cd7234767480032356636c668d20be3ff3

diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx
index f2d79b8fd4b4..16f8f2c0480f 100644
--- a/sc/source/ui/view/viewdata.cxx
+++ b/sc/source/ui/view/viewdata.cxx
@@ -543,9 +543,10 @@ void ScViewData::InsertTabs( SCTAB nTab, SCTAB nNewSheets )
 
 void ScViewData::DeleteTab( SCTAB nTab )
 {
+    assert(nTab < static_cast<SCTAB>(maTabData.size()));
     delete maTabData.at(nTab);
-
     maTabData.erase(maTabData.begin() + nTab);
+
     if (static_cast<size_t>(nTabNo) >= maTabData.size())
     {
         EnsureTabDataSize(1);
commit c9591f3b6153614c9849b8afbdcacbecc99c1f7c
Author: Eike Rathke <erack at redhat.com>
Date:   Wed Jun 28 18:51:16 2017 +0200

    Resolves: tdf#108796 let ScViewData::InsertTabs() insert the correct amount
    
    ... at the correct position. This only ever worked by chance, if at all, and
    now surfaced after
    
        commit 73dec49802ef8fc42c5719efaa42a33cde68e569
        Date:   Tue Mar 7 10:46:12 2017 +0100
    
    Change-Id: I9bd0aeb5a471bd644c1497306effe9045c1daa97

diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx
index cb7335a216ba..f2d79b8fd4b4 100644
--- a/sc/source/ui/view/viewdata.cxx
+++ b/sc/source/ui/view/viewdata.cxx
@@ -527,7 +527,7 @@ void ScViewData::InsertTab( SCTAB nTab )
 
 void ScViewData::InsertTabs( SCTAB nTab, SCTAB nNewSheets )
 {
-    if( nTab+nNewSheets >= static_cast<SCTAB>(maTabData.size()))
+    if (nTab >= static_cast<SCTAB>(maTabData.size()))
         maTabData.resize(nTab+nNewSheets, nullptr);
     else
     {


More information about the Libreoffice-commits mailing list