diff options
author | Kohei Yoshida <kohei.yoshida@collabora.com> | 2013-09-10 11:16:22 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@collabora.com> | 2013-09-10 11:47:46 -0400 |
commit | a66aeace78f366800ba5bc8be0d334ea823179ab (patch) | |
tree | 9e736e2b81a8449c838ebd81ce85963affad1a56 /sc/inc | |
parent | de746be2078c191692d94d11006564ec60090b7d (diff) |
Add ability to specify starting row when querying for last non-empty row.
And it can only go upwards from there.
Change-Id: I4c8037f687dfdd0b6c937463696d628e78e4a8bf
Diffstat (limited to 'sc/inc')
-rw-r--r-- | sc/inc/column.hxx | 1 | ||||
-rw-r--r-- | sc/inc/document.hxx | 13 | ||||
-rw-r--r-- | sc/inc/table.hxx | 2 |
3 files changed, 11 insertions, 5 deletions
diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx index ba79c23fb83c..6d09ad165894 100644 --- a/sc/inc/column.hxx +++ b/sc/inc/column.hxx @@ -184,6 +184,7 @@ public: bool HasVisibleDataAt(SCROW nRow) const; SCROW GetFirstDataPos() const; SCROW GetLastDataPos() const; + SCROW GetLastDataPos( SCROW nLastRow ) const; bool GetPrevDataPos(SCROW& rRow) const; bool GetNextDataPos(SCROW& rRow) const; void FindDataAreaPos(SCROW& rRow, bool bDown) const; // (without Broadcaster) diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index 4cbf06a84b2b..6993abb0f8c7 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -1028,11 +1028,16 @@ public: SCCOL& rEndCol, SCROW& rEndRow, bool bColumnsOnly ) const; /** - * Return the last non-empty row position in given columns, or 0 if the - * columns are empty. A negative value is returned if the given sheet or - * column positions are invalid. + * Return the last non-empty row position in given columns that's no + * greater than the initial last row position, or 0 if the columns are + * empty. A negative value is returned if the given sheet or column + * positions are invalid. + * + * <p>It starts from the specified last row position, and finds the first + * non-empty row position in the upward direction if the start row + * position is empty.</p> */ - SCROW GetLastDataRow( SCTAB nTab, SCCOL nCol1, SCCOL nCol2 ) const; + SCROW GetLastDataRow( SCTAB nTab, SCCOL nCol1, SCCOL nCol2, SCROW nLastRow ) const; SC_DLLPUBLIC void GetDataArea( SCTAB nTab, SCCOL& rStartCol, SCROW& rStartRow, SCCOL& rEndCol, SCROW& rEndRow, bool bIncludeOld, bool bOnlyDown ) const; diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx index 9bf3f903a3d4..fc8ae3a7a9df 100644 --- a/sc/inc/table.hxx +++ b/sc/inc/table.hxx @@ -469,7 +469,7 @@ public: bool ShrinkToUsedDataArea( bool& o_bShrunk, SCCOL& rStartCol, SCROW& rStartRow, SCCOL& rEndCol, SCROW& rEndRow, bool bColumnsOnly ) const; - SCROW GetLastDataRow( SCCOL nCol1, SCCOL nCol2 ) const; + SCROW GetLastDataRow( SCCOL nCol1, SCCOL nCol2, SCROW nLastRow ) const; SCSIZE GetEmptyLinesInBlock( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, ScDirection eDir ) const; |