summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-04-24 09:35:22 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-04-24 10:44:42 +0200
commit90e3b47b52f26420425a7417d2f51b6a386282d9 (patch)
tree97904d6374f51cc1ce5d0eca27daaf057fc9fdb1
parent4dba49c9f92de40c3935f1778cf301030db08343 (diff)
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@collabora.co.uk>
-rw-r--r--sc/source/core/data/documen5.cxx3
-rw-r--r--sc/source/core/data/document.cxx6
2 files changed, 6 insertions, 3 deletions
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;