[Libreoffice-commits] core.git: sw/source sw/uiconfig

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Sat Mar 16 00:03:14 UTC 2019


 sw/source/ui/dialog/uiregionsw.cxx            |   40 +++++-----
 sw/source/uibase/inc/regionsw.hxx             |   11 --
 sw/uiconfig/swriter/ui/formatsectiondialog.ui |  104 +++++++++++++++++++++++++-
 3 files changed, 126 insertions(+), 29 deletions(-)

New commits:
commit 9bfdd19de3a2bc12bc6331b3357763e47a4bed5c
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Fri Mar 15 09:40:52 2019 +0000
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Sat Mar 16 01:02:40 2019 +0100

    weld SwSectionPropertyTabDialog
    
    Change-Id: I1958c4bcbd4e4acc1af1b81abd4dd6955a1a3de6
    Reviewed-on: https://gerrit.libreoffice.org/69298
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/source/ui/dialog/uiregionsw.cxx b/sw/source/ui/dialog/uiregionsw.cxx
index b0e896c4a022..26acfcffae92 100644
--- a/sw/source/ui/dialog/uiregionsw.cxx
+++ b/sw/source/ui/dialog/uiregionsw.cxx
@@ -1143,10 +1143,10 @@ IMPL_LINK_NOARG(SwEditRegionDlg, OptionsHdl, Button*, void)
     aSet.Put(SwFormatFrameSize(ATT_VAR_SIZE, nWidth));
     aSet.Put(SvxSizeItem(SID_ATTR_PAGE_SIZE, Size(nWidth, nWidth)));
 
-    ScopedVclPtrInstance< SwSectionPropertyTabDialog > aTabDlg(this, aSet, rSh);
-    if(RET_OK == aTabDlg->Execute())
+    SwSectionPropertyTabDialog aTabDlg(GetFrameWeld(), aSet, rSh);
+    if (RET_OK == aTabDlg.run())
     {
-        const SfxItemSet* pOutSet = aTabDlg->GetOutputItemSet();
+        const SfxItemSet* pOutSet = aTabDlg.GetOutputItemSet();
         if( pOutSet && pOutSet->Count() )
         {
             const SfxPoolItem *pColItem, *pBrushItem,
@@ -2123,26 +2123,26 @@ IMPL_LINK( SwSectionFootnoteEndTabPage, FootEndHdl, weld::ToggleButton&, rBox, v
 }
 
 SwSectionPropertyTabDialog::SwSectionPropertyTabDialog(
-    vcl::Window* pParent, const SfxItemSet& rSet, SwWrtShell& rSh)
-    : SfxTabDialog(pParent, "FormatSectionDialog",
-        "modules/swriter/ui/formatsectiondialog.ui", &rSet)
+    weld::Window* pParent, const SfxItemSet& rSet, SwWrtShell& rSh)
+    : SfxTabDialogController(pParent, "modules/swriter/ui/formatsectiondialog.ui",
+                             "FormatSectionDialog", &rSet)
     , rWrtSh(rSh)
 {
     SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
-    m_nColumnPageId = AddTabPage("columns",   SwColumnPage::Create);
-    m_nBackPageId = AddTabPage("background", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BKG ) );
-    m_nNotePageId = AddTabPage("notes", SwSectionFootnoteEndTabPage::Create);
-    m_nIndentPage = AddTabPage("indents", SwSectionIndentTabPage::Create);
+    AddTabPage("columns",   SwColumnPage::Create, nullptr);
+    AddTabPage("background", pFact->GetTabPageCreatorFunc(RID_SVXPAGE_BKG), nullptr);
+    AddTabPage("notes", SwSectionFootnoteEndTabPage::Create, nullptr);
+    AddTabPage("indents", SwSectionIndentTabPage::Create, nullptr);
 
     SvxHtmlOptions& rHtmlOpt = SvxHtmlOptions::Get();
     long nHtmlMode = rHtmlOpt.GetExportMode();
     bool bWeb = dynamic_cast<SwWebDocShell*>( rSh.GetView().GetDocShell()  ) != nullptr ;
     if(bWeb)
     {
-        RemoveTabPage(m_nNotePageId);
-        RemoveTabPage(m_nIndentPage);
+        RemoveTabPage("notes");
+        RemoveTabPage("indents");
         if( HTML_CFG_NS40 != nHtmlMode && HTML_CFG_WRITER != nHtmlMode)
-            RemoveTabPage(m_nColumnPageId);
+            RemoveTabPage("columns");
     }
 }
 
@@ -2150,20 +2150,20 @@ SwSectionPropertyTabDialog::~SwSectionPropertyTabDialog()
 {
 }
 
-void SwSectionPropertyTabDialog::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
+void SwSectionPropertyTabDialog::PageCreated(const OString& rId, SfxTabPage &rPage)
 {
-    if (nId == m_nBackPageId)
+    if (rId == "background")
     {
-            SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
-            aSet.Put (SfxUInt32Item(SID_FLAG_TYPE, static_cast<sal_uInt32>(SvxBackgroundTabFlags::SHOW_SELECTOR)));
-            rPage.PageCreated(aSet);
+        SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
+        aSet.Put (SfxUInt32Item(SID_FLAG_TYPE, static_cast<sal_uInt32>(SvxBackgroundTabFlags::SHOW_SELECTOR)));
+        rPage.PageCreated(aSet);
     }
-    else if (nId == m_nColumnPageId)
+    else if (rId == "columns")
     {
         static_cast<SwColumnPage&>(rPage).ShowBalance(true);
         static_cast<SwColumnPage&>(rPage).SetInSection(true);
     }
-    else if (nId == m_nIndentPage)
+    else if (rId == "indents")
         static_cast<SwSectionIndentTabPage&>(rPage).SetWrtShell(rWrtSh);
 }
 
diff --git a/sw/source/uibase/inc/regionsw.hxx b/sw/source/uibase/inc/regionsw.hxx
index fe44a70da0ca..4a54a0d72062 100644
--- a/sw/source/uibase/inc/regionsw.hxx
+++ b/sw/source/uibase/inc/regionsw.hxx
@@ -257,19 +257,14 @@ public:
     SwSectionData * GetSectionData() { return m_pSectionData.get(); }
 };
 
-class SwSectionPropertyTabDialog : public SfxTabDialog
+class SwSectionPropertyTabDialog : public SfxTabDialogController
 {
     SwWrtShell& rWrtSh;
 
-    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 ) override;
+    virtual void    PageCreated(const OString& rId, SfxTabPage &rPage) override;
 public:
-    SwSectionPropertyTabDialog(vcl::Window* pParent, const SfxItemSet& rSet, SwWrtShell& rSh);
+    SwSectionPropertyTabDialog(weld::Window* pParent, const SfxItemSet& rSet, SwWrtShell& rSh);
     virtual ~SwSectionPropertyTabDialog() override;
 };
 
diff --git a/sw/uiconfig/swriter/ui/formatsectiondialog.ui b/sw/uiconfig/swriter/ui/formatsectiondialog.ui
index aab97d630b8a..ab1ecfe23dfa 100644
--- a/sw/uiconfig/swriter/ui/formatsectiondialog.ui
+++ b/sw/uiconfig/swriter/ui/formatsectiondialog.ui
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.20.0 -->
+<!-- Generated with glade 3.22.1 -->
 <interface domain="sw">
   <requires lib="gtk+" version="3.18"/>
   <object class="GtkDialog" id="FormatSectionDialog">
@@ -7,7 +7,13 @@
     <property name="border_width">6</property>
     <property name="title" translatable="yes" context="formatsectiondialog|FormatSectionDialog">Options</property>
     <property name="resizable">False</property>
+    <property name="modal">True</property>
+    <property name="default_width">0</property>
+    <property name="default_height">0</property>
     <property name="type_hint">dialog</property>
+    <child>
+      <placeholder/>
+    </child>
     <child internal-child="vbox">
       <object class="GtkBox" id="dialog-vbox1">
         <property name="can_focus">False</property>
@@ -100,6 +106,30 @@
                 <child>
                   <placeholder/>
                 </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
               </object>
             </child>
             <child type="tab">
@@ -119,6 +149,30 @@
                 <child>
                   <placeholder/>
                 </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
               </object>
               <packing>
                 <property name="position">1</property>
@@ -142,6 +196,30 @@
                 <child>
                   <placeholder/>
                 </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
               </object>
               <packing>
                 <property name="position">2</property>
@@ -165,6 +243,30 @@
                 <child>
                   <placeholder/>
                 </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
               </object>
               <packing>
                 <property name="position">3</property>


More information about the Libreoffice-commits mailing list