sc/source/core/data/table1.cxx | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-)
New commits: commit 0e0fef10002b46965edad02b3f460a502d9f6595 Author: Bartosz Kosiorek <gan...@poczta.onet.pl> Date: Sat Jan 28 15:18:08 2017 +0100 tdf#50916 Allow proper updating, deleting and inserting tabs Change-Id: Ib318c3ff14970483fdcda1fdd6de9969f47ccbe8 Reviewed-on: https://gerrit.libreoffice.org/33647 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Bartosz Kosiorek <gan...@poczta.onet.pl> diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx index bb899e5..1869808 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); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits