summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2014-07-12 21:46:13 -0400
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2014-07-15 16:07:34 +0000
commit628f27b42a5911288e15ae9edf182578dd32a4da (patch)
treef54691dd1118333551cb3c84e4562d5e824b4306
parent8073e91a9f89ab313ae4de86b5909ff3a16594e5 (diff)
fdo#80462: Don't always increment the start row position.
Sometimes someone might attempt to sort only a single row. Change-Id: Ie29d4cf7ec0bd3a5c945997083368b6ef6074268 (cherry picked from commit 5902dcf0995cdd0a6c1dbd1f9c21b0b2b3f5609f) Reviewed-on: https://gerrit.libreoffice.org/10259 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com> (cherry picked from commit ee5895488c43954b25b26076ec9241e7c741cffd) Reviewed-on: https://gerrit.libreoffice.org/10273 Reviewed-by: Muthu Subramanian K <muthusuba@gmail.com> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com> Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
-rw-r--r--sc/source/ui/docshell/dbdocfun.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/sc/source/ui/docshell/dbdocfun.cxx b/sc/source/ui/docshell/dbdocfun.cxx
index deaf24481a34..8238b9a42457 100644
--- a/sc/source/ui/docshell/dbdocfun.cxx
+++ b/sc/source/ui/docshell/dbdocfun.cxx
@@ -490,7 +490,9 @@ bool ScDBDocFunc::Sort( SCTAB nTab, const ScSortParam& rSortParam,
WaitObject aWait( rDocShell.GetActiveDialogParent() );
- SCROW nStartRow = aLocalParam.nRow1 + (aLocalParam.bHasHeader ? 1 : 0);
+ SCROW nStartRow = aLocalParam.nRow1;
+ if (aLocalParam.bByRow && aLocalParam.bHasHeader && nStartRow < aLocalParam.nRow2)
+ ++nStartRow;
// Calculate the script types for all cells in the sort range beforehand.
// This will speed up the row height adjustment that takes place after the