From f741d948b6910622d199e8d14ca1e3ecd7475156 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 11 Jun 2013 13:19:51 +0100 Subject: split group dialog into group and ungroup dialogs Change-Id: If9f8e8a47bd8ce0207b7dec8470375d5fa48f6cd --- sc/UIConfig_scalc.mk | 3 +- sc/inc/sc.hrc | 5 -- sc/inc/scabstdlg.hxx | 5 +- sc/source/ui/attrdlg/scdlgfact.cxx | 28 +----- sc/source/ui/attrdlg/scdlgfact.hxx | 5 +- sc/source/ui/inc/groupdlg.hxx | 9 +- sc/source/ui/miscdlgs/groupdlg.cxx | 17 ++-- sc/source/ui/src/miscdlgs.src | 66 -------------- sc/source/ui/view/cellsh1.cxx | 4 +- sc/uiconfig/scalc/ui/groupdialog.ui | 119 +++++++++++++------------ sc/uiconfig/scalc/ui/ungroupdialog.ui | 158 ++++++++++++++++++++++++++++++++++ 11 files changed, 241 insertions(+), 178 deletions(-) create mode 100644 sc/uiconfig/scalc/ui/ungroupdialog.ui (limited to 'sc') diff --git a/sc/UIConfig_scalc.mk b/sc/UIConfig_scalc.mk index 46692c839bc0..5b937a11e2f6 100644 --- a/sc/UIConfig_scalc.mk +++ b/sc/UIConfig_scalc.mk @@ -84,6 +84,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/scalc,\ sc/uiconfig/scalc/ui/optchangespage \ sc/uiconfig/scalc/ui/optcompatibilitypage \ sc/uiconfig/scalc/ui/optdefaultpage \ + sc/uiconfig/scalc/ui/optdlg \ sc/uiconfig/scalc/ui/printeroptions \ sc/uiconfig/scalc/ui/protectsheetdlg \ sc/uiconfig/scalc/ui/scgeneralpage \ @@ -103,7 +104,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/scalc,\ sc/uiconfig/scalc/ui/sortwarning \ sc/uiconfig/scalc/ui/textimportoptions \ sc/uiconfig/scalc/ui/textimportcsv \ - sc/uiconfig/scalc/ui/optdlg \ + sc/uiconfig/scalc/ui/ungroupdialog \ )) # vim: set noet sw=4 ts=4: diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc index e98448c891cb..0e9f0496b658 100644 --- a/sc/inc/sc.hrc +++ b/sc/inc/sc.hrc @@ -971,7 +971,6 @@ #define RID_SCDLG_SELENTRY (SC_DIALOGS_START + 18) #define RID_SCDLG_FILLSERIES (SC_DIALOGS_START + 19) #define RID_SCDLG_AUTOFORMAT (SC_DIALOGS_START + 20) -#define RID_SCDLG_GROUP (SC_DIALOGS_START + 21) #define RID_SCDLG_NAMES (SC_DIALOGS_START + 22) #define RID_SCDLG_DBNAMES (SC_DIALOGS_START + 23) #define RID_SCDLG_SOLVER (SC_DIALOGS_START + 26) @@ -1043,10 +1042,6 @@ #define RID_SCDLG_SHOW_TAB (SC_DIALOGS_START + 109) -// derivations from RID_SCDLG_GROUP -#define RID_SCDLG_GRP_MAKE (SC_DIALOGS_START + 110) -#define RID_SCDLG_GRP_KILL (SC_DIALOGS_START + 111) - #define RID_SCDLG_COLROWNAMERANGES (SC_DIALOGS_START + 112) #define RID_SCPAGE_CONTENT (SC_DIALOGS_START + 113) diff --git a/sc/inc/scabstdlg.hxx b/sc/inc/scabstdlg.hxx index a041451ab872..ce4579979527 100644 --- a/sc/inc/scabstdlg.hxx +++ b/sc/inc/scabstdlg.hxx @@ -385,9 +385,8 @@ public: int nId) = 0; virtual AbstractScGroupDlg * CreateAbstractScGroupDlg( Window* pParent, //add for ScGroupDlg - int nId, - sal_Bool bUnGroup = false, - sal_Bool bRows = sal_True ) = 0; + bool bUnGroup = false, + bool bRows = true ) = 0; virtual AbstractScInsertCellDlg * CreateScInsertCellDlg( Window* pParent, //add for ScInsertCellDlg int nId, diff --git a/sc/source/ui/attrdlg/scdlgfact.cxx b/sc/source/ui/attrdlg/scdlgfact.cxx index fe688143ee24..bc6db222cb01 100644 --- a/sc/source/ui/attrdlg/scdlgfact.cxx +++ b/sc/source/ui/attrdlg/scdlgfact.cxx @@ -852,34 +852,14 @@ AbstractScFillSeriesDlg* ScAbstractDialogFactory_Impl::CreateScFillSeriesDlg( Wi return 0; } - - - AbstractScGroupDlg* ScAbstractDialogFactory_Impl::CreateAbstractScGroupDlg( Window* pParent, - int nId, - sal_Bool bUnGroup , - sal_Bool bRows ) + bool bUnGroup, + bool bRows ) { - ScGroupDlg * pDlg=NULL; - switch ( nId ) - { - case RID_SCDLG_GRP_KILL : - case RID_SCDLG_GRP_MAKE : - pDlg = new ScGroupDlg( pParent, bUnGroup, bRows); - break; - default: - break; - } - - if ( pDlg ) - return new AbstractScGroupDlg_Impl( pDlg ); - return 0; + ScGroupDlg * pDlg = new ScGroupDlg( pParent, bUnGroup, bRows); + return new AbstractScGroupDlg_Impl( pDlg ); } - - - - AbstractScInsertCellDlg * ScAbstractDialogFactory_Impl::CreateScInsertCellDlg( Window* pParent, int nId, sal_Bool bDisallowCellMove ) diff --git a/sc/source/ui/attrdlg/scdlgfact.hxx b/sc/source/ui/attrdlg/scdlgfact.hxx index 2be305eced52..107c23864ed0 100644 --- a/sc/source/ui/attrdlg/scdlgfact.hxx +++ b/sc/source/ui/attrdlg/scdlgfact.hxx @@ -452,9 +452,8 @@ public: sal_uInt16 nPossDir, int nId); virtual AbstractScGroupDlg * CreateAbstractScGroupDlg( Window* pParent, //add for ScGroupDlg - int nId, - sal_Bool bUnGroup = false, - sal_Bool bRows = sal_True ); + bool bUnGroup = false, + bool bRows = true); virtual AbstractScInsertCellDlg * CreateScInsertCellDlg( Window* pParent, //add for ScInsertCellDlg int nId, diff --git a/sc/source/ui/inc/groupdlg.hxx b/sc/source/ui/inc/groupdlg.hxx index 538d60112537..66806dee5552 100644 --- a/sc/source/ui/inc/groupdlg.hxx +++ b/sc/source/ui/inc/groupdlg.hxx @@ -30,15 +30,12 @@ class ScGroupDlg : public ModalDialog { public: - ScGroupDlg( Window* pParent, - sal_Bool bUnGroup = false, - sal_Bool bRows = sal_True ); - ~ScGroupDlg(); + ScGroupDlg(Window* pParent, bool bUnGroup = false, bool bRows = true); + ~ScGroupDlg(); - sal_Bool GetColsChecked() const; + bool GetColsChecked() const; private: - FixedText* m_pFtLabel; RadioButton* m_pBtnRows; RadioButton* m_pBtnCols; }; diff --git a/sc/source/ui/miscdlgs/groupdlg.cxx b/sc/source/ui/miscdlgs/groupdlg.cxx index bc3742354a18..acaecbf58a6d 100644 --- a/sc/source/ui/miscdlgs/groupdlg.cxx +++ b/sc/source/ui/miscdlgs/groupdlg.cxx @@ -30,16 +30,17 @@ //================================================================== -ScGroupDlg::ScGroupDlg( Window* pParent, - sal_Bool bUngroup, - sal_Bool bRows ) : - ModalDialog ( pParent, "GroupDialog", "modules/scalc/ui/groupdialog.ui") +ScGroupDlg::ScGroupDlg(Window* pParent, bool bUngroup, bool bRows) + : ModalDialog(pParent, + bUngroup ? + OString("UngroupDialog") : + OString("GroupDialog"), + bUngroup ? + OUString("modules/scalc/ui/ungroupdialog.ui") : + OUString("modules/scalc/ui/groupdialog.ui")) { get(m_pBtnRows, "rows"); get(m_pBtnCols, "cols"); - get(m_pFtLabel, bUngroup ? "deactivateLabel" : "includeLabel"); - - m_pFtLabel->Show(); if ( bRows ) m_pBtnRows->Check(); @@ -51,7 +52,7 @@ ScGroupDlg::ScGroupDlg( Window* pParent, //------------------------------------------------------------------------ -sal_Bool ScGroupDlg::GetColsChecked() const +bool ScGroupDlg::GetColsChecked() const { return m_pBtnCols->IsChecked(); } diff --git a/sc/source/ui/src/miscdlgs.src b/sc/source/ui/src/miscdlgs.src index 74f7ea19814a..391ebb75cd01 100644 --- a/sc/source/ui/src/miscdlgs.src +++ b/sc/source/ui/src/miscdlgs.src @@ -929,72 +929,6 @@ ModalDialog RID_SCDLG_FILLSERIES Text [ en-US ] = "~Rows" ; \ -ModalDialog RID_SCDLG_GROUP -{ - HelpID = "sc:ModalDialog:RID_SCDLG_GROUP"; - OutputSize = TRUE ; - SVLook = TRUE ; - Size = MAP_APPFONT ( 148 , 63 ) ; - Moveable = TRUE ; - Closeable = FALSE ; - OKButton BTN_OK - { - Pos = MAP_APPFONT ( 92 , 6 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - DefButton = TRUE ; - }; - CancelButton BTN_CANCEL - { - Pos = MAP_APPFONT ( 92 , 23 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - HelpButton BTN_HELP - { - Pos = MAP_APPFONT ( 92 , 43 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - RadioButton BTN_GROUP_ROWS - { - // HelpID, weil die generierten aus den Ableitungen nicht in die hid.lst kommen - HelpId = HID_SC_GROUP_ROWS ; - Pos = MAP_APPFONT ( 12 , 14 ) ; - Size = MAP_APPFONT ( 71 , 10 ) ; - TXT_ROWS - TabStop = TRUE ; - }; - RadioButton BTN_GROUP_COLS - { - // HelpID, weil die generierten aus den Ableitungen nicht in die hid.lst kommen - HelpId = HID_SC_GROUP_COLS ; - Pos = MAP_APPFONT ( 12 , 28 ) ; - Size = MAP_APPFONT ( 71 , 10 ) ; - TXT_COLS - TabStop = TRUE ; - }; - FixedLine FL_FRAME - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 80 , 8 ) ; - Text = "Aktivieren für" ; - }; - String STR_GROUP - { - Text [ en-US ] = "Include" ; - }; - String STR_UNGROUP - { - Text [ en-US ] = "Deactivate for" ; - }; - Text [ en-US ] = "Group" ; -}; - - // Ableitungen -ModalDialog RID_SCDLG_GRP_MAKE < RID_SCDLG_GROUP { HelpId = CMD_SID_OUTLINE_MAKE ; }; -ModalDialog RID_SCDLG_GRP_KILL < RID_SCDLG_GROUP { HelpId = CMD_SID_OUTLINE_REMOVE ; }; - // RID_SCDLG_COLORROW wird nur in der Optionen-Sortierlisten-Seite benutzt ModalDialog RID_SCDLG_COLORROW diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx index 26e13a1e4caf..7873b27aab18 100644 --- a/sc/source/ui/view/cellsh1.cxx +++ b/sc/source/ui/view/cellsh1.cxx @@ -1025,7 +1025,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "ScAbstractFactory create fail!"); - AbstractScGroupDlg* pDlg = pFact->CreateAbstractScGroupDlg( pTabViewShell->GetDialogParent(), RID_SCDLG_GRP_MAKE, false); + AbstractScGroupDlg* pDlg = pFact->CreateAbstractScGroupDlg(pTabViewShell->GetDialogParent(), false); OSL_ENSURE(pDlg, "Dialog create fail!"); if ( pDlg->Execute() == RET_OK ) bColumns = pDlg->GetColsChecked(); @@ -1085,7 +1085,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "ScAbstractFactory create fail!"); - AbstractScGroupDlg* pDlg = pFact->CreateAbstractScGroupDlg( pTabViewShell->GetDialogParent(), RID_SCDLG_GRP_KILL, true); + AbstractScGroupDlg* pDlg = pFact->CreateAbstractScGroupDlg(pTabViewShell->GetDialogParent(), true); OSL_ENSURE(pDlg, "Dialog create fail!"); if ( pDlg->Execute() == RET_OK ) bColumns = pDlg->GetColsChecked(); diff --git a/sc/uiconfig/scalc/ui/groupdialog.ui b/sc/uiconfig/scalc/ui/groupdialog.ui index eb3dbd29705b..0f913bddab21 100644 --- a/sc/uiconfig/scalc/ui/groupdialog.ui +++ b/sc/uiconfig/scalc/ui/groupdialog.ui @@ -9,12 +9,12 @@ False + vertical 12 False - vertical - start + end gtk-ok @@ -69,77 +69,76 @@ - + True False + True True - vertical - 6 + 0 + none - + + True False - True - 0 - Include - - - + 6 + 12 + + + True + False + True + vertical + 6 + + + _Rows + True + True + False + True + 0 + True + True + cols + + + False + True + 1 + + + + + _Columns + True + True + False + True + 0 + True + rows + + + False + True + 2 + + + + - - False - True - 0 - - - + + + True False + True 0 - Deactivate for + Include - - False - True - 1 - - - - - _Rows - True - True - False - True - 0 - True - True - cols - - - False - True - 3 - - - - - _Columns - True - True - False - True - 0 - True - rows - - - False - True - 4 - diff --git a/sc/uiconfig/scalc/ui/ungroupdialog.ui b/sc/uiconfig/scalc/ui/ungroupdialog.ui new file mode 100644 index 000000000000..112bf8f8b567 --- /dev/null +++ b/sc/uiconfig/scalc/ui/ungroupdialog.ui @@ -0,0 +1,158 @@ + + + + + False + 6 + Ungroup + dialog + + + False + vertical + 12 + + + False + end + + + gtk-ok + True + True + True + True + True + True + + + False + True + 0 + + + + + gtk-cancel + True + True + True + True + + + False + True + 1 + + + + + gtk-help + True + True + True + True + top + + + False + True + 2 + + + + + False + True + end + 0 + + + + + True + False + True + True + 0 + none + + + True + False + 6 + 12 + + + True + False + True + vertical + 6 + + + _Rows + True + True + False + True + 0 + True + True + cols + + + False + True + 1 + + + + + _Columns + True + True + False + True + 0 + True + rows + + + False + True + 2 + + + + + + + + + True + False + True + 0 + Deactivate for + + + + + + + + False + True + 1 + + + + + + ok + cancel + help + + + -- cgit