use GetLastDataRow() also in ShrinkToUsedDataArea()

Change-Id: Ie9d729900d6096dc8f540b3bc52df749b15675e2
This commit is contained in:
Eike Rathke
2014-02-10 20:52:07 +01:00
parent c32e93e561
commit c782212abf

View File

@@ -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;
}
}