diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-01-04 19:43:02 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-01-04 19:58:28 +0000 |
commit | 51640a1bcdc17a87c2f5dd9348bd2d4493bd05e6 (patch) | |
tree | 50e8587361551085d48958bbcc19e75d365f5106 | |
parent | 44029ade1bc023fea3ebf6b84ffb272498daaf67 (diff) |
convert calc character dialog to .ui
Change-Id: I305b18bea24377dcd98b3e06c4cf75bdbdd4d717
-rw-r--r-- | sc/UIConfig_scalc.mk | 1 | ||||
-rw-r--r-- | sc/inc/sc.hrc | 1 | ||||
-rw-r--r-- | sc/inc/scabstdlg.hxx | 4 | ||||
-rw-r--r-- | sc/source/ui/attrdlg/scdlgfact.cxx | 19 | ||||
-rw-r--r-- | sc/source/ui/attrdlg/scdlgfact.hxx | 4 | ||||
-rw-r--r-- | sc/source/ui/drawfunc/drtxtob1.cxx | 5 | ||||
-rw-r--r-- | sc/source/ui/inc/textdlgs.hxx | 12 | ||||
-rw-r--r-- | sc/source/ui/miscdlgs/textdlgs.cxx | 44 | ||||
-rw-r--r-- | sc/source/ui/pagedlg/tphfedit.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/src/textdlgs.src | 59 | ||||
-rw-r--r-- | sc/source/ui/view/editsh.cxx | 4 | ||||
-rw-r--r-- | sc/uiconfig/scalc/ui/chardialog.ui | 148 |
12 files changed, 189 insertions, 116 deletions
diff --git a/sc/UIConfig_scalc.mk b/sc/UIConfig_scalc.mk index bd785c980123..2cbf29f19b8e 100644 --- a/sc/UIConfig_scalc.mk +++ b/sc/UIConfig_scalc.mk @@ -64,6 +64,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/scalc,\ sc/uiconfig/scalc/ui/allheaderfooterdialog \ sc/uiconfig/scalc/ui/analysisofvariancedialog \ sc/uiconfig/scalc/ui/cellprotectionpage \ + sc/uiconfig/scalc/ui/chardialog \ sc/uiconfig/scalc/ui/colwidthdialog \ sc/uiconfig/scalc/ui/consolidatedialog \ sc/uiconfig/scalc/ui/correlationdialog \ diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc index 695bce6e86e3..98aebf884722 100644 --- a/sc/inc/sc.hrc +++ b/sc/inc/sc.hrc @@ -1049,7 +1049,6 @@ -#define RID_SCDLG_CHAR (SC_DIALOGS_START + 76) #define RID_SCDLG_PARAGRAPH (SC_DIALOGS_START + 77) #define RID_SCDLG_CONTACTS (SC_DIALOGS_START + 78) diff --git a/sc/inc/scabstdlg.hxx b/sc/inc/scabstdlg.hxx index 243bf24e981e..c7716dbfa88b 100644 --- a/sc/inc/scabstdlg.hxx +++ b/sc/inc/scabstdlg.hxx @@ -492,8 +492,8 @@ public: virtual SfxAbstractTabDialog * CreateScSubTotalDlg( Window* pParent, const SfxItemSet* pArgSet ) = 0; - virtual SfxAbstractTabDialog * CreateScCharDlg( Window* pParent, const SfxItemSet* pAttr, - const SfxObjectShell* pDocShell, int nId ) = 0; + virtual SfxAbstractTabDialog * CreateScCharDlg(Window* pParent, + const SfxItemSet* pAttr, const SfxObjectShell* pDocShell) = 0; virtual SfxAbstractTabDialog * CreateScParagraphDlg( Window* pParent, const SfxItemSet* pAttr , int nId ) = 0; diff --git a/sc/source/ui/attrdlg/scdlgfact.cxx b/sc/source/ui/attrdlg/scdlgfact.cxx index 743f9892295b..1ac1e0eeec5b 100644 --- a/sc/source/ui/attrdlg/scdlgfact.cxx +++ b/sc/source/ui/attrdlg/scdlgfact.cxx @@ -1125,22 +1125,11 @@ SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScSubTotalDlg(Window* return new ScAbstractTabDialog_Impl( pDlg ); } -SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScCharDlg( Window* pParent, const SfxItemSet* pAttr, - const SfxObjectShell* pDocShell, int nId ) +SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScCharDlg( + Window* pParent, const SfxItemSet* pAttr, const SfxObjectShell* pDocShell) { - SfxTabDialog* pDlg=NULL; - switch ( nId ) - { - case RID_SCDLG_CHAR : - pDlg = new ScCharDlg( pParent, pAttr, pDocShell ); - break; - default: - break; - } - - if ( pDlg ) - return new ScAbstractTabDialog_Impl( pDlg ); - return 0; + SfxTabDialog* pDlg = new ScCharDlg(pParent, pAttr, pDocShell); + return new ScAbstractTabDialog_Impl(pDlg); } SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScParagraphDlg( Window* pParent, const SfxItemSet* pAttr , diff --git a/sc/source/ui/attrdlg/scdlgfact.hxx b/sc/source/ui/attrdlg/scdlgfact.hxx index 78a9d2b588d8..cbbf0702a5d6 100644 --- a/sc/source/ui/attrdlg/scdlgfact.hxx +++ b/sc/source/ui/attrdlg/scdlgfact.hxx @@ -559,8 +559,8 @@ public: virtual SfxAbstractTabDialog * CreateScSubTotalDlg( Window* pParent, const SfxItemSet* pArgSet ); - virtual SfxAbstractTabDialog * CreateScCharDlg( Window* pParent, const SfxItemSet* pAttr, - const SfxObjectShell* pDocShell, int nId ); + virtual SfxAbstractTabDialog * CreateScCharDlg(Window* pParent, + const SfxItemSet* pAttr, const SfxObjectShell* pDocShell); virtual SfxAbstractTabDialog * CreateScParagraphDlg( Window* pParent, const SfxItemSet* pAttr , int nId ); diff --git a/sc/source/ui/drawfunc/drtxtob1.cxx b/sc/source/ui/drawfunc/drtxtob1.cxx index fcff116d6aa3..141062d01944 100644 --- a/sc/source/ui/drawfunc/drtxtob1.cxx +++ b/sc/source/ui/drawfunc/drtxtob1.cxx @@ -46,8 +46,9 @@ sal_Bool ScDrawTextObjectBar::ExecuteCharDlg( const SfxItemSet& rArgs, ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "ScAbstractFactory create fail!"); - SfxAbstractTabDialog* pDlg = pFact->CreateScCharDlg( pViewData->GetDialogParent(), &rArgs, - pViewData->GetSfxDocShell(),RID_SCDLG_CHAR ); + SfxAbstractTabDialog* pDlg = pFact->CreateScCharDlg( + pViewData->GetDialogParent(), &rArgs, + pViewData->GetSfxDocShell()); OSL_ENSURE(pDlg, "Dialog create fail!"); if (nSlot == SID_CHAR_DLG_EFFECT) { diff --git a/sc/source/ui/inc/textdlgs.hxx b/sc/source/ui/inc/textdlgs.hxx index 6919d5a369a4..65e4d56d9585 100644 --- a/sc/source/ui/inc/textdlgs.hxx +++ b/sc/source/ui/inc/textdlgs.hxx @@ -27,14 +27,14 @@ class SfxObjectShell; class ScCharDlg : public SfxTabDialog { private: - const SfxObjectShell& rDocShell; - - virtual void PageCreated( sal_uInt16 nId, SfxTabPage &rPage ); + const SfxObjectShell& rDocShell; + sal_uInt16 m_nNamePageId; + sal_uInt16 m_nEffectsPageId; + virtual void PageCreated(sal_uInt16 nId, SfxTabPage &rPage); public: - ScCharDlg( Window* pParent, const SfxItemSet* pAttr, - const SfxObjectShell* pDocShell ); - ~ScCharDlg() {} + ScCharDlg(Window* pParent, const SfxItemSet* pAttr, + const SfxObjectShell* pDocShell); }; class ScParagraphDlg : public SfxTabDialog diff --git a/sc/source/ui/miscdlgs/textdlgs.cxx b/sc/source/ui/miscdlgs/textdlgs.cxx index e906949718c5..324dce7e355c 100644 --- a/sc/source/ui/miscdlgs/textdlgs.cxx +++ b/sc/source/ui/miscdlgs/textdlgs.cxx @@ -33,15 +33,16 @@ // ----------------------------------------------------------------------- ScCharDlg::ScCharDlg( Window* pParent, const SfxItemSet* pAttr, - const SfxObjectShell* pDocShell ) : - SfxTabDialog ( pParent, ScResId( RID_SCDLG_CHAR ), pAttr ), - rDocShell ( *pDocShell ) + const SfxObjectShell* pDocShell ) + : SfxTabDialog(pParent, "CharDialog", + "modules/scalc/ui/chardialog.ui", pAttr) + , rDocShell(*pDocShell) + , m_nNamePageId(0) + , m_nEffectsPageId(0) { - FreeResource(); - - AddTabPage( RID_SVXPAGE_CHAR_NAME ); - AddTabPage( RID_SVXPAGE_CHAR_EFFECTS ); - AddTabPage( RID_SVXPAGE_CHAR_POSITION ); + m_nNamePageId = AddTabPage("font", RID_SVXPAGE_CHAR_NAME); + m_nEffectsPageId = AddTabPage("fonteffects", RID_SVXPAGE_CHAR_EFFECTS); + AddTabPage("position", RID_SVXPAGE_CHAR_POSITION); } // ----------------------------------------------------------------------- @@ -49,25 +50,18 @@ ScCharDlg::ScCharDlg( Window* pParent, const SfxItemSet* pAttr, void ScCharDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) { SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool())); - switch( nId ) + if (nId == m_nNamePageId) { - case RID_SVXPAGE_CHAR_NAME: - { - SvxFontListItem aItem(*( (const SvxFontListItem*) - ( rDocShell.GetItem( SID_ATTR_CHAR_FONTLIST) ) ) ); - - aSet.Put (SvxFontListItem( aItem.GetFontList(), SID_ATTR_CHAR_FONTLIST)); - rPage.PageCreated(aSet); - } - break; + SvxFontListItem aItem(*( (const SvxFontListItem*) + ( rDocShell.GetItem( SID_ATTR_CHAR_FONTLIST) ) ) ); - case RID_SVXPAGE_CHAR_EFFECTS: - aSet.Put (SfxUInt16Item(SID_DISABLE_CTL,DISABLE_CASEMAP)); - rPage.PageCreated(aSet); - break; - - default: - break; + aSet.Put (SvxFontListItem( aItem.GetFontList(), SID_ATTR_CHAR_FONTLIST)); + rPage.PageCreated(aSet); + } + else if (nId == m_nEffectsPageId) + { + aSet.Put (SfxUInt16Item(SID_DISABLE_CTL,DISABLE_CASEMAP)); + rPage.PageCreated(aSet); } } diff --git a/sc/source/ui/pagedlg/tphfedit.cxx b/sc/source/ui/pagedlg/tphfedit.cxx index 2cea44389e24..c0ec88091b8d 100644 --- a/sc/source/ui/pagedlg/tphfedit.cxx +++ b/sc/source/ui/pagedlg/tphfedit.cxx @@ -216,8 +216,8 @@ void ScEditWindow::SetCharAttriutes() ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "ScAbstractFactory create fail!"); - SfxAbstractTabDialog* pDlg = pFact->CreateScCharDlg( GetParent(), &aSet, - pDocSh,RID_SCDLG_CHAR ); + SfxAbstractTabDialog* pDlg = pFact->CreateScCharDlg( + GetParent(), &aSet, pDocSh); OSL_ENSURE(pDlg, "Dialog create fail!"); pDlg->SetText( ScGlobal::GetRscString( STR_TEXTATTRS ) ); if ( pDlg->Execute() == RET_OK ) diff --git a/sc/source/ui/src/textdlgs.src b/sc/source/ui/src/textdlgs.src index f537abb91eb0..57caacf8f160 100644 --- a/sc/source/ui/src/textdlgs.src +++ b/sc/source/ui/src/textdlgs.src @@ -20,65 +20,6 @@ #include <svx/dialogs.hrc> #include "sc.hrc" -TabDialog RID_SCDLG_CHAR -{ - OutputSize = TRUE ; - SVLook = TRUE ; - Size = MAP_APPFONT ( 289 , 176 ) ; - Text [ en-US ] = "Character" ; - Moveable = TRUE ; - Closeable = TRUE ; - TabControl 1 - { - OutputSize = TRUE ; - Pos = MAP_APPFONT ( 3 , 3 ) ; - Size = MAP_APPFONT ( 260 , 135 ) ; - PageList = - { - PageItem - { - Identifier = RID_SVXPAGE_CHAR_NAME ; - Text [ en-US ] = "Font"; - }; - PageItem - { - Identifier = RID_SVXPAGE_CHAR_EFFECTS ; - Text [ en-US ] = "Font Effects"; - }; - PageItem - { - Identifier = RID_SVXPAGE_CHAR_POSITION ; - Text [ en-US ] = "Font Position"; - }; - }; - }; - OKButton 1 - { - Pos = MAP_APPFONT ( 6 , 151 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - CancelButton 1 - { - Pos = MAP_APPFONT ( 60 , 151 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - HelpButton 1 - { - Pos = MAP_APPFONT ( 114 , 151 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - PushButton 1 - { - Pos = MAP_APPFONT ( 169 , 151 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - Text [ en-US ] = "Back" ; - TabStop = TRUE ; - }; -}; - TabDialog RID_SCDLG_PARAGRAPH { OutputSize = TRUE ; diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx index 17ae3bb1a14c..fccc0ea964a7 100644 --- a/sc/source/ui/view/editsh.cxx +++ b/sc/source/ui/view/editsh.cxx @@ -457,8 +457,8 @@ void ScEditShell::Execute( SfxRequest& rReq ) ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "ScAbstractFactory create fail!"); - SfxAbstractTabDialog* pDlg = pFact->CreateScCharDlg( pViewData->GetDialogParent(), &aAttrs, - pObjSh, RID_SCDLG_CHAR ); + SfxAbstractTabDialog* pDlg = pFact->CreateScCharDlg( + pViewData->GetDialogParent(), &aAttrs, pObjSh); OSL_ENSURE(pDlg, "Dialog create fail!"); if (nSlot == SID_CHAR_DLG_EFFECT) { diff --git a/sc/uiconfig/scalc/ui/chardialog.ui b/sc/uiconfig/scalc/ui/chardialog.ui new file mode 100644 index 000000000000..71d0861fa7cb --- /dev/null +++ b/sc/uiconfig/scalc/ui/chardialog.ui @@ -0,0 +1,148 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Generated with glade 3.16.0 on Sat Jan 4 17:30:31 2014 --> +<interface> + <!-- interface-requires gtk+ 3.0 --> + <object class="GtkDialog" id="CharDialog"> + <property name="can_focus">False</property> + <property name="border_width">6</property> + <property name="title" translatable="yes">Character</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="orientation">vertical</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="layout_style">end</property> + <child> + <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_stock">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <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_stock">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + <child> + <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_stock">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">2</property> + </packing> + </child> + <child> + <object class="GtkButton" id="reset"> + <property name="label">gtk-revert-to-saved</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="use_stock">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">3</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="pack_type">end</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkNotebook" id="tabcontrol"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <child> + <placeholder/> + </child> + <child type="tab"> + <object class="GtkLabel" id="font"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Font</property> + </object> + <packing> + <property name="tab_fill">False</property> + </packing> + </child> + <child> + <placeholder/> + </child> + <child type="tab"> + <object class="GtkLabel" id="fonteffects"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Font Effects</property> + </object> + <packing> + <property name="position">1</property> + <property name="tab_fill">False</property> + </packing> + </child> + <child> + <placeholder/> + </child> + <child type="tab"> + <object class="GtkLabel" id="position"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Position</property> + </object> + <packing> + <property name="position">2</property> + <property name="tab_fill">False</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + </child> + <action-widgets> + <action-widget response="0">ok</action-widget> + <action-widget response="0">cancel</action-widget> + <action-widget response="0">help</action-widget> + <action-widget response="0">reset</action-widget> + </action-widgets> + </object> +</interface> |