diff --git a/cui/UIConfig_cui.mk b/cui/UIConfig_cui.mk index b508acc4ed7a..95fdba3dd17e 100644 --- a/cui/UIConfig_cui.mk +++ b/cui/UIConfig_cui.mk @@ -128,6 +128,7 @@ $(eval $(call gb_UIConfig_add_uifiles,cui,\ cui/uiconfig/ui/recordnumberdialog \ cui/uiconfig/ui/rotationtabpage \ cui/uiconfig/ui/scriptorganizer \ + cui/uiconfig/ui/searchformatdialog \ cui/uiconfig/ui/securityoptionsdialog \ cui/uiconfig/ui/select_persona_dialog \ cui/uiconfig/ui/shadowtabpage \ diff --git a/cui/source/dialogs/srchxtra.cxx b/cui/source/dialogs/srchxtra.cxx index 87857a97287a..7000d954e778 100644 --- a/cui/source/dialogs/srchxtra.cxx +++ b/cui/source/dialogs/srchxtra.cxx @@ -37,87 +37,77 @@ #include #include "svtools/treelistentry.hxx" -// class SvxSearchFormatDialog ------------------------------------------- - -SvxSearchFormatDialog::SvxSearchFormatDialog( Window* pParent, const SfxItemSet& rSet ) : - - SfxTabDialog( pParent, CUI_RES( RID_SVXDLG_SEARCHFORMAT ), &rSet ), - - pFontList( NULL ) - +SvxSearchFormatDialog::SvxSearchFormatDialog(Window* pParent, const SfxItemSet& rSet) + : SfxTabDialog(pParent, "SearchFormatDialog", "cui/ui/searchformatdialog.ui", &rSet) + , m_pFontList(NULL) + , m_nNamePageId(0) + , m_nParaStdPageId(0) + , m_nParaAlignPageId(0) + , m_nBackPageId(0) { - FreeResource(); - - AddTabPage( RID_SVXPAGE_CHAR_NAME, SvxCharNamePage::Create, 0 ); - AddTabPage( RID_SVXPAGE_CHAR_EFFECTS, SvxCharEffectsPage::Create, 0 ); - AddTabPage( RID_SVXPAGE_CHAR_POSITION, SvxCharPositionPage::Create, 0 ); - AddTabPage( RID_SVXPAGE_CHAR_TWOLINES, SvxCharTwoLinesPage::Create, 0 ); - AddTabPage( RID_SVXPAGE_STD_PARAGRAPH, SvxStdParagraphTabPage::Create, 0 ); - AddTabPage( RID_SVXPAGE_ALIGN_PARAGRAPH, SvxParaAlignTabPage::Create, 0 ); - AddTabPage( RID_SVXPAGE_EXT_PARAGRAPH, SvxExtParagraphTabPage::Create, 0 ); - AddTabPage( RID_SVXPAGE_PARA_ASIAN, SvxAsianTabPage::Create, 0 ); - AddTabPage( RID_SVXPAGE_BACKGROUND, SvxBackgroundTabPage::Create, 0 ); + m_nNamePageId = AddTabPage("font", SvxCharNamePage::Create, 0); + AddTabPage("fonteffects", SvxCharEffectsPage::Create, 0); + AddTabPage("position", SvxCharPositionPage::Create, 0); + AddTabPage("asianlayout", SvxCharTwoLinesPage::Create, 0); + m_nParaStdPageId = AddTabPage("labelTP_PARA_STD", SvxStdParagraphTabPage::Create, 0); + m_nParaAlignPageId = AddTabPage("labelTP_PARA_ALIGN", SvxParaAlignTabPage::Create, 0); + AddTabPage("labelTP_PARA_EXT", SvxExtParagraphTabPage::Create, 0); + AddTabPage("labelTP_PARA_ASIAN", SvxAsianTabPage::Create, 0 ); + m_nBackPageId = AddTabPage("background", SvxBackgroundTabPage::Create, 0); // remove asian tabpages if necessary SvtCJKOptions aCJKOptions; if ( !aCJKOptions.IsDoubleLinesEnabled() ) - RemoveTabPage( RID_SVXPAGE_CHAR_TWOLINES ); + RemoveTabPage("asianlayout"); if ( !aCJKOptions.IsAsianTypographyEnabled() ) - RemoveTabPage( RID_SVXPAGE_PARA_ASIAN ); + RemoveTabPage("labelTP_PARA_ASIAN"); } -// ----------------------------------------------------------------------- - SvxSearchFormatDialog::~SvxSearchFormatDialog() { - delete pFontList; + delete m_pFontList; } -// ----------------------------------------------------------------------- - void SvxSearchFormatDialog::PageCreated( sal_uInt16 nId, SfxTabPage& rPage ) { - switch ( nId ) + if (nId == m_nNamePageId) { - case RID_SVXPAGE_CHAR_NAME: + const FontList* pApm_pFontList = 0; + SfxObjectShell* pSh = SfxObjectShell::Current(); + + if ( pSh ) { - const FontList* pAppFontList = 0; - SfxObjectShell* pSh = SfxObjectShell::Current(); - - if ( pSh ) - { - const SvxFontListItem* pFLItem = (const SvxFontListItem*) - pSh->GetItem( SID_ATTR_CHAR_FONTLIST ); - if ( pFLItem ) - pAppFontList = pFLItem->GetFontList(); - } - - const FontList* pList = pAppFontList; - - if ( !pList ) - { - if ( !pFontList ) - pFontList = new FontList( this ); - pList = pFontList; - } - - if ( pList ) - ( (SvxCharNamePage&)rPage ). - SetFontList( SvxFontListItem( pList, SID_ATTR_CHAR_FONTLIST ) ); - ( (SvxCharNamePage&)rPage ).EnableSearchMode(); - break; + const SvxFontListItem* pFLItem = (const SvxFontListItem*) + pSh->GetItem( SID_ATTR_CHAR_FONTLIST ); + if ( pFLItem ) + pApm_pFontList = pFLItem->GetFontList(); } - case RID_SVXPAGE_STD_PARAGRAPH: - ( (SvxStdParagraphTabPage&)rPage ).EnableAutoFirstLine(); - break; + const FontList* pList = pApm_pFontList; - case RID_SVXPAGE_ALIGN_PARAGRAPH: - ( (SvxParaAlignTabPage&)rPage ).EnableJustifyExt(); - break; - case RID_SVXPAGE_BACKGROUND : - ( (SvxBackgroundTabPage&)rPage ).ShowParaControl(sal_True); - break; + if ( !pList ) + { + if ( !m_pFontList ) + m_pFontList = new FontList( this ); + pList = m_pFontList; + } + + if ( pList ) + ( (SvxCharNamePage&)rPage ). + SetFontList( SvxFontListItem( pList, SID_ATTR_CHAR_FONTLIST ) ); + ( (SvxCharNamePage&)rPage ).EnableSearchMode(); + } + else if (nId == m_nParaStdPageId) + { + ( (SvxStdParagraphTabPage&)rPage ).EnableAutoFirstLine(); + } + else if (nId == m_nParaAlignPageId) + { + ( (SvxParaAlignTabPage&)rPage ).EnableJustifyExt(); + } + else if (nId == m_nBackPageId) + { + ( (SvxBackgroundTabPage&)rPage ).ShowParaControl(sal_True); } } diff --git a/cui/source/dialogs/srchxtra.src b/cui/source/dialogs/srchxtra.src index ec032f7d3fda..d8b2b5a718d7 100644 --- a/cui/source/dialogs/srchxtra.src +++ b/cui/source/dialogs/srchxtra.src @@ -22,67 +22,7 @@ #include "srchxtra.hrc" #include - // RID_SVXDLG_SEARCHFORMAT ----------------------------------------------- -TabDialog RID_SVXDLG_SEARCHFORMAT -{ - OutputSize = TRUE ; - SvLook = TRUE ; - Text [ en-US ] = "Text Format" ; - Moveable = TRUE ; - TabControl 1 - { - OutputSize = TRUE ; - 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 ] = "Position" ; - }; - PageItem - { - Identifier = RID_SVXPAGE_CHAR_TWOLINES ; - Text [ en-US ] = "Asian Layout" ; - }; - PageItem - { - Identifier = RID_SVXPAGE_STD_PARAGRAPH ; - Text [ en-US ] = "Indents & Spacing" ; - }; - PageItem - { - Identifier = RID_SVXPAGE_ALIGN_PARAGRAPH ; - Text [ en-US ] = "Alignment" ; - }; - PageItem - { - Identifier = RID_SVXPAGE_EXT_PARAGRAPH ; - Text [ en-US ] = "Text Flow" ; - }; - PageItem - { - Identifier = RID_SVXPAGE_PARA_ASIAN; - Text [ en-US ] = "Asian Typography"; - }; - PageItem - { - Identifier = RID_SVXPAGE_BACKGROUND; - Text [ en-US ] = "Background" ; - }; - }; - }; -}; - // RID_SVXDLG_SEARCHATTRIBUTE -------------------------------------------- +// RID_SVXDLG_SEARCHATTRIBUTE -------------------------------------------- ModalDialog RID_SVXDLG_SEARCHATTR { HelpId = HID_SEARCHATTR ; diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx index 3cf3d972e8b2..a7a96c3ffc45 100644 --- a/cui/source/factory/dlgfact.cxx +++ b/cui/source/factory/dlgfact.cxx @@ -1313,23 +1313,11 @@ SfxAbstractDialog* AbstractDialogFactory_Impl::CreateSfxDialog( sal_uInt32, return new CuiAbstractSfxDialog_Impl( pDlg ); } -SfxAbstractTabDialog* AbstractDialogFactory_Impl::CreateTabItemDialog( Window* pParent, - const SfxItemSet& rSet, - sal_uInt32 nResId) +SfxAbstractTabDialog* AbstractDialogFactory_Impl::CreateTabItemDialog(Window* pParent, + const SfxItemSet& rSet) { - SfxTabDialog* pDlg=NULL; - switch ( nResId ) - { - case RID_SVXDLG_SEARCHFORMAT : - pDlg = new SvxSearchFormatDialog( pParent, rSet ); - break; - default: - break; - } - - if ( pDlg ) - return new CuiAbstractTabDialog_Impl( pDlg ); - return 0; + SfxTabDialog* pDlg = new SvxSearchFormatDialog(pParent, rSet); + return new CuiAbstractTabDialog_Impl(pDlg); } VclAbstractDialog* AbstractDialogFactory_Impl::CreateSvxSearchAttributeDialog( Window* pParent, diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx index 784130e0ad5c..cee1226ef3c4 100644 --- a/cui/source/factory/dlgfact.hxx +++ b/cui/source/factory/dlgfact.hxx @@ -552,9 +552,8 @@ public: const SfxItemSet* pAttrSet, SdrView* pView, SdrModel* pModel=0 ); - virtual SfxAbstractTabDialog* CreateTabItemDialog( Window* pParent, - const SfxItemSet& rSet, - sal_uInt32 nResId); + virtual SfxAbstractTabDialog* CreateTabItemDialog(Window* pParent, + const SfxItemSet& rSet); virtual AbstractSvxCaptionDialog* CreateCaptionDialog( Window* pParent, const SdrView* pView, sal_uInt16 nAnchorTypes = 0 ); diff --git a/cui/source/inc/srchxtra.hxx b/cui/source/inc/srchxtra.hxx index 642f3c79aa28..d505204799a4 100644 --- a/cui/source/inc/srchxtra.hxx +++ b/cui/source/inc/srchxtra.hxx @@ -26,19 +26,21 @@ #include #include -// class SvxSearchFormatDialog ------------------------------------------- - class SvxSearchFormatDialog : public SfxTabDialog { public: SvxSearchFormatDialog( Window* pParent, const SfxItemSet& rSet ); - ~SvxSearchFormatDialog(); + virtual ~SvxSearchFormatDialog(); protected: virtual void PageCreated( sal_uInt16 nId, SfxTabPage &rPage ); private: - FontList* pFontList; + FontList* m_pFontList; + sal_uInt16 m_nNamePageId; + sal_uInt16 m_nParaStdPageId; + sal_uInt16 m_nParaAlignPageId; + sal_uInt16 m_nBackPageId; }; // class SvxSearchFormatDialog ------------------------------------------- diff --git a/cui/uiconfig/ui/searchformatdialog.ui b/cui/uiconfig/ui/searchformatdialog.ui new file mode 100644 index 000000000000..0e1e9abf5223 --- /dev/null +++ b/cui/uiconfig/ui/searchformatdialog.ui @@ -0,0 +1,233 @@ + + + + + False + 6 + Text Format + 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 + + + False + True + 2 + + + + + gtk-revert-to-saved + True + True + True + True + + + False + True + 3 + + + + + False + True + end + 0 + + + + + True + True + True + True + + + + + + True + False + Font + + + False + + + + + + + + True + False + Font Effects + + + 1 + False + + + + + + + + True + False + Position + + + 2 + False + + + + + + + + True + False + Asian Layout + + + 3 + False + + + + + + + + True + False + Indents & Spacing + + + 4 + False + + + + + + + + True + False + 0.4699999988079071 + Alignment + + + 5 + False + + + + + + + + True + False + 0.46000000834465027 + Text Flow + + + 6 + False + + + + + + + + True + False + Asian Typography + + + 7 + False + + + + + + + + True + False + Background + + + 8 + False + + + + + False + True + 1 + + + + + + ok + cancel + help + reset + + + diff --git a/include/svx/dialogs.hrc b/include/svx/dialogs.hrc index 95c0691fed61..a422d2d98bcf 100644 --- a/include/svx/dialogs.hrc +++ b/include/svx/dialogs.hrc @@ -107,7 +107,6 @@ #define RID_SVX_GRFFILTER_DLG_SOLARIZE (RID_SVX_START + 333) #define RID_SVX_GRFFILTER_DLG_EMBOSS (RID_SVX_START + 336) #define RID_SVX_GRFFILTER_DLG_SMOOTH (RID_SVX_START + 337) -#define RID_SVXDLG_SEARCHFORMAT (RID_SVX_START + 21) #define RID_SVXDLG_CHARMAP ( RID_SVX_START + 10 ) // IDs of options pages of applications diff --git a/include/svx/svxdlg.hxx b/include/svx/svxdlg.hxx index 919f6f5957af..34ae403e3edd 100644 --- a/include/svx/svxdlg.hxx +++ b/include/svx/svxdlg.hxx @@ -358,9 +358,8 @@ public: TargetList& rTargetList ) = 0; virtual AbstractSvxHlinkDlgMarkWnd* CreateSvxHlinkDlgMarkWndDialog( SvxHyperlinkTabPageBase* pParent, sal_uInt32 nResId ) =0; - virtual SfxAbstractTabDialog* CreateTabItemDialog( Window* pParent, - const SfxItemSet& rSet, - sal_uInt32 nResId) = 0; + virtual SfxAbstractTabDialog* CreateTabItemDialog(Window* pParent, + const SfxItemSet& rSet) = 0; virtual VclAbstractDialog* CreateSvxSearchAttributeDialog( Window* pParent, SearchAttrItemList& rLst, const sal_uInt16* pWhRanges)=0; diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx index e6afc1c4463f..e5df140ff1f5 100644 --- a/svx/source/dialog/srchdlg.cxx +++ b/svx/source/dialog/srchdlg.cxx @@ -1950,7 +1950,7 @@ IMPL_LINK_NOARG(SvxSearchDialog, FormatHdl_Impl) SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); if(pFact) { - SfxAbstractTabDialog* pDlg = pFact->CreateTabItemDialog( this, aSet, RID_SVXDLG_SEARCHFORMAT ); + SfxAbstractTabDialog* pDlg = pFact->CreateTabItemDialog(this, aSet); DBG_ASSERT(pDlg, "Dialogdiet fail!"); aTxt = pDlg->GetText() + aTxt; pDlg->SetText( aTxt );