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

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Wed Apr 24 08:45:44 UTC 2019


 sc/source/core/data/documen5.cxx |    3 ++-
 sc/source/core/data/document.cxx |    6 ++++--
 2 files changed, 6 insertions(+), 3 deletions(-)

New commits:
commit 90e3b47b52f26420425a7417d2f51b6a386282d9
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Wed Apr 24 09:35:22 2019 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Wed Apr 24 10:44:42 2019 +0200

    tdf#124896 CRASH: deleting sheet
    
    regression from
        commit 7282014e362a1529a36c88eb308df8ed359c2cfa
        Date:   Fri Feb 1 15:15:16 2019 +0100
        tdf#50916 Makes numbers of columns dynamic.
    
    Change-Id: I3913e14cadc11efa1d9e7405cdbaf96fe094508a
    Reviewed-on: https://gerrit.libreoffice.org/71220
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/sc/source/core/data/documen5.cxx b/sc/source/core/data/documen5.cxx
index 0bb9379ea99a..76598f887443 100644
--- a/sc/source/core/data/documen5.cxx
+++ b/sc/source/core/data/documen5.cxx
@@ -529,7 +529,8 @@ void ScDocument::SetChartRangeList( const OUString& rChartName,
 
 bool ScDocument::HasData( SCCOL nCol, SCROW nRow, SCTAB nTab )
 {
-    if ( ValidTab(nTab) && nTab < static_cast<SCTAB>(maTabs.size()) && maTabs[nTab])
+    if ( ValidTab(nTab) && nTab < static_cast<SCTAB>(maTabs.size()) && maTabs[nTab]
+            && nCol < maTabs[nTab]->GetAllocatedColumnsCount())
         return maTabs[nTab]->HasData( nCol, nRow );
     else
         return false;
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index 134e5998ef22..d9cd4417f067 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -3765,7 +3765,8 @@ void ScDocument::GetCellType( SCCOL nCol, SCROW nRow, SCTAB nTab,
 
 bool ScDocument::HasStringData( SCCOL nCol, SCROW nRow, SCTAB nTab ) const
 {
-    if ( ValidTab(nTab) && nTab < static_cast<SCTAB>(maTabs.size()) && maTabs[nTab] )
+    if ( ValidTab(nTab) && nTab < static_cast<SCTAB>(maTabs.size()) && maTabs[nTab]
+            && nCol < maTabs[nTab]->GetAllocatedColumnsCount())
             return maTabs[nTab]->HasStringData( nCol, nRow );
     else
         return false;
@@ -3773,7 +3774,8 @@ bool ScDocument::HasStringData( SCCOL nCol, SCROW nRow, SCTAB nTab ) const
 
 bool ScDocument::HasValueData( SCCOL nCol, SCROW nRow, SCTAB nTab ) const
 {
-    if ( ValidTab(nTab) && nTab < static_cast<SCTAB>(maTabs.size()) && maTabs[nTab] )
+    if ( ValidTab(nTab) && nTab < static_cast<SCTAB>(maTabs.size()) && maTabs[nTab]
+            && nCol < maTabs[nTab]->GetAllocatedColumnsCount())
             return maTabs[nTab]->HasValueData( nCol, nRow );
     else
         return false;


More information about the Libreoffice-commits mailing list