summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-01-04 19:43:02 +0000
committerCaolán McNamara <caolanm@redhat.com>2014-01-04 19:58:28 +0000
commit51640a1bcdc17a87c2f5dd9348bd2d4493bd05e6 (patch)
tree50e8587361551085d48958bbcc19e75d365f5106 /sc/source
parent44029ade1bc023fea3ebf6b84ffb272498daaf67 (diff)
convert calc character dialog to .ui
Change-Id: I305b18bea24377dcd98b3e06c4cf75bdbdd4d717
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/ui/attrdlg/scdlgfact.cxx19
-rw-r--r--sc/source/ui/attrdlg/scdlgfact.hxx4
-rw-r--r--sc/source/ui/drawfunc/drtxtob1.cxx5
-rw-r--r--sc/source/ui/inc/textdlgs.hxx12
-rw-r--r--sc/source/ui/miscdlgs/textdlgs.cxx44
-rw-r--r--sc/source/ui/pagedlg/tphfedit.cxx4
-rw-r--r--sc/source/ui/src/textdlgs.src59
-rw-r--r--sc/source/ui/view/editsh.cxx4
8 files changed, 38 insertions, 113 deletions
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)
{