summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
authorAlbert Thuswaldner <albert.thuswaldner@gmail.com>2013-04-06 21:43:48 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2013-04-12 02:08:14 +0000
commit0ed9aab7615ae471abe1aecc4b7665c45ed85aaf (patch)
tree33666900fb6cef74a9a0e6a94b3f94b71cbd2e7c /sc/source
parente58a8b6d7dc1b01af9f54bec8fdce718b1d8bccd (diff)
fdo#51828 - UI: Sort: can use more than 3 criteria once only
Change-Id: I7480e8d606e1eafde45635e36dfafa4232f529cb Reviewed-on: https://gerrit.libreoffice.org/3217 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-on: https://gerrit.libreoffice.org/3350 Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com> Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/ui/dbgui/tpsort.cxx13
1 files changed, 11 insertions, 2 deletions
diff --git a/sc/source/ui/dbgui/tpsort.cxx b/sc/source/ui/dbgui/tpsort.cxx
index 78d04ac16a0d..4ee9d1109307 100644
--- a/sc/source/ui/dbgui/tpsort.cxx
+++ b/sc/source/ui/dbgui/tpsort.cxx
@@ -168,9 +168,19 @@ void ScTabPageSortFields::Reset( const SfxItemSet& /* rArgSet */ )
// ListBox selection:
if ( aSortData.maKeyState[0].bDoSort )
{
+ // Make sure that the all sort keys are reset
+ for ( sal_uInt16 i=nSortKeyCount; i<aSortData.maKeyState.size(); i++ )
+ {
+ maSortKeyCtrl.AddSortKey(i+1);
+ maSortKeyItems[i].m_pLbSort->SetSelectHdl( LINK( this,
+ ScTabPageSortFields, SelectHdl ) );
+ }
+ nSortKeyCount = aSortData.maKeyState.size();
+ FillFieldLists(0);
+
for ( sal_uInt16 i=0; i<nSortKeyCount; i++ )
{
- if ( i < aSortData.maKeyState.size() && aSortData.maKeyState[i].bDoSort )
+ if (aSortData.maKeyState[i].bDoSort )
{
maSortKeyItems[i].m_pLbSort->SelectEntryPos( GetFieldSelPos(
aSortData.maKeyState[i].nField ) );
@@ -193,7 +203,6 @@ void ScTabPageSortFields::Reset( const SfxItemSet& /* rArgSet */ )
maSortKeyItems[i].DisableField();
else
maSortKeyItems[i].EnableField();
-
}
else
{