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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Dec 12 20:10:05 UTC 2018


 sw/source/ui/config/optload.cxx          |   15 +++++++--------
 sw/source/ui/frmdlg/cption.cxx           |    4 ++--
 sw/source/uibase/inc/optload.hxx         |    4 ++--
 sw/uiconfig/swriter/ui/captiondialog.ui  |    8 +++++++-
 sw/uiconfig/swriter/ui/optcaptionpage.ui |    1 -
 5 files changed, 18 insertions(+), 14 deletions(-)

New commits:
commit 320e8d38b7d0c5a47fdae13a657af9d9b896f279
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed Dec 12 11:02:57 2018 +0000
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Wed Dec 12 21:09:39 2018 +0100

    weld SwCaptionOptDlg
    
    Change-Id: Iac2cb2ab3239e23a64dbc528f0d07d4071c4815c
    Reviewed-on: https://gerrit.libreoffice.org/65011
    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/config/optload.cxx b/sw/source/ui/config/optload.cxx
index 6c2c3755a21a..cbba58516fdd 100644
--- a/sw/source/ui/config/optload.cxx
+++ b/sw/source/ui/config/optload.cxx
@@ -393,12 +393,13 @@ IMPL_LINK_NOARG(SwLoadOptPage, MetricHdl, ListBox&, void)
     }
 }
 
-SwCaptionOptDlg::SwCaptionOptDlg(vcl::Window* pParent, const SfxItemSet& rSet)
-    : SfxSingleTabDialog(pParent, rSet, "CaptionDialog",
-        "modules/swriter/ui/captiondialog.ui")
+SwCaptionOptDlg::SwCaptionOptDlg(weld::Window* pParent, const SfxItemSet& rSet)
+    : SfxSingleTabDialogController(pParent, rSet, "modules/swriter/ui/captiondialog.ui",
+                                   "CaptionDialog")
 {
     // create TabPage
-    SetTabPage(SwCaptionOptPage::Create(get_content_area(), &rSet));
+    TabPageParent aParent(get_content_area(), this);
+    SetTabPage(SwCaptionOptPage::Create(aParent, &rSet));
 }
 
 SwCaptionPreview::SwCaptionPreview(vcl::Window* pParent, WinBits nStyle)
@@ -889,10 +890,8 @@ void SwCaptionOptPage::ModifyHdl()
 {
     const OUString sFieldTypeName = m_xCategoryBox->get_active_text();
 
-    SfxSingleTabDialog *pDlg = dynamic_cast<SfxSingleTabDialog*>(GetTabDialog());
-    PushButton *pBtn = pDlg ? pDlg->GetOKButton() : nullptr;
-    if (pBtn)
-        pBtn->Enable(!sFieldTypeName.isEmpty());
+    if (SfxSingleTabDialogController* pDlg = dynamic_cast<SfxSingleTabDialogController*>(GetDialogController()))
+        pDlg->GetOKButton().set_sensitive(!sFieldTypeName.isEmpty());
     bool bEnable = m_xCategoryBox->get_sensitive() && sFieldTypeName != m_sNone;
 
     m_xFormatText->set_sensitive(bEnable);
diff --git a/sw/source/ui/frmdlg/cption.cxx b/sw/source/ui/frmdlg/cption.cxx
index 3f650c189003..cf1668f42c2f 100644
--- a/sw/source/ui/frmdlg/cption.cxx
+++ b/sw/source/ui/frmdlg/cption.cxx
@@ -352,8 +352,8 @@ IMPL_LINK_NOARG(SwCaptionDialog, ModifyHdl, Edit&, void)
 IMPL_LINK_NOARG(SwCaptionDialog, CaptionHdl, Button*, void)
 {
     SfxItemSet  aSet( rView.GetDocShell()->GetDoc()->GetAttrPool() );
-    ScopedVclPtrInstance< SwCaptionOptDlg > aDlg( this, aSet );
-    aDlg->Execute();
+    SwCaptionOptDlg aDlg(GetFrameWeld(), aSet);
+    aDlg.run();
 }
 
 void SwCaptionDialog::DrawSample()
diff --git a/sw/source/uibase/inc/optload.hxx b/sw/source/uibase/inc/optload.hxx
index c027a9925a0e..6f23242811b6 100644
--- a/sw/source/uibase/inc/optload.hxx
+++ b/sw/source/uibase/inc/optload.hxx
@@ -95,10 +95,10 @@ public:
     virtual void        Reset( const SfxItemSet* rSet ) override;
 };
 
-class SwCaptionOptDlg : public SfxSingleTabDialog
+class SwCaptionOptDlg : public SfxSingleTabDialogController
 {
 public:
-    SwCaptionOptDlg(vcl::Window* pParent, const SfxItemSet& rSet);
+    SwCaptionOptDlg(weld::Window* pParent, const SfxItemSet& rSet);
 };
 
 class SwCaptionPreview : public vcl::Window
diff --git a/sw/uiconfig/swriter/ui/captiondialog.ui b/sw/uiconfig/swriter/ui/captiondialog.ui
index 8ed3590ebcda..776b1cce44bf 100644
--- a/sw/uiconfig/swriter/ui/captiondialog.ui
+++ b/sw/uiconfig/swriter/ui/captiondialog.ui
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.18.3 -->
+<!-- Generated with glade 3.22.1 -->
 <interface domain="sw">
   <requires lib="gtk+" version="3.18"/>
   <object class="GtkDialog" id="CaptionDialog">
@@ -7,7 +7,13 @@
     <property name="border_width">6</property>
     <property name="title" translatable="yes" context="captiondialog|CaptionDialog">Caption</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>
diff --git a/sw/uiconfig/swriter/ui/optcaptionpage.ui b/sw/uiconfig/swriter/ui/optcaptionpage.ui
index 133505ec6d23..9abdce1ff1ce 100644
--- a/sw/uiconfig/swriter/ui/optcaptionpage.ui
+++ b/sw/uiconfig/swriter/ui/optcaptionpage.ui
@@ -441,7 +441,6 @@
                                 <property name="alignment">0.5</property>
                                 <child>
                                   <object class="GtkCellRendererToggle" id="cellrenderer2">
-                                    <property name="radio">True</property>
                                   </object>
                                   <attributes>
                                     <attribute name="active">0</attribute>


More information about the Libreoffice-commits mailing list