summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2014-12-05 19:03:25 +0100
committerEike Rathke <erack@redhat.com>2014-12-05 20:00:46 +0100
commitba410bdb74e2f1fcc011934380890fc7fa872777 (patch)
tree16eb11be69e408eb9e1c96b4608baf0462bb3b45 /sc/source
parentded77b3983f1ccf7f7b611c59da9f2156ea7a0df (diff)
trim also empty leading column ranges, fdo#81501 follow-up
Change-Id: Ieaeea85149e4b6d263b112205bb17c155e2d12be (cherry picked from commit c7b57c6c2b15a4b9f65dafb642e3f1da402e62ca)
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/core/data/table3.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index fc59e00a6878..c9559209f98a 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -1539,7 +1539,10 @@ void ScTable::Sort(
pUndo->mbUpdateRefs = bUpdateRefs;
}
- while (aSortParam.nCol2 > aSortParam.nCol1 && aCol[aSortParam.nCol2].IsEmptyBlock(aSortParam.nRow1, aSortParam.nRow2))
+ // Trim empty leading and trailing column ranges.
+ while (aSortParam.nCol1 < aSortParam.nCol2 && aCol[aSortParam.nCol1].IsEmptyBlock(aSortParam.nRow1, aSortParam.nRow2))
+ ++aSortParam.nCol1;
+ while (aSortParam.nCol1 < aSortParam.nCol2 && aCol[aSortParam.nCol2].IsEmptyBlock(aSortParam.nRow1, aSortParam.nRow2))
--aSortParam.nCol2;
if (rSortParam.bByRow)