diff options
author | Bartosz Kosiorek <gang65@poczta.onet.pl> | 2017-01-28 15:18:08 +0100 |
---|---|---|
committer | Bartosz Kosiorek <gang65@poczta.onet.pl> | 2017-02-08 23:13:07 +0000 |
commit | 0e0fef10002b46965edad02b3f460a502d9f6595 (patch) | |
tree | 741f3e8251882c8e13ea803fe69aa1ba77969f40 /sc | |
parent | b78c6d8efd9531243e62a388bffc3f071d9a56eb (diff) |
tdf#50916 Allow proper updating, deleting and inserting tabs
Change-Id: Ib318c3ff14970483fdcda1fdd6de9969f47ccbe8
Reviewed-on: https://gerrit.libreoffice.org/33647
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/data/table1.cxx | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx index bb899e5e4e60..1869808c6d98 100644 --- a/sc/source/core/data/table1.cxx +++ b/sc/source/core/data/table1.cxx @@ -1692,7 +1692,7 @@ void ScTable::UpdateInsertTab( sc::RefUpdateInsertTabContext& rCxt ) ScRange( 0, 0, rCxt.mnInsertPos, MAXCOL, MAXROW, MAXTAB), 0, 0, rCxt.mnSheets); - for (SCCOL i=0; i <= MAXCOL; i++) + for (SCCOL i=0; i < aCol.size(); i++) aCol[i].UpdateInsertTab(rCxt); if (IsStreamValid()) @@ -1722,7 +1722,7 @@ void ScTable::UpdateDeleteTab( sc::RefUpdateDeleteTabContext& rCxt ) ScRange( 0, 0, rCxt.mnDeletePos, MAXCOL, MAXROW, MAXTAB), 0, 0, -rCxt.mnSheets); - for (SCCOL i = 0; i <= MAXCOL; ++i) + for (SCCOL i = 0; i < aCol.size(); ++i) aCol[i].UpdateDeleteTab(rCxt); if (IsStreamValid()) @@ -1747,7 +1747,7 @@ void ScTable::UpdateMoveTab( ScRange( 0, 0, rCxt.mnOldPos, MAXCOL, MAXROW, MAXTAB), 0, 0, rCxt.mnNewPos - rCxt.mnOldPos); - for ( SCCOL i=0; i <= MAXCOL; i++ ) + for ( SCCOL i=0; i < aCol.size(); i++ ) { aCol[i].UpdateMoveTab(rCxt, nTabNo); if (pProgress) @@ -1760,7 +1760,7 @@ void ScTable::UpdateMoveTab( void ScTable::UpdateCompile( bool bForceIfNameInUse ) { - for (SCCOL i=0; i <= MAXCOL; i++) + for (SCCOL i=0; i < aCol.size(); i++) { aCol[i].UpdateCompile( bForceIfNameInUse ); } @@ -1769,7 +1769,8 @@ void ScTable::UpdateCompile( bool bForceIfNameInUse ) void ScTable::SetTabNo(SCTAB nNewTab) { nTab = nNewTab; - for (SCCOL i=0; i <= MAXCOL; i++) aCol[i].SetTabNo(nNewTab); + for (SCCOL i=0; i < aCol.size(); i++) + aCol[i].SetTabNo(nNewTab); } void ScTable::FindRangeNamesInUse(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, @@ -1809,6 +1810,11 @@ void ScTable::ExtendPrintArea( OutputDevice* pDev, // These columns are visible. Check for empty columns. for (SCCOL j = i; j <= nLastCol; ++j) { + if ( j >= aCol.size() ) + { + aSkipCols.setTrue( j, MAXCOL ); + break; + } if (aCol[j].GetCellCount() == 0) // empty aSkipCols.setTrue(j,j); |