summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2014-12-05 18:36:03 +0100
committerEike Rathke <erack@redhat.com>2014-12-05 20:00:33 +0100
commitded77b3983f1ccf7f7b611c59da9f2156ea7a0df (patch)
tree42cc7b67a92f2208f4fda5e26f14f6bcb4fda96d
parentbc3755e041a6cdb678fb8c8093beb6b3a8e3f0e0 (diff)
actually use identical code for both byRow and byCol, fdo#81501 follow-up
Change-Id: I982e03a12dd80be0787f22dce4495065775e7de0 (cherry picked from commit 1e4235f8b2dc693b0fb1edade9db25a631bdbf94)
-rw-r--r--sc/source/core/data/table3.cxx11
1 files changed, 4 insertions, 7 deletions
diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index 63b3df05e23d..fc59e00a6878 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -1539,10 +1539,11 @@ void ScTable::Sort(
pUndo->mbUpdateRefs = bUpdateRefs;
}
+ while (aSortParam.nCol2 > aSortParam.nCol1 && aCol[aSortParam.nCol2].IsEmptyBlock(aSortParam.nRow1, aSortParam.nRow2))
+ --aSortParam.nCol2;
+
if (rSortParam.bByRow)
{
- while (aSortParam.nCol2 > aSortParam.nCol1 && aCol[aSortParam.nCol2].IsEmptyData())
- --aSortParam.nCol2;
SCROW nLastRow = 0;
for (SCCOL nCol = aSortParam.nCol1; nCol <= aSortParam.nCol2; nCol++)
nLastRow = std::max(nLastRow, aCol[nCol].GetLastDataPos());
@@ -1574,11 +1575,7 @@ void ScTable::Sort(
}
else
{
- SCCOL nLastCol;
- for (nLastCol = aSortParam.nCol2;
- (nLastCol > aSortParam.nCol1) && aCol[nLastCol].IsEmptyBlock(aSortParam.nRow1, aSortParam.nRow2); nLastCol--)
- {
- }
+ SCCOL nLastCol = aSortParam.nCol2;
SCCOL nCol1 = (rSortParam.bHasHeader ?
aSortParam.nCol1 + 1 : aSortParam.nCol1);
if (!IsSorted(nCol1, nLastCol))