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 19:06:29 +0100
commit1e4235f8b2dc693b0fb1edade9db25a631bdbf94 (patch)
tree6157408fe614ec238ddb8869c4bbbbbeb77af5ab
parent9d55835551621d6268656c553db53a877c91e7dc (diff)
actually use identical code for both byRow and byCol, fdo#81501 follow-up
Change-Id: I982e03a12dd80be0787f22dce4495065775e7de0
-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 edeeaeb025d7..34561487d060 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -1541,10 +1541,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());
@@ -1576,11 +1577,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))