summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-04-11 13:32:24 +0100
committerCaolán McNamara <caolanm@redhat.com>2013-04-11 13:45:24 +0100
commit569ef418f5b0ff2d9e2246f2a16d7d7f090ce4d0 (patch)
tree41c1ca2b7b2eb75e13d7001528e17623cbd14ef0
parenteb4786e88a6e79d2c5f7723d93cd547f5994dea2 (diff)
adapt code for delete cells dialog
Change-Id: Ibf587e1ea94765f0322a5b847bcf82d1eabc1b64
-rw-r--r--sc/UIConfig_scalc.mk1
-rw-r--r--sc/inc/sc.hrc2
-rw-r--r--sc/inc/scabstdlg.hxx2
-rw-r--r--sc/source/ui/attrdlg/scdlgfact.cxx22
-rw-r--r--sc/source/ui/attrdlg/scdlgfact.hxx3
-rw-r--r--sc/source/ui/inc/delcldlg.hxx16
-rw-r--r--sc/source/ui/inc/miscdlgs.hrc9
-rw-r--r--sc/source/ui/miscdlgs/delcldlg.cxx51
-rw-r--r--sc/source/ui/src/miscdlgs.src68
-rw-r--r--sc/source/ui/view/cellsh1.cxx4
-rw-r--r--sc/uiconfig/scalc/ui/deletecells.ui51
11 files changed, 61 insertions, 168 deletions
diff --git a/sc/UIConfig_scalc.mk b/sc/UIConfig_scalc.mk
index 3ff897342291..8f800bf63315 100644
--- a/sc/UIConfig_scalc.mk
+++ b/sc/UIConfig_scalc.mk
@@ -61,6 +61,7 @@ $(eval $(call gb_UIConfig_add_toolbarfiles,modules/scalc,\
$(eval $(call gb_UIConfig_add_uifiles,modules/scalc,\
sc/uiconfig/scalc/ui/cellprotectionpage \
sc/uiconfig/scalc/ui/definename \
+ sc/uiconfig/scalc/ui/deletecells \
sc/uiconfig/scalc/ui/deletecontents \
sc/uiconfig/scalc/ui/formatcellsdialog \
sc/uiconfig/scalc/ui/insertname \
diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc
index 9d85a5ac6544..47499709ce10 100644
--- a/sc/inc/sc.hrc
+++ b/sc/inc/sc.hrc
@@ -951,7 +951,7 @@
#define RID_SCDLG_FILTER (SC_DIALOGS_START + 8)
#define RID_SCDLG_SPEC_FILTER (SC_DIALOGS_START + 9)
-#define RID_SCDLG_DELCELL (SC_DIALOGS_START + 11)
+
#define RID_SCDLG_INSCELL (SC_DIALOGS_START + 12)
#define RID_SCDLG_INSCONT (SC_DIALOGS_START + 14)
diff --git a/sc/inc/scabstdlg.hxx b/sc/inc/scabstdlg.hxx
index 7b6c6023b053..89997d4e180f 100644
--- a/sc/inc/scabstdlg.hxx
+++ b/sc/inc/scabstdlg.hxx
@@ -358,7 +358,7 @@ public:
const com::sun::star::uno::Sequence<OUString>& rServices,
int nId ) = 0;
- virtual AbstractScDeleteCellDlg * CreateScDeleteCellDlg( Window* pParent, int nId, sal_Bool bDisallowCellMove = false ) = 0 ; //add for ScDeleteCellDlg
+ virtual AbstractScDeleteCellDlg * CreateScDeleteCellDlg(Window* pParent, bool bDisallowCellMove = false) = 0 ; //add for ScDeleteCellDlg
//for dataform
virtual AbstractScDataFormDlg * CreateScDataFormDlg( Window* pParent, int nId, ScTabViewShell* pTabViewShell ) = 0 ; //add for ScDataFormDlg
diff --git a/sc/source/ui/attrdlg/scdlgfact.cxx b/sc/source/ui/attrdlg/scdlgfact.cxx
index b6ce1f8fd6f1..98b656ff8102 100644
--- a/sc/source/ui/attrdlg/scdlgfact.cxx
+++ b/sc/source/ui/attrdlg/scdlgfact.cxx
@@ -832,27 +832,13 @@ AbstractScDataPilotServiceDlg* ScAbstractDialogFactory_Impl::CreateScDataPilotSe
// add for ScDataPilotServiceDlg end
-AbstractScDeleteCellDlg* ScAbstractDialogFactory_Impl::CreateScDeleteCellDlg( Window* pParent, int nId,
- sal_Bool bDisallowCellMove )
+AbstractScDeleteCellDlg* ScAbstractDialogFactory_Impl::CreateScDeleteCellDlg(Window* pParent,
+ bool bDisallowCellMove)
{
- ScDeleteCellDlg * pDlg=NULL;
- switch ( nId )
- {
- case RID_SCDLG_DELCELL :
- pDlg = new ScDeleteCellDlg( pParent, bDisallowCellMove );
- break;
- default:
- break;
- }
-
- if ( pDlg )
- return new AbstractScDeleteCellDlg_Impl( pDlg );
- return 0;
+ ScDeleteCellDlg * pDlg = new ScDeleteCellDlg(pParent, bDisallowCellMove);
+ return new AbstractScDeleteCellDlg_Impl( pDlg );
}
-
-
-
AbstractScDataFormDlg* ScAbstractDialogFactory_Impl::CreateScDataFormDlg( Window* pParent, int nId, ScTabViewShell* pTabViewShell )
{
ScDataFormDlg * pDlg=NULL;
diff --git a/sc/source/ui/attrdlg/scdlgfact.hxx b/sc/source/ui/attrdlg/scdlgfact.hxx
index 823eaeb0e2fe..33836164b5be 100644
--- a/sc/source/ui/attrdlg/scdlgfact.hxx
+++ b/sc/source/ui/attrdlg/scdlgfact.hxx
@@ -424,8 +424,7 @@ public:
virtual AbstractScDataPilotServiceDlg * CreateScDataPilotServiceDlg( Window* pParent, //add for ScDataPilotServiceDlg
const com::sun::star::uno::Sequence<OUString>& rServices,
int nId );
- virtual AbstractScDeleteCellDlg * CreateScDeleteCellDlg( Window* pParent, int nId,
- sal_Bool bDisallowCellMove = false ); //add for ScDeleteCellDlg
+ virtual AbstractScDeleteCellDlg * CreateScDeleteCellDlg(Window* pParent, bool bDisallowCellMove = false );
//for dataform
virtual AbstractScDataFormDlg * CreateScDataFormDlg( Window* pParent, int nId, ScTabViewShell* pTabViewShell); //add for ScDeleteCellDlg
diff --git a/sc/source/ui/inc/delcldlg.hxx b/sc/source/ui/inc/delcldlg.hxx
index 97271f46db15..56d08968f059 100644
--- a/sc/source/ui/inc/delcldlg.hxx
+++ b/sc/source/ui/inc/delcldlg.hxx
@@ -33,19 +33,13 @@
class ScDeleteCellDlg : public ModalDialog
{
private:
- FixedLine aFlFrame;
- RadioButton aBtnCellsUp;
- RadioButton aBtnCellsLeft;
- RadioButton aBtnDelRows;
- RadioButton aBtnDelCols;
- OKButton aBtnOk;
- CancelButton aBtnCancel;
- HelpButton aBtnHelp;
-
+ RadioButton* m_pBtnCellsUp;
+ RadioButton* m_pBtnCellsLeft;
+ RadioButton* m_pBtnDelRows;
+ RadioButton* m_pBtnDelCols;
public:
- ScDeleteCellDlg( Window* pParent, sal_Bool bDisallowCellMove = false );
- ~ScDeleteCellDlg();
+ ScDeleteCellDlg(Window* pParent, bool bDisallowCellMove = false);
DelCellCmd GetDelCellCmd() const;
};
diff --git a/sc/source/ui/inc/miscdlgs.hrc b/sc/source/ui/inc/miscdlgs.hrc
index e98582fd66b4..9efabdc4568b 100644
--- a/sc/source/ui/inc/miscdlgs.hrc
+++ b/sc/source/ui/inc/miscdlgs.hrc
@@ -17,8 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include "sc.hrc" // -> RID_SCDLG_DELCELL
- // -> RID_SCDLG_INSCELL
+#include "sc.hrc" // -> RID_SCDLG_INSCELL
// -> RID_SCDLG_INSCONT
// -> RID_SCDLG_MOVETAB
// -> RID_SCDLG_STRINPUT
@@ -38,13 +37,9 @@
#define FL_FRAME 112
#define STR_BTN_CLOSE 200
-// Insert/Delete Cell Dialog
-#define BTN_CELLSUP 10
+// Insert Cell Dialog
#define BTN_CELLSDOWN 11
#define BTN_CELLSRIGHT 12
-#define BTN_CELLSLEFT 13
-#define BTN_DELROWS 14
-#define BTN_DELCOLS 15
#define BTN_INSROWS 16
#define BTN_INSCOLS 17
diff --git a/sc/source/ui/miscdlgs/delcldlg.cxx b/sc/source/ui/miscdlgs/delcldlg.cxx
index e2fd6d874224..f93a040b153a 100644
--- a/sc/source/ui/miscdlgs/delcldlg.cxx
+++ b/sc/source/ui/miscdlgs/delcldlg.cxx
@@ -33,43 +33,36 @@ static sal_uInt8 nDelItemChecked=0;
//==================================================================
-ScDeleteCellDlg::ScDeleteCellDlg( Window* pParent, sal_Bool bDisallowCellMove ) :
- ModalDialog ( pParent, ScResId( RID_SCDLG_DELCELL ) ),
- //
- aFlFrame ( this, ScResId( FL_FRAME ) ),
- aBtnCellsUp ( this, ScResId( BTN_CELLSUP ) ),
- aBtnCellsLeft ( this, ScResId( BTN_CELLSLEFT ) ),
- aBtnDelRows ( this, ScResId( BTN_DELROWS ) ),
- aBtnDelCols ( this, ScResId( BTN_DELCOLS ) ),
- aBtnOk ( this, ScResId( BTN_OK ) ),
- aBtnCancel ( this, ScResId( BTN_CANCEL ) ),
- aBtnHelp ( this, ScResId( BTN_HELP ) )
+ScDeleteCellDlg::ScDeleteCellDlg(Window* pParent, bool bDisallowCellMove)
+ : ModalDialog(pParent, "DeleteCellsDialog", "modules/scalc/ui/deletecells.ui")
{
+ get(m_pBtnCellsUp, "up");
+ get(m_pBtnCellsLeft, "left");
+ get(m_pBtnDelRows, "rows");
+ get(m_pBtnDelCols, "cols");
if (bDisallowCellMove)
{
- aBtnCellsUp.Disable();
- aBtnCellsLeft.Disable();
+ m_pBtnCellsUp->Disable();
+ m_pBtnCellsLeft->Disable();
switch(nDelItemChecked)
{
- case 2: aBtnDelRows.Check();break;
- case 3: aBtnDelCols.Check();break;
- default:aBtnDelRows.Check();break;
+ case 2: m_pBtnDelRows->Check();break;
+ case 3: m_pBtnDelCols->Check();break;
+ default:m_pBtnDelRows->Check();break;
}
}
else
{
switch(nDelItemChecked)
{
- case 0: aBtnCellsUp.Check();break;
- case 1: aBtnCellsLeft.Check();break;
- case 2: aBtnDelRows.Check();break;
- case 3: aBtnDelCols.Check();break;
+ case 0: m_pBtnCellsUp->Check();break;
+ case 1: m_pBtnCellsLeft->Check();break;
+ case 2: m_pBtnDelRows->Check();break;
+ case 3: m_pBtnDelCols->Check();break;
}
}
-
- FreeResource();
}
//------------------------------------------------------------------------
@@ -78,22 +71,22 @@ DelCellCmd ScDeleteCellDlg::GetDelCellCmd() const
{
DelCellCmd nReturn = DEL_NONE;
- if ( aBtnCellsUp.IsChecked() )
+ if ( m_pBtnCellsUp->IsChecked() )
{
nDelItemChecked=0;
nReturn = DEL_CELLSUP;
}
- else if ( aBtnCellsLeft.IsChecked() )
+ else if ( m_pBtnCellsLeft->IsChecked() )
{
nDelItemChecked=1;
nReturn = DEL_CELLSLEFT;
}
- else if ( aBtnDelRows.IsChecked() )
+ else if ( m_pBtnDelRows->IsChecked() )
{
nDelItemChecked=2;
nReturn = DEL_DELROWS;
}
- else if ( aBtnDelCols.IsChecked() )
+ else if ( m_pBtnDelCols->IsChecked() )
{
nDelItemChecked=3;
nReturn = DEL_DELCOLS;
@@ -102,10 +95,4 @@ DelCellCmd ScDeleteCellDlg::GetDelCellCmd() const
return nReturn;
}
-ScDeleteCellDlg::~ScDeleteCellDlg()
-{
-}
-
-
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/src/miscdlgs.src b/sc/source/ui/src/miscdlgs.src
index 8dcf44a558b3..f7bbd9946722 100644
--- a/sc/source/ui/src/miscdlgs.src
+++ b/sc/source/ui/src/miscdlgs.src
@@ -19,74 +19,6 @@
#include "miscdlgs.hrc"
-ModalDialog RID_SCDLG_DELCELL
-{
- OutputSize = TRUE ;
- HelpId = CMD_FID_DELETE_CELL ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 191 , 70 ) ;
- Text [ en-US ] = "Delete Cells" ;
- Moveable = TRUE ;
- Closeable = FALSE ;
- OKButton BTN_OK
- {
- Pos = MAP_APPFONT ( 135 , 6 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- DefButton = TRUE ;
- };
- CancelButton BTN_CANCEL
- {
- Pos = MAP_APPFONT ( 135 , 23 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- HelpButton BTN_HELP
- {
- Pos = MAP_APPFONT ( 135 , 43 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- RadioButton BTN_DELCOLS
- {
- HelpID = "sc:RadioButton:RID_SCDLG_DELCELL:BTN_DELCOLS";
- Pos = MAP_APPFONT ( 12 , 56 ) ;
- Size = MAP_APPFONT ( 114 , 10 ) ;
- Text [ en-US ] = "Delete entire ~column(s)" ;
- TabStop = TRUE ;
- };
- RadioButton BTN_DELROWS
- {
- HelpID = "sc:RadioButton:RID_SCDLG_DELCELL:BTN_DELROWS";
- Pos = MAP_APPFONT ( 12 , 42 ) ;
- Size = MAP_APPFONT ( 114 , 10 ) ;
- Text [ en-US ] = "Delete entire ~row(s)" ;
- TabStop = TRUE ;
- };
- RadioButton BTN_CELLSLEFT
- {
- HelpID = "sc:RadioButton:RID_SCDLG_DELCELL:BTN_CELLSLEFT";
- Pos = MAP_APPFONT ( 12 , 28 ) ;
- Size = MAP_APPFONT ( 114 , 10 ) ;
- Text [ en-US ] = "Shift cells ~left" ;
- TabStop = TRUE ;
- };
- RadioButton BTN_CELLSUP
- {
- HelpID = "sc:RadioButton:RID_SCDLG_DELCELL:BTN_CELLSUP";
- Pos = MAP_APPFONT ( 12 , 14 ) ;
- Size = MAP_APPFONT ( 114 , 10 ) ;
- Text [ en-US ] = "Shift cells ~up" ;
- TabStop = TRUE ;
- };
- FixedLine FL_FRAME
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 123 , 8 ) ;
- Text [ en-US ] = "Selection" ;
- };
-};
-
ModalDialog RID_SCDLG_INSCELL
{
OutputSize = TRUE ;
diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx
index 04d6eb92fe7f..85fcf8355ffe 100644
--- a/sc/source/ui/view/cellsh1.cxx
+++ b/sc/source/ui/view/cellsh1.cxx
@@ -267,14 +267,14 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
{
ScRange aRange;
ScDocument* pDoc = GetViewData()->GetDocument();
- sal_Bool bTheFlag=GetViewData()->IsMultiMarked() ||
+ bool bTheFlag=GetViewData()->IsMultiMarked() ||
(GetViewData()->GetSimpleArea(aRange) == SC_MARK_SIMPLE_FILTERED) ||
(pDoc->GetChangeTrack() != NULL);
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "ScAbstractFactory create fail!");
- AbstractScDeleteCellDlg* pDlg = pFact->CreateScDeleteCellDlg( pTabViewShell->GetDialogParent(), RID_SCDLG_DELCELL, bTheFlag );
+ AbstractScDeleteCellDlg* pDlg = pFact->CreateScDeleteCellDlg( pTabViewShell->GetDialogParent(), bTheFlag );
OSL_ENSURE(pDlg, "Dialog create fail!");
if (pDlg->Execute() == RET_OK)
diff --git a/sc/uiconfig/scalc/ui/deletecells.ui b/sc/uiconfig/scalc/ui/deletecells.ui
index 276326f98fbe..fbaa5e0f8c85 100644
--- a/sc/uiconfig/scalc/ui/deletecells.ui
+++ b/sc/uiconfig/scalc/ui/deletecells.ui
@@ -1,28 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.0 -->
- <object class="GtkDialog" id="deletecells">
+ <object class="GtkDialog" id="DeleteCellsDialog">
<property name="can_focus">False</property>
- <property name="border_width">5</property>
+ <property name="border_width">6</property>
<property name="title" translatable="yes">Delete Cells</property>
<property name="type_hint">dialog</property>
<child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox1">
<property name="can_focus">False</property>
- <property name="spacing">2</property>
+ <property name="spacing">12</property>
<child internal-child="action_area">
<object class="GtkButtonBox" id="dialog-action_area1">
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="layout_style">start</property>
<child>
- <object class="GtkButton" id="ok1">
+ <object class="GtkButton" id="ok">
<property name="label">gtk-ok</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="can_default">True</property>
<property name="has_default">True</property>
<property name="receives_default">True</property>
- <property name="use_action_appearance">False</property>
<property name="use_stock">True</property>
</object>
<packing>
@@ -32,12 +32,11 @@
</packing>
</child>
<child>
- <object class="GtkButton" id="cancel1">
+ <object class="GtkButton" id="cancel">
<property name="label">gtk-cancel</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
- <property name="use_action_appearance">False</property>
<property name="use_stock">True</property>
</object>
<packing>
@@ -47,12 +46,11 @@
</packing>
</child>
<child>
- <object class="GtkButton" id="help1">
+ <object class="GtkButton" id="help">
<property name="label">gtk-help</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
- <property name="use_action_appearance">False</property>
<property name="use_stock">True</property>
<property name="image_position">top</property>
</object>
@@ -80,23 +78,25 @@
<object class="GtkAlignment" id="alignment3">
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="top_padding">6</property>
<property name="left_padding">12</property>
<child>
<object class="GtkBox" id="box1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
+ <property name="spacing">6</property>
<child>
- <object class="GtkRadioButton" id="radiobutton1">
+ <object class="GtkRadioButton" id="up">
<property name="label" translatable="yes">Shift cells _up</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
- <property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
+ <property name="group">left</property>
</object>
<packing>
<property name="expand">False</property>
@@ -105,16 +105,15 @@
</packing>
</child>
<child>
- <object class="GtkRadioButton" id="radiobutton2">
+ <object class="GtkRadioButton" id="left">
<property name="label" translatable="yes">Shift cells _left</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
- <property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
- <property name="active">True</property>
<property name="draw_indicator">True</property>
+ <property name="group">rows</property>
</object>
<packing>
<property name="expand">False</property>
@@ -123,16 +122,15 @@
</packing>
</child>
<child>
- <object class="GtkRadioButton" id="radiobutton3">
+ <object class="GtkRadioButton" id="rows">
<property name="label" translatable="yes">Delete entire _row(s)</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
- <property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
- <property name="active">True</property>
<property name="draw_indicator">True</property>
+ <property name="group">cols</property>
</object>
<packing>
<property name="expand">False</property>
@@ -141,16 +139,15 @@
</packing>
</child>
<child>
- <object class="GtkRadioButton" id="radiobutton4">
+ <object class="GtkRadioButton" id="cols">
<property name="label" translatable="yes">Delete entire _column(s)</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
- <property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
- <property name="active">True</property>
<property name="draw_indicator">True</property>
+ <property name="group">up</property>
</object>
<packing>
<property name="expand">False</property>
@@ -163,11 +160,13 @@
</object>
</child>
<child type="label">
- <object class="GtkLabel" id="Selectio">
+ <object class="GtkLabel" id="label1">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="label" translatable="yes">&lt;b&gt;Selection&lt;/b&gt;</property>
- <property name="use_markup">True</property>
+ <property name="label" translatable="yes">Selection</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
</object>
</child>
</object>
@@ -180,9 +179,9 @@
</object>
</child>
<action-widgets>
- <action-widget response="0">ok1</action-widget>
- <action-widget response="0">cancel1</action-widget>
- <action-widget response="0">help1</action-widget>
+ <action-widget response="0">ok</action-widget>
+ <action-widget response="0">cancel</action-widget>
+ <action-widget response="0">help</action-widget>
</action-widgets>
</object>
</interface>