fdo#51828 - UI: Sort: can use more than 3 criteria once only - additional fix
Change-Id: I569766945d96eae74479e310d674c9420e9a2b4b Reviewed-on: https://gerrit.libreoffice.org/3772 Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com> Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
This commit is contained in:
parent
256e42646b
commit
b9cd66b970
@ -184,7 +184,6 @@ void ScTabPageSortFields::Reset( const SfxItemSet& /* rArgSet */ )
|
|||||||
{
|
{
|
||||||
maSortKeyItems[i].m_pLbSort->SelectEntryPos( GetFieldSelPos(
|
maSortKeyItems[i].m_pLbSort->SelectEntryPos( GetFieldSelPos(
|
||||||
aSortData.maKeyState[i].nField ) );
|
aSortData.maKeyState[i].nField ) );
|
||||||
|
|
||||||
(aSortData.maKeyState[i].bAscending)
|
(aSortData.maKeyState[i].bAscending)
|
||||||
? maSortKeyItems[i].m_pBtnUp->Check()
|
? maSortKeyItems[i].m_pBtnUp->Check()
|
||||||
: maSortKeyItems[i].m_pBtnDown->Check();
|
: maSortKeyItems[i].m_pBtnDown->Check();
|
||||||
@ -234,6 +233,10 @@ void ScTabPageSortFields::Reset( const SfxItemSet& /* rArgSet */ )
|
|||||||
pDlg->SetByRows ( bSortByRows );
|
pDlg->SetByRows ( bSortByRows );
|
||||||
pDlg->SetHeaders( bHasHeader );
|
pDlg->SetHeaders( bHasHeader );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Make sure that there is always a last undefined sort key
|
||||||
|
if ( maSortKeyItems[nSortKeyCount - 1].m_pLbSort->GetSelectEntryPos() > 0 )
|
||||||
|
SetLastSortKey( nSortKeyCount );
|
||||||
}
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
@ -443,19 +446,7 @@ sal_uInt16 ScTabPageSortFields::GetFieldSelPos( SCCOLROW nField )
|
|||||||
return nFieldPos;
|
return nFieldPos;
|
||||||
}
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------------------
|
void ScTabPageSortFields::SetLastSortKey( sal_uInt16 nItem )
|
||||||
// Handler:
|
|
||||||
//---------
|
|
||||||
|
|
||||||
IMPL_LINK( ScTabPageSortFields, SelectHdl, ListBox *, pLb )
|
|
||||||
{
|
|
||||||
OUString aSelEntry = pLb->GetSelectEntry();
|
|
||||||
ScSortKeyItems::iterator pIter;
|
|
||||||
sal_uInt16 nSortKeyIndex = nSortKeyCount;
|
|
||||||
|
|
||||||
// If last listbox is enabled add one item
|
|
||||||
if ( maSortKeyItems.back().m_pLbSort == pLb )
|
|
||||||
if ( aSelEntry != aStrUndefined )
|
|
||||||
{
|
{
|
||||||
// Extend local SortParam copy
|
// Extend local SortParam copy
|
||||||
const ScSortKeyState atempKeyState = { false, 0, true };
|
const ScSortKeyState atempKeyState = { false, 0, true };
|
||||||
@ -464,13 +455,30 @@ IMPL_LINK( ScTabPageSortFields, SelectHdl, ListBox *, pLb )
|
|||||||
// Add Sort Key Item
|
// Add Sort Key Item
|
||||||
++nSortKeyCount;
|
++nSortKeyCount;
|
||||||
maSortKeyCtrl.AddSortKey( nSortKeyCount );
|
maSortKeyCtrl.AddSortKey( nSortKeyCount );
|
||||||
maSortKeyItems[nSortKeyIndex].m_pLbSort->SetSelectHdl( LINK( this, ScTabPageSortFields, SelectHdl ) );
|
maSortKeyItems[nItem].m_pLbSort->SetSelectHdl(
|
||||||
|
LINK( this, ScTabPageSortFields, SelectHdl ) );
|
||||||
|
|
||||||
FillFieldLists( nSortKeyIndex );
|
FillFieldLists( nItem );
|
||||||
|
|
||||||
// Set Status
|
// Set Status
|
||||||
maSortKeyItems[nSortKeyIndex].m_pBtnUp->Check();
|
maSortKeyItems[nItem].m_pBtnUp->Check();
|
||||||
maSortKeyItems[nSortKeyIndex].m_pLbSort->SelectEntryPos( 0 );
|
maSortKeyItems[nItem].m_pLbSort->SelectEntryPos( 0 );
|
||||||
|
}
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------
|
||||||
|
// Handler:
|
||||||
|
//---------
|
||||||
|
|
||||||
|
IMPL_LINK( ScTabPageSortFields, SelectHdl, ListBox *, pLb )
|
||||||
|
{
|
||||||
|
OUString aSelEntry = pLb->GetSelectEntry();
|
||||||
|
ScSortKeyItems::iterator pIter;
|
||||||
|
|
||||||
|
// If last listbox is enabled add one item
|
||||||
|
if ( maSortKeyItems.back().m_pLbSort == pLb )
|
||||||
|
if ( aSelEntry != aStrUndefined )
|
||||||
|
{
|
||||||
|
SetLastSortKey( nSortKeyCount );
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -95,6 +95,7 @@ private:
|
|||||||
void Init ();
|
void Init ();
|
||||||
void FillFieldLists ( sal_uInt16 nStartField );
|
void FillFieldLists ( sal_uInt16 nStartField );
|
||||||
sal_uInt16 GetFieldSelPos ( SCCOLROW nField );
|
sal_uInt16 GetFieldSelPos ( SCCOLROW nField );
|
||||||
|
void SetLastSortKey( sal_uInt16 nItem );
|
||||||
|
|
||||||
// Handler ------------------------
|
// Handler ------------------------
|
||||||
DECL_LINK( SelectHdl, ListBox * );
|
DECL_LINK( SelectHdl, ListBox * );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user