diff options
-rw-r--r-- | sw/UIConfig_swriter.mk | 1 | ||||
-rw-r--r-- | sw/inc/globals.hrc | 2 | ||||
-rw-r--r-- | sw/inc/helpid.h | 1 | ||||
-rw-r--r-- | sw/inc/swabstdlg.hxx | 4 | ||||
-rw-r--r-- | sw/source/ui/dialog/regionsw.cxx | 8 | ||||
-rw-r--r-- | sw/source/ui/dialog/regionsw.src | 50 | ||||
-rw-r--r-- | sw/source/ui/dialog/swdlgfact.cxx | 16 | ||||
-rw-r--r-- | sw/source/ui/dialog/swdlgfact.hxx | 4 | ||||
-rw-r--r-- | sw/source/ui/dialog/uiregionsw.cxx | 38 | ||||
-rw-r--r-- | sw/source/ui/inc/regionsw.hxx | 6 | ||||
-rw-r--r-- | sw/uiconfig/swriter/ui/insertsectiondialog.ui | 175 |
11 files changed, 210 insertions, 95 deletions
diff --git a/sw/UIConfig_swriter.mk b/sw/UIConfig_swriter.mk index a56b10a749e7..4db60f5f8b3f 100644 --- a/sw/UIConfig_swriter.mk +++ b/sw/UIConfig_swriter.mk @@ -98,6 +98,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/swriter,\ sw/uiconfig/swriter/ui/insertbreak \ sw/uiconfig/swriter/ui/insertcaption \ sw/uiconfig/swriter/ui/insertfootnote \ + sw/uiconfig/swriter/ui/insertsectiondialog \ sw/uiconfig/swriter/ui/insertscript \ sw/uiconfig/swriter/ui/inserttable \ sw/uiconfig/swriter/ui/linenumbering \ diff --git a/sw/inc/globals.hrc b/sw/inc/globals.hrc index 1addfb9dbd6f..8fbc97e38ecb 100644 --- a/sw/inc/globals.hrc +++ b/sw/inc/globals.hrc @@ -190,8 +190,6 @@ #define TP_OPTCAPTION_PAGE (RC_GLOBALS_BEGIN + 78) #define DLG_SVXTEST_NUM_BULLET (RC_GLOBALS_BEGIN + 79) -#define TP_INSERT_SECTION (RC_GLOBALS_BEGIN + 85) -#define DLG_INSERT_SECTION (RC_GLOBALS_BEGIN + 86) #define DLG_SECTION_PROPERTIES (RC_GLOBALS_BEGIN + 87) #define DLG_MULTI_TOX (RC_GLOBALS_BEGIN + 89) diff --git a/sw/inc/helpid.h b/sw/inc/helpid.h index fe6aee4505ad..b1d8f7baa21f 100644 --- a/sw/inc/helpid.h +++ b/sw/inc/helpid.h @@ -167,7 +167,6 @@ #define HID_EDIT_FLD_REF "SW_HID_EDIT_FLD_REF" #define HID_REDLINE_CTRL "SW_HID_REDLINE_CTRL" #define HID_OPTCAPTION_PAGE "SW_HID_OPTCAPTION_PAGE" -#define HID_INSERT_SECTION_DLG "SW_HID_INSERT_SECTION_DLG" #define HID_SECTION_PROPERTIES_DLG "SW_HID_SECTION_PROPERTIES_DLG" #define HID_TP_TOX_SELECT "SW_HID_TP_TOX_SELECT" #define HID_TP_TOX_ENTRY "SW_HID_TP_TOX_ENTRY" diff --git a/sw/inc/swabstdlg.hxx b/sw/inc/swabstdlg.hxx index 3cdb1bb9dd81..ad7c3f14d550 100644 --- a/sw/inc/swabstdlg.hxx +++ b/sw/inc/swabstdlg.hxx @@ -443,8 +443,8 @@ public: SwTOXBase* pCurTOX, sal_uInt16 nToxType = USHRT_MAX, sal_Bool bGlobal = sal_False) = 0; //add for SwMultiTOXTabDialog virtual AbstractEditRegionDlg* CreateEditRegionDlg(Window* pParent, SwWrtShell& rWrtSh) = 0; //add for SwEditRegionDlg - virtual AbstractInsertSectionTabDialog* CreateInsertSectionTabDialog( int nResId, - Window* pParent, const SfxItemSet& rSet, SwWrtShell& rSh ) = 0; //add for SwInsertSectionTabDialog + virtual AbstractInsertSectionTabDialog* CreateInsertSectionTabDialog( + Window* pParent, const SfxItemSet& rSet, SwWrtShell& rSh) = 0; //add for SwInsertSectionTabDialog virtual AbstractMarkFloatDlg* CreateIndexMarkFloatDlg( SfxBindings* pBindings, SfxChildWindow* pChild, diff --git a/sw/source/ui/dialog/regionsw.cxx b/sw/source/ui/dialog/regionsw.cxx index 678a8fadb508..301c976be11c 100644 --- a/sw/source/ui/dialog/regionsw.cxx +++ b/sw/source/ui/dialog/regionsw.cxx @@ -82,8 +82,8 @@ void SwBaseShell::InsertRegionDialog(SfxRequest& rReq) aSet.Put(SvxSizeItem(SID_ATTR_PAGE_SIZE, Size(nWidth, nWidth))); SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "Dialogdiet fail!"); - AbstractInsertSectionTabDialog* aTabDlg = pFact->CreateInsertSectionTabDialog( DLG_INSERT_SECTION, - &GetView().GetViewFrame()->GetWindow(), aSet , rSh); + AbstractInsertSectionTabDialog* aTabDlg = pFact->CreateInsertSectionTabDialog( + &GetView().GetViewFrame()->GetWindow(), aSet , rSh); OSL_ENSURE(aTabDlg, "Dialogdiet fail!"); aTabDlg->Execute(); rReq.Ignore(); @@ -195,8 +195,8 @@ IMPL_STATIC_LINK( SwWrtShell, InsertRegionDialog, SwSectionData*, pSect ) aSet.Put(SvxSizeItem(SID_ATTR_PAGE_SIZE, Size(nWidth, nWidth))); SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "Dialogdiet fail!"); - AbstractInsertSectionTabDialog* aTabDlg = pFact->CreateInsertSectionTabDialog( DLG_INSERT_SECTION, - &pThis->GetView().GetViewFrame()->GetWindow(),aSet , *pThis); + AbstractInsertSectionTabDialog* aTabDlg = pFact->CreateInsertSectionTabDialog( + &pThis->GetView().GetViewFrame()->GetWindow(),aSet , *pThis); OSL_ENSURE(aTabDlg, "Dialogdiet fail!"); aTabDlg->SetSectionData(*xSectionData); aTabDlg->Execute(); diff --git a/sw/source/ui/dialog/regionsw.src b/sw/source/ui/dialog/regionsw.src index dfa4d0df2dd0..e65cc6ff4250 100644 --- a/sw/source/ui/dialog/regionsw.src +++ b/sw/source/ui/dialog/regionsw.src @@ -116,56 +116,6 @@ InfoBox REG_WRONG_PASSWD_REPEAT Message [ en-US ] = "The password has not been set." ; }; -TabDialog DLG_INSERT_SECTION -{ - HelpId = HID_INSERT_SECTION_DLG; - Text [ en-US ] = "Insert Section" ; - OutputSize = TRUE ; - SVLook = TRUE ; - Moveable = TRUE ; - TabControl 1 - { - OutputSize = TRUE ; - PageList = - { - PageItem - { - Identifier = TP_INSERT_SECTION; - PageResID = TP_INSERT_SECTION; - Text [ en-US ] = "Section"; - }; - PageItem - { - Identifier = TP_COLUMN ; - PageResID = TP_COLUMN ; - Text [ en-US ] = "Columns" ; - }; - PageItem - { - Identifier = TP_SECTION_INDENTS; - PageResID = TP_SECTION_INDENTS; - Text [ en-US ] = "Indents" ; - }; - PageItem - { - Identifier = TP_BACKGROUND ; - PageResID = TP_BACKGROUND ; - Text [ en-US ] = "Background" ; - }; - PageItem - { - Identifier = TP_SECTION_FTNENDNOTES ; - PageResID = TP_SECTION_FTNENDNOTES ; - Text [ en-US ] = "Footnotes/Endnotes"; - }; - }; - }; - String ST_INSERT - { - Text [ en-US ] = "Insert" ; - }; -}; - TabDialog DLG_SECTION_PROPERTIES { HelpId = HID_SECTION_PROPERTIES_DLG; diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx index 74d6453b1880..ea0dd39b5e2c 100644 --- a/sw/source/ui/dialog/swdlgfact.cxx +++ b/sw/source/ui/dialog/swdlgfact.cxx @@ -1155,21 +1155,11 @@ AbstractEditRegionDlg * SwAbstractDialogFactory_Impl::CreateEditRegionDlg(Window return new AbstractEditRegionDlg_Impl( pDlg ); } -AbstractInsertSectionTabDialog * SwAbstractDialogFactory_Impl::CreateInsertSectionTabDialog( int nResId, +AbstractInsertSectionTabDialog * SwAbstractDialogFactory_Impl::CreateInsertSectionTabDialog( Window* pParent, const SfxItemSet& rSet, SwWrtShell& rSh) //add for SwInsertSectionTabDialog { - SwInsertSectionTabDialog* pDlg=NULL; - switch ( nResId ) - { - case DLG_INSERT_SECTION : - pDlg = new SwInsertSectionTabDialog( pParent, rSet, rSh ); - break; - default: - break; - } - if ( pDlg ) - return new AbstractInsertSectionTabDialog_Impl( pDlg ); - return 0; + SwInsertSectionTabDialog* pDlg = new SwInsertSectionTabDialog(pParent, rSet, rSh); + return new AbstractInsertSectionTabDialog_Impl(pDlg); } AbstractMarkFloatDlg * SwAbstractDialogFactory_Impl::CreateIndexMarkFloatDlg( diff --git a/sw/source/ui/dialog/swdlgfact.hxx b/sw/source/ui/dialog/swdlgfact.hxx index 9efa6e4cdb1e..e0060494ef55 100644 --- a/sw/source/ui/dialog/swdlgfact.hxx +++ b/sw/source/ui/dialog/swdlgfact.hxx @@ -539,8 +539,8 @@ public: SwTOXBase* pCurTOX, sal_uInt16 nToxType = USHRT_MAX, sal_Bool bGlobal = sal_False); //add for SwMultiTOXTabDialog virtual AbstractEditRegionDlg* CreateEditRegionDlg(Window* pParent, SwWrtShell& rWrtSh); //add for SwEditRegionDlg - virtual AbstractInsertSectionTabDialog* CreateInsertSectionTabDialog( int nResId, - Window* pParent, const SfxItemSet& rSet, SwWrtShell& rSh); //add for SwInsertSectionTabDialog + virtual AbstractInsertSectionTabDialog* CreateInsertSectionTabDialog( + Window* pParent, const SfxItemSet& rSet, SwWrtShell& rSh); //add for SwInsertSectionTabDialog virtual AbstractMarkFloatDlg* CreateIndexMarkFloatDlg( SfxBindings* pBindings, SfxChildWindow* pChild, diff --git a/sw/source/ui/dialog/uiregionsw.cxx b/sw/source/ui/dialog/uiregionsw.cxx index 8f7ca5ce37a3..225669a468db 100644 --- a/sw/source/ui/dialog/uiregionsw.cxx +++ b/sw/source/ui/dialog/uiregionsw.cxx @@ -1434,21 +1434,19 @@ static void lcl_ReadSections( SfxMedium& rMedium, ComboBox& rBox ) } SwInsertSectionTabDialog::SwInsertSectionTabDialog( - Window* pParent, const SfxItemSet& rSet, SwWrtShell& rSh) : - SfxTabDialog( pParent, SW_RES(DLG_INSERT_SECTION), &rSet ), - rWrtSh(rSh) + Window* pParent, const SfxItemSet& rSet, SwWrtShell& rSh) + : SfxTabDialog(pParent, "InsertSectionDialog", + "modules/swriter/ui/insertsectiondialog.ui", &rSet) + , rWrtSh(rSh) , m_pSectionData(0) { - String sInsert(SW_RES(ST_INSERT)); - GetOKButton().SetText(sInsert); - FreeResource(); SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "Dialogdiet fail!"); - AddTabPage(TP_INSERT_SECTION, SwInsertSectionTabPage::Create, 0); - AddTabPage(TP_COLUMN, SwColumnPage::Create, 0); - AddTabPage(TP_BACKGROUND, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), 0); - AddTabPage(TP_SECTION_FTNENDNOTES, SwSectionFtnEndTabPage::Create, 0); - AddTabPage(TP_SECTION_INDENTS, SwSectionIndentTabPage::Create, 0); + m_nSectionPageId = AddTabPage("section", SwInsertSectionTabPage::Create, 0); + m_nColumnPageId = AddTabPage("columns", SwColumnPage::Create, 0); + m_nBackPageId = AddTabPage("background", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), 0); + m_nNotePageId = AddTabPage("notes", SwSectionFtnEndTabPage::Create, 0); + m_nIndentPage = AddTabPage("indents", SwSectionIndentTabPage::Create, 0); SvxHtmlOptions& rHtmlOpt = SvxHtmlOptions::Get(); long nHtmlMode = rHtmlOpt.GetExportMode(); @@ -1456,12 +1454,12 @@ SwInsertSectionTabDialog::SwInsertSectionTabDialog( bool bWeb = 0 != PTR_CAST( SwWebDocShell, rSh.GetView().GetDocShell() ); if(bWeb) { - RemoveTabPage(TP_SECTION_FTNENDNOTES); - RemoveTabPage(TP_SECTION_INDENTS); + RemoveTabPage(m_nNotePageId); + RemoveTabPage(m_nIndentPage); if( HTML_CFG_NS40 != nHtmlMode && HTML_CFG_WRITER != nHtmlMode) - RemoveTabPage(TP_COLUMN); + RemoveTabPage(m_nColumnPageId); } - SetCurPageId(TP_INSERT_SECTION); + SetCurPageId(m_nSectionPageId); } SwInsertSectionTabDialog::~SwInsertSectionTabDialog() @@ -1470,22 +1468,22 @@ SwInsertSectionTabDialog::~SwInsertSectionTabDialog() void SwInsertSectionTabDialog::PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) { - if(TP_INSERT_SECTION == nId) + if (nId == m_nSectionPageId) ((SwInsertSectionTabPage&)rPage).SetWrtShell(rWrtSh); - else if( TP_BACKGROUND == nId ) + else if (nId == m_nBackPageId) { SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool())); aSet.Put (SfxUInt32Item(SID_FLAG_TYPE, SVX_SHOW_SELECTOR)); rPage.PageCreated(aSet); } - else if( TP_COLUMN == nId ) + else if (nId == m_nColumnPageId) { const SwFmtFrmSize& rSize = (const SwFmtFrmSize&)GetInputSetImpl()->Get(RES_FRM_SIZE); ((SwColumnPage&)rPage).SetPageWidth(rSize.GetWidth()); ((SwColumnPage&)rPage).ShowBalance(sal_True); ((SwColumnPage&)rPage).SetInSection(sal_True); } - else if(TP_SECTION_INDENTS == nId) + else if (nId == m_nIndentPage) ((SwSectionIndentTabPage&)rPage).SetWrtShell(rWrtSh); } @@ -1563,8 +1561,6 @@ SwInsertSectionTabPage::SwInsertSectionTabPage( // edit in readonly sections get(m_pEditInReadonlyCB, "editable"); - - m_pProtectCB->SetClickHdl ( LINK( this, SwInsertSectionTabPage, ChangeProtectHdl)); m_pPasswdCB->SetClickHdl ( LINK( this, SwInsertSectionTabPage, ChangePasswdHdl)); m_pPasswdPB->SetClickHdl ( LINK( this, SwInsertSectionTabPage, ChangePasswdHdl)); diff --git a/sw/source/ui/inc/regionsw.hxx b/sw/source/ui/inc/regionsw.hxx index 9258bc426378..b00ec02c4566 100644 --- a/sw/source/ui/inc/regionsw.hxx +++ b/sw/source/ui/inc/regionsw.hxx @@ -267,6 +267,12 @@ class SwInsertSectionTabDialog : public SfxTabDialog SwWrtShell& rWrtSh; ::std::auto_ptr<SwSectionData> m_pSectionData; + sal_uInt16 m_nSectionPageId; + sal_uInt16 m_nColumnPageId; + sal_uInt16 m_nBackPageId; + sal_uInt16 m_nNotePageId; + sal_uInt16 m_nIndentPage; + protected: virtual void PageCreated( sal_uInt16 nId, SfxTabPage &rPage ); virtual short Ok(); diff --git a/sw/uiconfig/swriter/ui/insertsectiondialog.ui b/sw/uiconfig/swriter/ui/insertsectiondialog.ui new file mode 100644 index 000000000000..c6b63ab29c26 --- /dev/null +++ b/sw/uiconfig/swriter/ui/insertsectiondialog.ui @@ -0,0 +1,175 @@ +<?xml version="1.0" encoding="UTF-8"?> +<interface> + <!-- interface-requires gtk+ 3.0 --> + <object class="GtkDialog" id="InsertSectionDialog"> + <property name="can_focus">False</property> + <property name="border_width">6</property> + <property name="title" translatable="yes">Insert Section</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">_Insert</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_underline">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="section"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Section</property> + </object> + <packing> + <property name="tab_fill">False</property> + </packing> + </child> + <child> + <placeholder/> + </child> + <child type="tab"> + <object class="GtkLabel" id="columns"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Columns</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="indents"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Indents</property> + </object> + <packing> + <property name="position">2</property> + <property name="tab_fill">False</property> + </packing> + </child> + <child> + <placeholder/> + </child> + <child type="tab"> + <object class="GtkLabel" id="background"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Background</property> + </object> + <packing> + <property name="position">3</property> + <property name="tab_fill">False</property> + </packing> + </child> + <child> + <placeholder/> + </child> + <child type="tab"> + <object class="GtkLabel" id="notes"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Footnotes/Endnotes</property> + </object> + <packing> + <property name="position">4</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> |