diff options
author | scito <info@scito.ch> | 2015-04-13 10:33:37 +0200 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-04-30 12:18:56 +0000 |
commit | 00836605a441b8b1d548d8c32f63535f3240ac61 (patch) | |
tree | a53a67ecb87caa7ab69ef279de32589cdbb944a6 | |
parent | c76b4dd2c323291ccf546d371cf524e08af9436d (diff) |
tdf#63416 Do not sort header in autofilter if user has chosen one in dialog
This patch fixes only a part of the issue. It respects the header if
chosen by the user in the autofilter dialog showing when the first row
contains empty cells or numbers. With minimal effort a lot is fixed
(80-20-rule). With headers, the autofilter sorting works with empty or
number cells in the header row. (The main part of the issue.)
What this patch does not solve: If there is no header row, but only data
rows. If the user's choice in the dialog is no header for the autofilter,
then the first row is sorted too. The autofilter buttons will move
toghether with the first row. The autofilter buttons should stay at the
first row, even if the data of the first row changes.
In conclusion, this patch improves the autofilter sorting code, though it
does not address everything of the issue.
Change-Id: I9cc56577a90586bf8575c9630e5c03871198c04c
Reviewed-on: https://gerrit.libreoffice.org/15277
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | sc/source/ui/view/gridwin.cxx | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 8703ae4150fd..69fd520a7a21 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -812,7 +812,6 @@ void ScGridWindow::UpdateAutoFilterFromMenu(AutoFilterMode eMode) case SortAscending: case SortDescending: { - SCTAB nTab = pViewData->GetTabNo(); SCCOL nCol = rPos.Col(); ScSortParam aSortParam; pDBData->GetSortParam(aSortParam); @@ -820,8 +819,7 @@ void ScGridWindow::UpdateAutoFilterFromMenu(AutoFilterMode eMode) // out of bound return; - bool bHasHeader = pDoc->HasColHeader( - aSortParam.nCol1, aSortParam.nRow1, aSortParam.nCol2, aSortParam.nRow2, nTab); + bool bHasHeader = pDBData->HasHeader(); aSortParam.bHasHeader = bHasHeader; aSortParam.bByRow = true; |