diff options
author | Eike Rathke <erack@redhat.com> | 2014-02-10 20:52:07 +0100 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2014-02-10 20:53:37 +0100 |
commit | c782212abf4114b6dd366c38a44574be21c81eb1 (patch) | |
tree | 4c8cf7f4f65c2f924b3dff342b7244dd4501f625 /sc | |
parent | c32e93e561d234e289ce14b88a73368d7862ee47 (diff) |
use GetLastDataRow() also in ShrinkToUsedDataArea()
Change-Id: Ie9d729900d6096dc8f540b3bc52df749b15675e2
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/data/table1.cxx | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx index 1ba2c2c3b96f..45180cff6014 100644 --- a/sc/source/core/data/table1.cxx +++ b/sc/source/core/data/table1.cxx @@ -966,13 +966,10 @@ bool ScTable::ShrinkToUsedDataArea( bool& o_bShrunk, SCCOL& rStartCol, SCROW& rS if (rStartRow < rEndRow) { - bool bFound = false; - for (SCCOL i=rStartCol; i<=rEndCol && !bFound; i++) - if (aCol[i].HasDataAt( rEndRow)) - bFound = true; - if (!bFound) + SCROW nLastDataRow = GetLastDataRow( rStartCol, rEndCol, rEndRow); + if (0 <= nLastDataRow && nLastDataRow < rEndRow) { - --rEndRow; + rEndRow = std::max( rStartRow, nLastDataRow); bChanged = true; } } |