[PATCH] Calc sort: Use method GetSortKeyCount from SortParam

2013-05-07 Thread Albert Thuswaldner (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/3816

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/16/3816/1

Calc sort: Use method GetSortKeyCount from SortParam

Change-Id: I4500ba71abeba5fe8293cea22b10fd910e46059f
---
M sc/source/ui/dbgui/tpsort.cxx
1 file changed, 3 insertions(+), 3 deletions(-)



diff --git a/sc/source/ui/dbgui/tpsort.cxx b/sc/source/ui/dbgui/tpsort.cxx
index 4499600..1479313 100644
--- a/sc/source/ui/dbgui/tpsort.cxx
+++ b/sc/source/ui/dbgui/tpsort.cxx
@@ -169,13 +169,13 @@
 if ( aSortData.maKeyState[0].bDoSort )
 {
 // Make sure that the all sort keys are reset
-for ( sal_uInt16 i=nSortKeyCount; iaSortData.maKeyState.size(); i++ )
+for ( sal_uInt16 i=nSortKeyCount; iaSortData.GetSortKeyCount(); i++ )
 {
 maSortKeyCtrl.AddSortKey(i+1);
 maSortKeyItems[i].m_pLbSort-SetSelectHdl( LINK( this,
  ScTabPageSortFields, SelectHdl ) );
 }
-nSortKeyCount = aSortData.maKeyState.size();
+nSortKeyCount = aSortData.GetSortKeyCount();
 FillFieldLists(0);
 
 for ( sal_uInt16 i=0; inSortKeyCount; i++ )
@@ -265,7 +265,7 @@
 if ( nSortPos[i] == LISTBOX_ENTRY_NOTFOUND ) nSortPos[i] = 0;
 }
 
-if( nSortKeyCount = aNewSortData.maKeyState.size() )
+if( nSortKeyCount = aNewSortData.GetSortKeyCount() )
 aNewSortData.maKeyState.resize(nSortKeyCount);
 
 if ( nSortPos[0]  0 )

-- 
To view, visit https://gerrit.libreoffice.org/3816
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4500ba71abeba5fe8293cea22b10fd910e46059f
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Albert Thuswaldner albert.thuswald...@gmail.com

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[PATCH libreoffice-4-0] fdo#51828 - UI: Sort: can use more than 3 criteria once only...

2013-05-06 Thread Albert Thuswaldner (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/3801

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/01/3801/1

fdo#51828 - UI: Sort: can use more than 3 criteria once only - additional fix

Change-Id: I220b3755d3ea30bd9aa25b175f7f3eea7590ebdb
---
M sc/source/ui/dbgui/tpsort.cxx
M sc/source/ui/inc/tpsort.hxx
2 files changed, 25 insertions(+), 16 deletions(-)



diff --git a/sc/source/ui/dbgui/tpsort.cxx b/sc/source/ui/dbgui/tpsort.cxx
index 6731e71..fd62073 100644
--- a/sc/source/ui/dbgui/tpsort.cxx
+++ b/sc/source/ui/dbgui/tpsort.cxx
@@ -184,7 +184,6 @@
 {
 maSortKeyItems[i].m_pLbSort-SelectEntryPos( GetFieldSelPos(
 aSortData.maKeyState[i].nField ) );
-
 (aSortData.maKeyState[i].bAscending)
 ? maSortKeyItems[i].m_pBtnUp-Check()
 : maSortKeyItems[i].m_pBtnDown-Check();
@@ -234,6 +233,10 @@
 pDlg-SetByRows ( bSortByRows );
 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,6 +446,25 @@
 return nFieldPos;
 }
 
+void ScTabPageSortFields::SetLastSortKey( sal_uInt16 nItem )
+{
+// Extend local SortParam copy
+const ScSortKeyState atempKeyState = { false, 0, true };
+aSortData.maKeyState.push_back( atempKeyState );
+
+// Add Sort Key Item
+++nSortKeyCount;
+maSortKeyCtrl.AddSortKey( nSortKeyCount );
+maSortKeyItems[nItem].m_pLbSort-SetSelectHdl(
+ LINK( this, ScTabPageSortFields, SelectHdl ) );
+
+FillFieldLists( nItem );
+
+// Set Status
+maSortKeyItems[nItem].m_pBtnUp-Check();
+maSortKeyItems[nItem].m_pLbSort-SelectEntryPos( 0 );
+}
+
 // ---
 // Handler:
 //-
@@ -451,26 +473,12 @@
 {
 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
-const ScSortKeyState atempKeyState = { false, 0, true };
-aSortData.maKeyState.push_back( atempKeyState );
-
-// Add Sort Key Item
-++nSortKeyCount;
-maSortKeyCtrl.AddSortKey( nSortKeyCount );
-maSortKeyItems[nSortKeyIndex].m_pLbSort-SetSelectHdl( LINK( this, 
ScTabPageSortFields, SelectHdl ) );
-
-FillFieldLists( nSortKeyIndex );
-
-// Set Status
-maSortKeyItems[nSortKeyIndex].m_pBtnUp-Check();
-maSortKeyItems[nSortKeyIndex].m_pLbSort-SelectEntryPos( 0 );
+SetLastSortKey( nSortKeyCount );
 return 0;
 }
 
diff --git a/sc/source/ui/inc/tpsort.hxx b/sc/source/ui/inc/tpsort.hxx
index 8ce4a42..b230581 100644
--- a/sc/source/ui/inc/tpsort.hxx
+++ b/sc/source/ui/inc/tpsort.hxx
@@ -95,6 +95,7 @@
 voidInit();
 voidFillFieldLists  ( sal_uInt16 nStartField );
 sal_uInt16  GetFieldSelPos  ( SCCOLROW nField );
+voidSetLastSortKey( sal_uInt16 nItem );
 
 // Handler 
 DECL_LINK( SelectHdl, ListBox * );

-- 
To view, visit https://gerrit.libreoffice.org/3801
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I220b3755d3ea30bd9aa25b175f7f3eea7590ebdb
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: libreoffice-4-0
Gerrit-Owner: Albert Thuswaldner albert.thuswald...@gmail.com

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[PATCH] fdo#51828 - UI: Sort: can use more than 3 criteria once only...

2013-05-03 Thread Albert Thuswaldner (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/3772

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/72/3772/1

fdo#51828 - UI: Sort: can use more than 3 criteria once only - additional fix

Change-Id: I569766945d96eae74479e310d674c9420e9a2b4b
---
M sc/source/ui/dbgui/tpsort.cxx
M sc/source/ui/inc/tpsort.hxx
2 files changed, 26 insertions(+), 16 deletions(-)



diff --git a/sc/source/ui/dbgui/tpsort.cxx b/sc/source/ui/dbgui/tpsort.cxx
index 6731e71..69551f0 100644
--- a/sc/source/ui/dbgui/tpsort.cxx
+++ b/sc/source/ui/dbgui/tpsort.cxx
@@ -178,13 +178,13 @@
 nSortKeyCount = aSortData.maKeyState.size();
 FillFieldLists(0);
 
+
 for ( sal_uInt16 i=0; inSortKeyCount; i++ )
 {
 if (aSortData.maKeyState[i].bDoSort )
 {
 maSortKeyItems[i].m_pLbSort-SelectEntryPos( GetFieldSelPos(
 aSortData.maKeyState[i].nField ) );
-
 (aSortData.maKeyState[i].bAscending)
 ? maSortKeyItems[i].m_pBtnUp-Check()
 : maSortKeyItems[i].m_pBtnDown-Check();
@@ -234,6 +234,10 @@
 pDlg-SetByRows ( bSortByRows );
 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,6 +447,25 @@
 return nFieldPos;
 }
 
+void ScTabPageSortFields::SetLastSortKey( sal_uInt16 nItem )
+{
+// Extend local SortParam copy
+const ScSortKeyState atempKeyState = { false, 0, true };
+aSortData.maKeyState.push_back( atempKeyState );
+
+// Add Sort Key Item
+++nSortKeyCount;
+maSortKeyCtrl.AddSortKey( nSortKeyCount );
+maSortKeyItems[nItem].m_pLbSort-SetSelectHdl(
+ LINK( this, ScTabPageSortFields, SelectHdl ) );
+
+FillFieldLists( nItem );
+
+// Set Status
+maSortKeyItems[nItem].m_pBtnUp-Check();
+maSortKeyItems[nItem].m_pLbSort-SelectEntryPos( 0 );
+}
+
 // ---
 // Handler:
 //-
@@ -451,26 +474,12 @@
 {
 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
-const ScSortKeyState atempKeyState = { false, 0, true };
-aSortData.maKeyState.push_back( atempKeyState );
-
-// Add Sort Key Item
-++nSortKeyCount;
-maSortKeyCtrl.AddSortKey( nSortKeyCount );
-maSortKeyItems[nSortKeyIndex].m_pLbSort-SetSelectHdl( LINK( this, 
ScTabPageSortFields, SelectHdl ) );
-
-FillFieldLists( nSortKeyIndex );
-
-// Set Status
-maSortKeyItems[nSortKeyIndex].m_pBtnUp-Check();
-maSortKeyItems[nSortKeyIndex].m_pLbSort-SelectEntryPos( 0 );
+SetLastSortKey( nSortKeyCount );
 return 0;
 }
 
diff --git a/sc/source/ui/inc/tpsort.hxx b/sc/source/ui/inc/tpsort.hxx
index 8ce4a42..b230581 100644
--- a/sc/source/ui/inc/tpsort.hxx
+++ b/sc/source/ui/inc/tpsort.hxx
@@ -95,6 +95,7 @@
 voidInit();
 voidFillFieldLists  ( sal_uInt16 nStartField );
 sal_uInt16  GetFieldSelPos  ( SCCOLROW nField );
+voidSetLastSortKey( sal_uInt16 nItem );
 
 // Handler 
 DECL_LINK( SelectHdl, ListBox * );

-- 
To view, visit https://gerrit.libreoffice.org/3772
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I569766945d96eae74479e310d674c9420e9a2b4b
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Albert Thuswaldner albert.thuswald...@gmail.com

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[PATCH] Calc: converted sort warning dialog to .ui

2013-04-14 Thread Albert Thuswaldner (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/3380

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/80/3380/1

Calc: converted sort warning dialog to .ui

Change-Id: I2bc44990efb62183507f46b22bfd8e09edf02eb6
---
M sc/UIConfig_scalc.mk
M sc/inc/sc.hrc
M sc/inc/scabstdlg.hxx
M sc/source/ui/attrdlg/scdlgfact.cxx
M sc/source/ui/attrdlg/scdlgfact.hxx
M sc/source/ui/dbgui/sortdlg.cxx
M sc/source/ui/inc/sortdlg.hrc
M sc/source/ui/inc/sortdlg.hxx
M sc/source/ui/src/sortdlg.src
M sc/source/ui/view/cellsh2.cxx
A sc/uiconfig/scalc/ui/sortwarning.ui
11 files changed, 162 insertions(+), 94 deletions(-)



diff --git a/sc/UIConfig_scalc.mk b/sc/UIConfig_scalc.mk
index 8f800bf..12196b1 100644
--- a/sc/UIConfig_scalc.mk
+++ b/sc/UIConfig_scalc.mk
@@ -73,6 +73,7 @@
sc/uiconfig/scalc/ui/sortcriteriapage \
sc/uiconfig/scalc/ui/sortkey \
sc/uiconfig/scalc/ui/sortoptionspage \
+   sc/uiconfig/scalc/ui/sortwarning \
sc/uiconfig/scalc/ui/textimportoptions \
sc/uiconfig/scalc/ui/textimportcsv \
 ))
diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc
index 4749970..3da7156 100644
--- a/sc/inc/sc.hrc
+++ b/sc/inc/sc.hrc
@@ -1080,7 +1080,6 @@
 
 #define RID_SCDLG_CONFLICTS (SC_DIALOGS_START + 145)
 #define RID_SCDLG_SHAREDOCUMENT (SC_DIALOGS_START + 146)
-#define RID_SCDLG_SORT_WARNING  (SC_DIALOGS_START + 147)
 #define RID_SCDLG_TABPROTECTION (SC_DIALOGS_START + 148)
 #define RID_SCDLG_RETYPEPASS(SC_DIALOGS_START + 150)
 #define RID_SCDLG_RETYPEPASS_INPUT  (SC_DIALOGS_START + 151)
diff --git a/sc/inc/scabstdlg.hxx b/sc/inc/scabstdlg.hxx
index 89997d4..124843e 100644
--- a/sc/inc/scabstdlg.hxx
+++ b/sc/inc/scabstdlg.hxx
@@ -46,6 +46,7 @@
 class ScDPObject;
 struct ScPivotFuncData;
 struct ScDPNumGroupInfo;
+class ScSortWarningDlg;
 class ScTabViewShell;
 class ScConditionalFormat;
 class ScConditionalFormatList;
@@ -293,6 +294,10 @@
 virtual sal_uInt16  GetSelectEntryPos(sal_uInt16 nPos) const = 0;
 };
 
+class AbstractScSortWarningDlg : public VclAbstractDialog  //add for 
ScSortWarningDlg
+{
+};
+
 class AbstractScStringInputDlg :  public VclAbstractDialog  //add for 
ScStringInputDlg
 {
 public:
@@ -345,7 +350,8 @@
 const String   rStrLabel,
 int nId,
 sal_Bool
bColDefault = sal_True ) = 0;
-virtual VclAbstractDialog * CreateScSortWarningDlg ( Window* pParent, 
const String rExtendText, const String rCurrentText, int nId ) = 0;  //add 
for ScSortWarningDlg
+
+virtual AbstractScSortWarningDlg * CreateScSortWarningDlg(Window* pParent, 
const String rExtendText, const String rCurrentText ) = 0; //add for 
ScSortWarningDlg
 
 virtual AbstractScCondFormatManagerDlg* CreateScCondFormatMgrDlg(Window* 
pParent, ScDocument* pDoc, const ScConditionalFormatList* pFormatList,
 const 
ScAddress rPos, int nId ) = 0;
diff --git a/sc/source/ui/attrdlg/scdlgfact.cxx 
b/sc/source/ui/attrdlg/scdlgfact.cxx
index 98b656f..ab73973 100644
--- a/sc/source/ui/attrdlg/scdlgfact.cxx
+++ b/sc/source/ui/attrdlg/scdlgfact.cxx
@@ -109,6 +109,7 @@
 IMPL_ABSTDLG_BASE(AbstractScDPShowDetailDlg_Impl);
 IMPL_ABSTDLG_BASE(AbstractScNewScenarioDlg_Impl);
 IMPL_ABSTDLG_BASE(AbstractScShowTabDlg_Impl);
+IMPL_ABSTDLG_BASE(AbstractScSortWarningDlg_Impl);
 IMPL_ABSTDLG_BASE(AbstractScStringInputDlg_Impl);
 IMPL_ABSTDLG_BASE(AbstractScTabBgColorDlg_Impl);
 IMPL_ABSTDLG_BASE(AbstractScImportOptionsDlg_Impl);
@@ -729,23 +730,10 @@
 return 0;
 }
 
-
-
-VclAbstractDialog * ScAbstractDialogFactory_Impl::CreateScSortWarningDlg( 
Window* pParent, const String rExtendText,
-  
const String rCurrentText, int nId )
+AbstractScSortWarningDlg* 
ScAbstractDialogFactory_Impl::CreateScSortWarningDlg( Window* pParent, const 
String rExtendText, const String rCurrentText )
 {
-Dialog * pDlg=NULL;
-switch ( nId )
-{
-case RID_SCDLG_SORT_WARNING:
-pDlg = new ScSortWarningDlg( pParent, rExtendText, rCurrentText );
-break;
-default:
-break;
-}
-if( pDlg )
-return new ScVclAbstractDialog_Impl( pDlg );
-return 0;
+ScSortWarningDlg* pDlg = new ScSortWarningDlg(pParent, rExtendText, 
rCurrentText );
+return new AbstractScSortWarningDlg_Impl( pDlg );
 }
 
 
diff --git a/sc/source/ui/attrdlg/scdlgfact.hxx 
b/sc/source/ui/attrdlg/scdlgfact.hxx
index 3383616..cf239e8 100644
--- a/sc/source/ui/attrdlg/scdlgfact.hxx
+++ b/sc/source/ui/attrdlg/scdlgfact.hxx
@@ -47,6 +47,7 @@
 class ScDPNumGroupDlg;
 class ScDPDateGroupDlg;
 class ScDPShowDetailDlg;
+class ScSortWarningDlg;
 class ScNewScenarioDlg;
 class ScShowTabDlg;
 class ScStringInputDlg;
@@ -343,6 

[PATCH] Calc Sort: Introducing new method AddKeyItem to avoid code d...

2013-04-13 Thread Albert Thuswaldner (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/3370

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/70/3370/1

Calc Sort: Introducing new method AddKeyItem to avoid code duplication

Change-Id: Ic34b5958472a7d2c19ff686914309b6699e237c4
---
M sc/source/ui/dbgui/sortkeydlg.cxx
M sc/source/ui/dbgui/tpsort.cxx
M sc/source/ui/inc/sortkeydlg.hxx
M sc/source/ui/inc/tpsort.hxx
4 files changed, 20 insertions(+), 17 deletions(-)



diff --git a/sc/source/ui/dbgui/sortkeydlg.cxx 
b/sc/source/ui/dbgui/sortkeydlg.cxx
index 006dad5..3e09076 100644
--- a/sc/source/ui/dbgui/sortkeydlg.cxx
+++ b/sc/source/ui/dbgui/sortkeydlg.cxx
@@ -156,11 +156,12 @@
 
 // ---
 
-void ScSortKeyCtrl::AddSortKey( sal_uInt16 nItem )
+void ScSortKeyCtrl::AddSortKey( sal_uInt16 nItemIndex )
 {
-m_rVertScroll.SetRangeMax( nItem );
-m_rVertScroll.DoScroll( nItem );
-m_aSortWin.AddSortKey( nItem );
+++nItemIndex;
+m_rVertScroll.SetRangeMax( nItemIndex );
+m_rVertScroll.DoScroll( nItemIndex );
+m_aSortWin.AddSortKey( nItemIndex );
 checkAutoVScroll();
 }
 
diff --git a/sc/source/ui/dbgui/tpsort.cxx b/sc/source/ui/dbgui/tpsort.cxx
index 6731e71..f153cf7 100644
--- a/sc/source/ui/dbgui/tpsort.cxx
+++ b/sc/source/ui/dbgui/tpsort.cxx
@@ -141,10 +141,7 @@
 
 // Create three sort key dialogs by default
 for ( sal_uInt16 i=0; inSortKeyCount; i++ )
-{
-maSortKeyCtrl.AddSortKey(i+1);
-maSortKeyItems[i].m_pLbSort-SetSelectHdl( LINK( this, 
ScTabPageSortFields, SelectHdl ) );
-}
+AddSortKeyItem(i);
 }
 
 // ---
@@ -170,11 +167,8 @@
 {
 // Make sure that the all sort keys are reset
 for ( sal_uInt16 i=nSortKeyCount; iaSortData.maKeyState.size(); i++ )
-{
-maSortKeyCtrl.AddSortKey(i+1);
-maSortKeyItems[i].m_pLbSort-SetSelectHdl( LINK( this,
- ScTabPageSortFields, SelectHdl ) );
-}
+AddSortKeyItem(i);
+
 nSortKeyCount = aSortData.maKeyState.size();
 FillFieldLists(0);
 
@@ -443,6 +437,15 @@
 return nFieldPos;
 }
 
+//
+
+void ScTabPageSortFields::AddSortKeyItem( sal_uInt16 nItemIndex )
+{
+maSortKeyCtrl.AddSortKey( nItemIndex );
+maSortKeyItems[nItemIndex].m_pLbSort-SetSelectHdl(
+LINK( this, ScTabPageSortFields, SelectHdl ) );
+}
+
 // ---
 // Handler:
 //-
@@ -463,9 +466,7 @@
 
 // Add Sort Key Item
 ++nSortKeyCount;
-maSortKeyCtrl.AddSortKey( nSortKeyCount );
-maSortKeyItems[nSortKeyIndex].m_pLbSort-SetSelectHdl( LINK( this, 
ScTabPageSortFields, SelectHdl ) );
-
+AddSortKeyItem( nSortKeyIndex );
 FillFieldLists( nSortKeyIndex );
 
 // Set Status
diff --git a/sc/source/ui/inc/sortkeydlg.hxx b/sc/source/ui/inc/sortkeydlg.hxx
index 060e8ad..7718663 100644
--- a/sc/source/ui/inc/sortkeydlg.hxx
+++ b/sc/source/ui/inc/sortkeydlg.hxx
@@ -99,7 +99,7 @@
 public:
 ScSortKeyCtrl(SfxTabPage* pParent, ScSortKeyItems mrSortKeyItems);
 void setScrollRange();
-void AddSortKey( sal_uInt16 nItem );
+void AddSortKey( sal_uInt16 nItemIndex );
 };
 
 #endif // SC_SORTKEYDLG_HXX
diff --git a/sc/source/ui/inc/tpsort.hxx b/sc/source/ui/inc/tpsort.hxx
index 8ce4a42..e4d82c6 100644
--- a/sc/source/ui/inc/tpsort.hxx
+++ b/sc/source/ui/inc/tpsort.hxx
@@ -95,6 +95,7 @@
 voidInit();
 voidFillFieldLists  ( sal_uInt16 nStartField );
 sal_uInt16  GetFieldSelPos  ( SCCOLROW nField );
+voidAddSortKeyItem( sal_uInt16 nItemIndex );
 
 // Handler 
 DECL_LINK( SelectHdl, ListBox * );

-- 
To view, visit https://gerrit.libreoffice.org/3370
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic34b5958472a7d2c19ff686914309b6699e237c4
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Albert Thuswaldner albert.thuswald...@gmail.com

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[PATCH libreoffice-4-0] fdo#51828 - UI: Sort: can use more than 3 criteria once only

2013-04-11 Thread Albert Thuswaldner (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/3350

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/50/3350/1

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 caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com
---
M sc/source/ui/dbgui/tpsort.cxx
1 file changed, 11 insertions(+), 2 deletions(-)



diff --git a/sc/source/ui/dbgui/tpsort.cxx b/sc/source/ui/dbgui/tpsort.cxx
index 4c56058..6731e71 100644
--- a/sc/source/ui/dbgui/tpsort.cxx
+++ b/sc/source/ui/dbgui/tpsort.cxx
@@ -168,9 +168,19 @@
 // ListBox selection:
 if ( aSortData.maKeyState[0].bDoSort )
 {
+// Make sure that the all sort keys are reset
+for ( sal_uInt16 i=nSortKeyCount; iaSortData.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; inSortKeyCount; 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 @@
 maSortKeyItems[i].DisableField();
 else
 maSortKeyItems[i].EnableField();
-
 }
 else
 {

-- 
To view, visit https://gerrit.libreoffice.org/3350
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7480e8d606e1eafde45635e36dfafa4232f529cb
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: libreoffice-4-0
Gerrit-Owner: Albert Thuswaldner albert.thuswald...@gmail.com
Gerrit-Reviewer: Caolán McNamara caol...@redhat.com

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[PATCH] fdo#51828 - UI: Sort: can use more than 3 criteria once only

2013-04-06 Thread Albert Thuswaldner (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/3217

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/17/3217/1

fdo#51828 - UI: Sort: can use more than 3 criteria once only

Change-Id: I7480e8d606e1eafde45635e36dfafa4232f529cb
---
M sc/source/ui/dbgui/tpsort.cxx
1 file changed, 12 insertions(+), 2 deletions(-)



diff --git a/sc/source/ui/dbgui/tpsort.cxx b/sc/source/ui/dbgui/tpsort.cxx
index cb69736..75d0113 100644
--- a/sc/source/ui/dbgui/tpsort.cxx
+++ b/sc/source/ui/dbgui/tpsort.cxx
@@ -168,9 +168,20 @@
 // ListBox selection:
 if ( aSortData.maKeyState[0].bDoSort )
 {
+// Make sure that the all sort keys are reset
+for ( sal_uInt16 i=nSortKeyCount; iaSortData.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; inSortKeyCount; 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 +204,6 @@
 maSortKeyItems[i].DisableField();
 else
 maSortKeyItems[i].EnableField();
-
 }
 else
 {

-- 
To view, visit https://gerrit.libreoffice.org/3217
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7480e8d606e1eafde45635e36dfafa4232f529cb
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Albert Thuswaldner albert.thuswald...@gmail.com

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice