summaryrefslogtreecommitdiff
path: root/sc/source/ui/attrdlg
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/ui/attrdlg')
-rw-r--r--sc/source/ui/attrdlg/attrdlg.cxx63
-rw-r--r--sc/source/ui/attrdlg/scdlgfact.cxx22
-rw-r--r--sc/source/ui/attrdlg/scdlgfact.hxx3
-rw-r--r--sc/source/ui/attrdlg/tabpages.cxx1
4 files changed, 28 insertions, 61 deletions
diff --git a/sc/source/ui/attrdlg/attrdlg.cxx b/sc/source/ui/attrdlg/attrdlg.cxx
index c3e570c2d54d..fcd0da3eaf62 100644
--- a/sc/source/ui/attrdlg/attrdlg.cxx
+++ b/sc/source/ui/attrdlg/attrdlg.cxx
@@ -31,7 +31,6 @@
#include "tabpages.hxx"
#include "attrdlg.hxx"
#include "scresid.hxx"
-#include "attrdlg.hrc"
#include <svx/svxdlg.hxx>
#include <svx/dialogs.hrc>
#include <svx/flagsdef.hxx>
@@ -40,41 +39,34 @@
//==================================================================
-ScAttrDlg::ScAttrDlg( SfxViewFrame* pFrameP,
- Window* pParent,
- const SfxItemSet* pCellAttrs )
-
- : SfxTabDialog( pFrameP,
- pParent,
- ScResId( RID_SCDLG_ATTR ),
- pCellAttrs )
+ScAttrDlg::ScAttrDlg(SfxViewFrame* pFrameP, Window* pParent, const SfxItemSet* pCellAttrs)
+ : SfxTabDialog(pFrameP, pParent, "FormatCellsDialog", "modules/scalc/ui/formatcellsdialog.ui", pCellAttrs)
{
SvtCJKOptions aCJKOptions;
SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "Dialogdiet fail!");
OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_NUMBERFORMAT ), "GetTabPageCreatorFunc fail!");
- AddTabPage( TP_NUMBER, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_NUMBERFORMAT ), 0 );
+ m_nNumberPageId = AddTabPage( "numbers", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_NUMBERFORMAT ), 0 );
OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_NAME ), "GetTabPageCreatorFunc fail!");
- AddTabPage( TP_FONT, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_NAME ), 0 );
+ m_nFontPageId = AddTabPage( "font", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_NAME ), 0 );
OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_EFFECTS ), "GetTabPageCreatorFunc fail!");
- AddTabPage( TP_FONTEFF, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_EFFECTS ), 0 );
+ AddTabPage( "fonteffects", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_EFFECTS ), 0 );
OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_ALIGNMENT ), "GetTabPageCreatorFunc fail!");
- AddTabPage( TP_ALIGNMENT, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_ALIGNMENT ), 0 );
+ AddTabPage( "alignment", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_ALIGNMENT ), 0 );
if ( aCJKOptions.IsAsianTypographyEnabled() )
{
OSL_ENSURE(pFact->GetTabPageCreatorFunc(RID_SVXPAGE_PARA_ASIAN), "GetTabPageCreatorFunc fail!");
- AddTabPage( TP_ASIAN, pFact->GetTabPageCreatorFunc(RID_SVXPAGE_PARA_ASIAN), 0 );
+ AddTabPage( "asiantypography", pFact->GetTabPageCreatorFunc(RID_SVXPAGE_PARA_ASIAN), 0 );
}
else
- RemoveTabPage( TP_ASIAN );
+ RemoveTabPage( "asiantypography" );
OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), "GetTabPageCreatorFunc fail!");
- AddTabPage( TP_BORDER, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), 0 );
+ AddTabPage( "borders", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), 0 );
OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageCreatorFunc fail!");
- AddTabPage( TP_BACKGROUND, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), 0 );
- AddTabPage( TP_PROTECTION, ScTabPageProtection::Create, 0 );
- FreeResource();
+ AddTabPage( "background", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), 0 );
+ AddTabPage( "cellprotection" , ScTabPageProtection::Create, 0 );
}
// -----------------------------------------------------------------------
@@ -89,28 +81,19 @@ void ScAttrDlg::PageCreated( sal_uInt16 nPageId, SfxTabPage& rTabPage )
{
SfxObjectShell* pDocSh = SfxObjectShell::Current();
SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
- switch ( nPageId )
+ if (nPageId == m_nNumberPageId)
+ {
+ aSet.Put (SfxLinkItem( SID_LINK_TYPE, LINK( this, ScAttrDlg, OkHandler )));
+ rTabPage.PageCreated(aSet);
+ }
+ else if (nPageId == m_nFontPageId)
{
- case TP_NUMBER:
- {
- aSet.Put (SfxLinkItem( SID_LINK_TYPE, LINK( this, ScAttrDlg, OkHandler )));
- rTabPage.PageCreated(aSet);
- }
- break;
-
- case TP_FONT:
- {
- const SfxPoolItem* pInfoItem = pDocSh->GetItem( SID_ATTR_CHAR_FONTLIST );
-
- OSL_ENSURE( pInfoItem, "FontListItem not found :-(" );
-
- aSet.Put (SvxFontListItem(((const SvxFontListItem*)pInfoItem)->GetFontList(), SID_ATTR_CHAR_FONTLIST ));
- rTabPage.PageCreated(aSet);
- }
- break;
-
- default:
- break;
+ const SfxPoolItem* pInfoItem = pDocSh->GetItem( SID_ATTR_CHAR_FONTLIST );
+
+ OSL_ENSURE( pInfoItem, "FontListItem not found :-(" );
+
+ aSet.Put (SvxFontListItem(((const SvxFontListItem*)pInfoItem)->GetFontList(), SID_ATTR_CHAR_FONTLIST ));
+ rTabPage.PageCreated(aSet);
}
}
diff --git a/sc/source/ui/attrdlg/scdlgfact.cxx b/sc/source/ui/attrdlg/scdlgfact.cxx
index ca1bfd49407d..e511c7bb7e0f 100644
--- a/sc/source/ui/attrdlg/scdlgfact.cxx
+++ b/sc/source/ui/attrdlg/scdlgfact.cxx
@@ -1338,25 +1338,11 @@ AbstractScImportOptionsDlg * ScAbstractDialogFactory_Impl::CreateScImportOptions
}
-SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScAttrDlg( SfxViewFrame* pFrame,
- Window* pParent,
- const SfxItemSet* pCellAttrs,
- int nId)
+SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScAttrDlg(SfxViewFrame* pFrame,
+ Window* pParent, const SfxItemSet* pCellAttrs)
{
- SfxTabDialog* pDlg=NULL;
- switch ( nId )
- {
- case RID_SCDLG_ATTR :
- pDlg = new ScAttrDlg( pFrame, pParent, pCellAttrs );
- break;
- default:
- break;
- }
-
- if ( pDlg )
- return new ScAbstractTabDialog_Impl( pDlg );
- return 0;
-
+ SfxTabDialog* pDlg = new ScAttrDlg(pFrame, pParent, pCellAttrs);
+ return new ScAbstractTabDialog_Impl(pDlg);
}
#undef SfxTabDialog
diff --git a/sc/source/ui/attrdlg/scdlgfact.hxx b/sc/source/ui/attrdlg/scdlgfact.hxx
index f0cca3dc5136..5720c691ca72 100644
--- a/sc/source/ui/attrdlg/scdlgfact.hxx
+++ b/sc/source/ui/attrdlg/scdlgfact.hxx
@@ -549,8 +549,7 @@ public:
sal_Bool bImport = sal_True );
virtual SfxAbstractTabDialog * CreateScAttrDlg( SfxViewFrame* pFrame, //add for ScAttrDlg
Window* pParent,
- const SfxItemSet* pCellAttrs,
- int nId);
+ const SfxItemSet* pCellAttrs );
virtual SfxAbstractTabDialog * CreateScHFEditDlg( SfxViewFrame* pFrame, //add for ScHFEditDlg
Window* pParent,
diff --git a/sc/source/ui/attrdlg/tabpages.cxx b/sc/source/ui/attrdlg/tabpages.cxx
index f16897ac176f..94ecdc0f3c99 100644
--- a/sc/source/ui/attrdlg/tabpages.cxx
+++ b/sc/source/ui/attrdlg/tabpages.cxx
@@ -27,7 +27,6 @@
#include "scresid.hxx"
#include "sc.hrc"
-#include "attrdlg.hrc"
#include "tabpages.hxx"
// STATIC DATA -----------------------------------------------------------