diff options
author | Kohei Yoshida <kohei.yoshida@collabora.com> | 2013-09-09 23:14:19 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@collabora.com> | 2013-09-10 11:47:46 -0400 |
commit | ae0d98e18125ecd3fa92f4612a62da32c704579d (patch) | |
tree | cfc228641c64cbac0d58ea26a5ef65c8a238b4c3 /sc/source/core/data/table1.cxx | |
parent | 71958acc9c6650606e59321b9b9aaf8c11ef907f (diff) |
Trim data array length to remove trailing empty rows.
Change-Id: I61a6a289ad1c2c757fcea490ada5d40fee08e840
Diffstat (limited to 'sc/source/core/data/table1.cxx')
-rw-r--r-- | sc/source/core/data/table1.cxx | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx index 6391eeea3a8a..9af12d690c1e 100644 --- a/sc/source/core/data/table1.cxx +++ b/sc/source/core/data/table1.cxx @@ -987,6 +987,21 @@ bool ScTable::ShrinkToUsedDataArea( bool& o_bShrunk, SCCOL& rStartCol, SCROW& rS (rStartRow != rEndRow || aCol[rStartCol].HasDataAt( rStartRow))); } +SCROW ScTable::GetLastDataRow( SCCOL nCol1, SCCOL nCol2 ) const +{ + if (!ValidCol(nCol1) || !ValidCol(nCol2)) + return -1; + + SCROW nLastRow = 0; + for (SCCOL i = nCol1; i <= nCol2; ++i) + { + SCROW nThis = aCol[i].GetLastDataPos(); + if (nLastRow < nThis) + nLastRow = nThis; + } + + return nLastRow; +} SCSIZE ScTable::GetEmptyLinesInBlock( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, ScDirection eDir ) const |