[Libreoffice-commits] core.git: 2 commits - cui/source cui/uiconfig include/svx

Caolán McNamara caolanm at redhat.com
Sat Mar 31 18:49:42 UTC 2018


 cui/source/factory/dlgfact.cxx            |   13 +++--
 cui/source/factory/dlgfact.hxx            |   14 ++++-
 cui/source/inc/optdict.hxx                |   25 ++++------
 cui/source/options/optdict.cxx            |   75 ++++++++++--------------------
 cui/source/options/optlingu.cxx           |   62 +++++++++---------------
 cui/uiconfig/ui/breaknumberoption.ui      |   13 +++--
 cui/uiconfig/ui/optnewdictionarydialog.ui |   42 ++++++++++------
 include/svx/langbox.hxx                   |    1 
 include/svx/svxdlg.hxx                    |    2 
 9 files changed, 117 insertions(+), 130 deletions(-)

New commits:
commit 1595604169f7643cf134f71e218ea512887ed8a3
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Mar 30 21:24:28 2018 +0100

    weld SvxNewDictionaryDialog
    
    Change-Id: Idf9a4a74615b3216918dde50563e9d081c61cd52
    Reviewed-on: https://gerrit.libreoffice.org/52174
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx
index 6dc1f279693d..a3b1ced56c74 100644
--- a/cui/source/factory/dlgfact.cxx
+++ b/cui/source/factory/dlgfact.cxx
@@ -119,7 +119,11 @@ IMPL_ABSTDLG_BASE(AbstractSvxTransformTabDialog_Impl);
 IMPL_ABSTDLG_BASE(AbstractSvxCaptionDialog_Impl);
 IMPL_ABSTDLG_BASE(AbstractSvxJSearchOptionsDialog_Impl);
 IMPL_ABSTDLG_BASE(AbstractFmInputRecordNoDialog_Impl);
-IMPL_ABSTDLG_BASE(AbstractSvxNewDictionaryDialog_Impl);
+
+short AbstractSvxNewDictionaryDialog_Impl::Execute()
+{
+    return m_xDlg->run();
+}
 
 short AbstractSvxNameDialog_Impl::Execute()
 {
@@ -586,7 +590,7 @@ long AbstractFmInputRecordNoDialog_Impl::GetValue() const
 
 ::Reference< css::linguistic2::XDictionary > AbstractSvxNewDictionaryDialog_Impl::GetNewDictionary()
 {
-    return pDlg->GetNewDictionary();
+    return m_xDlg->GetNewDictionary();
 }
 
 void AbstractSvxNameDialog_Impl::GetName(OUString& rName)
@@ -1116,10 +1120,9 @@ VclPtr<AbstractFmInputRecordNoDialog> AbstractDialogFactory_Impl::CreateFmInputR
     return VclPtr<AbstractFmInputRecordNoDialog_Impl>::Create( pDlg );
 }
 
-VclPtr<AbstractSvxNewDictionaryDialog> AbstractDialogFactory_Impl::CreateSvxNewDictionaryDialog( vcl::Window* pParent )
+VclPtr<AbstractSvxNewDictionaryDialog> AbstractDialogFactory_Impl::CreateSvxNewDictionaryDialog(weld::Window* pParent)
 {
-    VclPtrInstance<SvxNewDictionaryDialog> pDlg( pParent );
-    return VclPtr<AbstractSvxNewDictionaryDialog_Impl>::Create( pDlg );
+    return VclPtr<AbstractSvxNewDictionaryDialog_Impl>::Create(new SvxNewDictionaryDialog(pParent));
 }
 
 VclPtr<VclAbstractDialog> AbstractDialogFactory_Impl::CreateSvxEditDictionaryDialog( vcl::Window* pParent,
diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx
index 25573f60a19e..2b36adee6204 100644
--- a/cui/source/factory/dlgfact.hxx
+++ b/cui/source/factory/dlgfact.hxx
@@ -300,7 +300,14 @@ class AbstractFmInputRecordNoDialog_Impl :public AbstractFmInputRecordNoDialog
 class SvxNewDictionaryDialog;
 class AbstractSvxNewDictionaryDialog_Impl :public AbstractSvxNewDictionaryDialog
 {
-    DECL_ABSTDLG_BASE(AbstractSvxNewDictionaryDialog_Impl,SvxNewDictionaryDialog)
+protected:
+    std::unique_ptr<SvxNewDictionaryDialog> m_xDlg;
+public:
+    explicit AbstractSvxNewDictionaryDialog_Impl(SvxNewDictionaryDialog* p)
+        : m_xDlg(p)
+    {
+    }
+    virtual short Execute() override;
     virtual css::uno::Reference< css::linguistic2::XDictionary >  GetNewDictionary() override;
 };
 
@@ -599,9 +606,8 @@ public:
                                                             const SfxItemSet& rOptionsSet,
                                                             TransliterationFlags nInitialFlags) override;
     virtual VclPtr<AbstractFmInputRecordNoDialog> CreateFmInputRecordNoDialog() override;
-    virtual VclPtr<AbstractSvxNewDictionaryDialog> CreateSvxNewDictionaryDialog( vcl::Window* pParent ) override;
-    virtual VclPtr<VclAbstractDialog>     CreateSvxEditDictionaryDialog( vcl::Window* pParent,
-                                            const OUString& rName) override;
+    virtual VclPtr<AbstractSvxNewDictionaryDialog> CreateSvxNewDictionaryDialog(weld::Window* pParent) override;
+    virtual VclPtr<VclAbstractDialog>     CreateSvxEditDictionaryDialog(vcl::Window* pParent, const OUString& rName) override;
     virtual VclPtr<AbstractSvxNameDialog> CreateSvxNameDialog(weld::Window* pParent,
                                             const OUString& rName, const OUString& rDesc) override;
     // #i68101#
diff --git a/cui/source/inc/optdict.hxx b/cui/source/inc/optdict.hxx
index e2dc53bf9e6e..e50accd43276 100644
--- a/cui/source/inc/optdict.hxx
+++ b/cui/source/inc/optdict.hxx
@@ -47,27 +47,22 @@ namespace linguistic2{
 
 // class SvxNewDictionaryDialog ------------------------------------------
 
-class SvxNewDictionaryDialog : public ModalDialog
+class SvxNewDictionaryDialog : public weld::GenericDialogController
 {
 private:
-    VclPtr<Edit>                pNameEdit;
-    VclPtr<SvxLanguageBox>      pLanguageLB;
-    VclPtr<CheckBox>            pExceptBtn;
-    VclPtr<OKButton>            pOKBtn;
-    css::uno::Reference<
-        css::linguistic2::XDictionary >    xNewDic;
+    std::unique_ptr<weld::Entry> m_xNameEdit;
+    std::unique_ptr<LanguageBox> m_xLanguageLB;
+    std::unique_ptr<weld::CheckButton> m_xExceptBtn;
+    std::unique_ptr<weld::Button> m_xOKBtn;
+    css::uno::Reference<css::linguistic2::XDictionary> m_xNewDic;
 
-    DECL_LINK(OKHdl_Impl, Button*, void);
-    DECL_LINK(ModifyHdl_Impl, Edit&, void);
+    DECL_LINK(OKHdl_Impl, weld::Button&, void);
+    DECL_LINK(ModifyHdl_Impl, weld::Entry&, void);
 
 public:
-    SvxNewDictionaryDialog( vcl::Window* pParent );
-    virtual ~SvxNewDictionaryDialog() override;
-    virtual void dispose() override;
+    SvxNewDictionaryDialog(weld::Window* pParent);
 
-    const css::uno::Reference<
-        css::linguistic2::XDictionary >&
-                GetNewDictionary() { return xNewDic; }
+    const css::uno::Reference<css::linguistic2::XDictionary>& GetNewDictionary() { return m_xNewDic; }
 };
 
 // class SvxDictEdit ----------------------------------------------------
diff --git a/cui/source/options/optdict.cxx b/cui/source/options/optdict.cxx
index 425583b4d2c1..c28f06399572 100644
--- a/cui/source/options/optdict.cxx
+++ b/cui/source/options/optdict.cxx
@@ -96,43 +96,27 @@ static CDE_RESULT cmpDicEntry_Impl( const OUString &rText1, const OUString &rTex
 
 // class SvxNewDictionaryDialog -------------------------------------------
 
-SvxNewDictionaryDialog::SvxNewDictionaryDialog( vcl::Window* pParent ) :
-    ModalDialog( pParent, "OptNewDictionaryDialog" , "cui/ui/optnewdictionarydialog.ui" )
+SvxNewDictionaryDialog::SvxNewDictionaryDialog(weld::Window* pParent)
+    : GenericDialogController(pParent, "cui/ui/optnewdictionarydialog.ui", "OptNewDictionaryDialog")
+    , m_xNameEdit(m_xBuilder->weld_entry("nameedit"))
+    , m_xLanguageLB(new LanguageBox(m_xBuilder->weld_combo_box_text("language")))
+    , m_xExceptBtn(m_xBuilder->weld_check_button("except"))
+    , m_xOKBtn(m_xBuilder->weld_button("ok"))
 {
-    get(pNameEdit,"nameedit");
-    get(pLanguageLB,"language");
-    get(pExceptBtn,"except");
-    get(pOKBtn,"ok");
     // install handler
-    pNameEdit->SetModifyHdl(
-        LINK( this, SvxNewDictionaryDialog, ModifyHdl_Impl ) );
-    pOKBtn->SetClickHdl( LINK( this, SvxNewDictionaryDialog, OKHdl_Impl ) );
+    m_xNameEdit->connect_changed(LINK(this, SvxNewDictionaryDialog, ModifyHdl_Impl));
+    m_xOKBtn->connect_clicked(LINK(this, SvxNewDictionaryDialog, OKHdl_Impl));
 
     // display languages
-    pLanguageLB->SetLanguageList( SvxLanguageListFlags::ALL, true, true );
-    pLanguageLB->SelectEntryPos(0);
+    m_xLanguageLB->SetLanguageList(SvxLanguageListFlags::ALL, true, true);
+    m_xLanguageLB->SelectEntryPos(0);
 }
 
-SvxNewDictionaryDialog::~SvxNewDictionaryDialog()
-{
-    disposeOnce();
-}
-
-void SvxNewDictionaryDialog::dispose()
-{
-    pNameEdit.clear();
-    pLanguageLB.clear();
-    pExceptBtn.clear();
-    pOKBtn.clear();
-    ModalDialog::dispose();
-}
-
-
-IMPL_LINK_NOARG(SvxNewDictionaryDialog, OKHdl_Impl, Button*, void)
+IMPL_LINK_NOARG(SvxNewDictionaryDialog, OKHdl_Impl, weld::Button&, void)
 {
 
   // add extension for personal dictionaries
-    OUString sDict = comphelper::string::stripEnd(pNameEdit->GetText(), ' ') + ".dic";
+    OUString sDict = comphelper::string::stripEnd(m_xNameEdit->get_text(), ' ') + ".dic";
 
     Reference< XSearchableDictionaryList >  xDicList( LinguMgr::GetDictionaryList() );
 
@@ -151,61 +135,56 @@ IMPL_LINK_NOARG(SvxNewDictionaryDialog, OKHdl_Impl, Button*, void)
     if ( bFound )
     {
         // duplicate names?
-        std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(GetFrameWeld(),
+        std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(m_xDialog.get(),
                                                       VclMessageType::Info, VclButtonsType::Ok,
                                                       CuiResId(RID_SVXSTR_OPT_DOUBLE_DICTS)));
         xInfoBox->run();
-        pNameEdit->GrabFocus();
+        m_xNameEdit->grab_focus();
         return;
     }
 
     // create and add
-    LanguageType nLang = pLanguageLB->GetSelectedLanguage();
+    LanguageType nLang = m_xLanguageLB->GetSelectedLanguage();
     try
     {
         // create new dictionary
-        DictionaryType eType = pExceptBtn->IsChecked() ?
+        DictionaryType eType = m_xExceptBtn->get_active() ?
                 DictionaryType_NEGATIVE : DictionaryType_POSITIVE;
         if (xDicList.is())
         {
             lang::Locale aLocale( LanguageTag::convertToLocale(nLang) );
             OUString aURL( linguistic::GetWritableDictionaryURL( sDict ) );
-            xNewDic.set( xDicList->createDictionary( sDict, aLocale, eType, aURL ) , UNO_QUERY );
-            xNewDic->setActive( true );
+            m_xNewDic.set(xDicList->createDictionary(sDict, aLocale, eType, aURL) , UNO_QUERY);
+            m_xNewDic->setActive(true);
         }
-        DBG_ASSERT(xNewDic.is(), "NULL pointer");
+        DBG_ASSERT(m_xNewDic.is(), "NULL pointer");
     }
     catch(...)
     {
-        xNewDic = nullptr;
+        m_xNewDic = nullptr;
         // error: couldn't create new dictionary
         SfxErrorContext aContext( ERRCTX_SVX_LINGU_DICTIONARY, OUString(),
-            GetFrameWeld(), RID_SVXERRCTX, SvxResLocale() );
+            m_xDialog.get(), RID_SVXERRCTX, SvxResLocale() );
         ErrorHandler::HandleError( *new StringErrorInfo(
                 ERRCODE_SVX_LINGU_DICT_NOTWRITEABLE, sDict ) );
-        EndDialog();
+        m_xDialog->response(RET_CANCEL);
     }
 
-    if (xDicList.is() && xNewDic.is())
+    if (xDicList.is() && m_xNewDic.is())
     {
-        xDicList->addDictionary( Reference< XDictionary > ( xNewDic, UNO_QUERY ) );
+        xDicList->addDictionary(Reference<XDictionary>(m_xNewDic, UNO_QUERY));
 
         // refresh list of dictionaries
         //! dictionaries may have been added/removed elsewhere too.
         aDics = xDicList->getDictionaries();
     }
 
-
-    EndDialog( RET_OK );
+    m_xDialog->response(RET_OK);
 }
 
-
-IMPL_LINK_NOARG(SvxNewDictionaryDialog, ModifyHdl_Impl, Edit&, void)
+IMPL_LINK_NOARG(SvxNewDictionaryDialog, ModifyHdl_Impl, weld::Entry&, void)
 {
-    if ( !pNameEdit->GetText().isEmpty() )
-        pOKBtn->Enable();
-    else
-        pOKBtn->Disable();
+    m_xOKBtn->set_sensitive(!m_xNameEdit->get_text().isEmpty());
 }
 
 // class SvxEditDictionaryDialog -------------------------------------------
diff --git a/cui/source/options/optlingu.cxx b/cui/source/options/optlingu.cxx
index 6d04a6f4d435..239546732acf 100644
--- a/cui/source/options/optlingu.cxx
+++ b/cui/source/options/optlingu.cxx
@@ -1493,7 +1493,7 @@ IMPL_LINK( SvxLinguTabPage, ClickHdl_Impl, Button *, pBtn, void )
         SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
         if(pFact)
         {
-            ScopedVclPtr<AbstractSvxNewDictionaryDialog> aDlg(pFact->CreateSvxNewDictionaryDialog( this ));
+            ScopedVclPtr<AbstractSvxNewDictionaryDialog> aDlg(pFact->CreateSvxNewDictionaryDialog(GetFrameWeld()));
             DBG_ASSERT(aDlg, "Dialog creation failed!");
             uno::Reference< XDictionary >  xNewDic;
             if ( aDlg->Execute() == RET_OK )
diff --git a/cui/uiconfig/ui/optnewdictionarydialog.ui b/cui/uiconfig/ui/optnewdictionarydialog.ui
index 06296da93006..1ba69e74af8d 100644
--- a/cui/uiconfig/ui/optnewdictionarydialog.ui
+++ b/cui/uiconfig/ui/optnewdictionarydialog.ui
@@ -1,12 +1,14 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.18.3 -->
+<!-- Generated with glade 3.20.4 -->
 <interface domain="cui">
   <requires lib="gtk+" version="3.18"/>
-  <requires lib="LibreOffice" version="1.0"/>
   <object class="GtkDialog" id="OptNewDictionaryDialog">
     <property name="can_focus">False</property>
     <property name="border_width">6</property>
     <property name="title" translatable="yes" context="optnewdictionarydialog|OptNewDictionaryDialog">New Dictionary</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 internal-child="vbox">
       <object class="GtkBox" id="dialog-vbox1">
@@ -95,7 +97,7 @@
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
                         <property name="max_length">32</property>
-                        <property name="invisible_char">●</property>
+                        <property name="activates_default">True</property>
                         <property name="width_chars">32</property>
                       </object>
                       <packing>
@@ -104,23 +106,13 @@
                       </packing>
                     </child>
                     <child>
-                      <object class="svxcorelo-SvxLanguageBox" id="language">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                      </object>
-                      <packing>
-                        <property name="left_attach">1</property>
-                        <property name="top_attach">1</property>
-                      </packing>
-                    </child>
-                    <child>
                       <object class="GtkLabel" id="name_label">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
-                        <property name="xalign">0</property>
                         <property name="label" translatable="yes" context="optnewdictionarydialog|name_label">_Name:</property>
                         <property name="use_underline">True</property>
                         <property name="mnemonic_widget">nameedit</property>
+                        <property name="xalign">0</property>
                       </object>
                       <packing>
                         <property name="left_attach">0</property>
@@ -131,10 +123,10 @@
                       <object class="GtkLabel" id="language_label">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
-                        <property name="xalign">0</property>
                         <property name="label" translatable="yes" context="optnewdictionarydialog|language_label">_Language:</property>
                         <property name="use_underline">True</property>
                         <property name="mnemonic_widget">language</property>
+                        <property name="xalign">0</property>
                       </object>
                       <packing>
                         <property name="left_attach">0</property>
@@ -157,6 +149,23 @@
                         <property name="width">2</property>
                       </packing>
                     </child>
+                    <child>
+                      <object class="GtkComboBoxText" id="language">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="has_entry">True</property>
+                        <child internal-child="entry">
+                          <object class="GtkEntry">
+                            <property name="can_focus">True</property>
+                            <property name="activates_default">True</property>
+                          </object>
+                        </child>
+                      </object>
+                      <packing>
+                        <property name="left_attach">1</property>
+                        <property name="top_attach">1</property>
+                      </packing>
+                    </child>
                   </object>
                 </child>
               </object>
@@ -185,5 +194,8 @@
       <action-widget response="-6">cancel</action-widget>
       <action-widget response="-11">help</action-widget>
     </action-widgets>
+    <child>
+      <placeholder/>
+    </child>
   </object>
 </interface>
diff --git a/include/svx/langbox.hxx b/include/svx/langbox.hxx
index 00aaaa58a904..45c852fd3cbd 100644
--- a/include/svx/langbox.hxx
+++ b/include/svx/langbox.hxx
@@ -167,6 +167,7 @@ public:
     void            AddLanguages( const std::vector< LanguageType >& rLanguageTypes, SvxLanguageListFlags nLangList );
     void            SelectLanguage( const LanguageType eLangType );
     LanguageType    GetSelectedLanguage() const;
+    void            SelectEntryPos(int nPos) { m_xControl->set_active(nPos); }
 
     void connect_changed(const Link<weld::ComboBoxText&, void>& rLink) { m_aChangeHdl = rLink; }
 };
diff --git a/include/svx/svxdlg.hxx b/include/svx/svxdlg.hxx
index f2f817241b38..6f3b7097a4e5 100644
--- a/include/svx/svxdlg.hxx
+++ b/include/svx/svxdlg.hxx
@@ -394,7 +394,7 @@ public:
                                                             const SfxItemSet& rOptionsSet,
                                                             TransliterationFlags nInitialFlags )=0;
     virtual VclPtr<AbstractFmInputRecordNoDialog> CreateFmInputRecordNoDialog() = 0;
-    virtual VclPtr<AbstractSvxNewDictionaryDialog> CreateSvxNewDictionaryDialog( vcl::Window* pParent ) = 0;
+    virtual VclPtr<AbstractSvxNewDictionaryDialog> CreateSvxNewDictionaryDialog(weld::Window* pParent) = 0;
     virtual VclPtr<VclAbstractDialog>     CreateSvxEditDictionaryDialog( vcl::Window* pParent,
                                             const OUString& rName) = 0;
     virtual VclPtr<AbstractSvxNameDialog> CreateSvxNameDialog(weld::Window* pParent,
commit c8af8aebd1336e919e9531e39f84296085d91ea7
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Mar 30 17:21:49 2018 +0100

    weld OptionsBreakSet
    
    Change-Id: I2f0f25b3573dabc940a117bb1cb5d3b56a81af0f
    Reviewed-on: https://gerrit.libreoffice.org/52159
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/cui/source/options/optlingu.cxx b/cui/source/options/optlingu.cxx
index 1b4e70de8f7a..6d04a6f4d435 100644
--- a/cui/source/options/optlingu.cxx
+++ b/cui/source/options/optlingu.cxx
@@ -292,56 +292,42 @@ static inline OUString lcl_GetPropertyName( EID_OPTIONS eEntryId )
     return OUString::createFromAscii( aEidToPropName[ static_cast<int>(eEntryId) ] );
 }
 
-class OptionsBreakSet : public ModalDialog
+class OptionsBreakSet : public weld::GenericDialogController
 {
-    VclPtr<VclFrame>       m_pBeforeFrame;
-    VclPtr<VclFrame>       m_pAfterFrame;
-    VclPtr<VclFrame>       m_pMinimalFrame;
-    VclPtr<NumericField>   m_pBreakNF;
+    std::unique_ptr<weld::Widget> m_xBeforeFrame;
+    std::unique_ptr<weld::Widget> m_xAfterFrame;
+    std::unique_ptr<weld::Widget> m_xMinimalFrame;
+    std::unique_ptr<weld::SpinButton> m_xBreakNF;
 
 public:
-    OptionsBreakSet(vcl::Window* pParent, sal_uInt16 nRID)
-        : ModalDialog(pParent, "BreakNumberOption",
-            "cui/ui/breaknumberoption.ui")
-        , m_pBreakNF(nullptr)
+    OptionsBreakSet(weld::Window* pParent, sal_uInt16 nRID)
+        : GenericDialogController(pParent, "cui/ui/breaknumberoption.ui", "BreakNumberOption")
+        , m_xBeforeFrame(m_xBuilder->weld_widget("beforeframe"))
+        , m_xAfterFrame(m_xBuilder->weld_widget("afterframe"))
+        , m_xMinimalFrame(m_xBuilder->weld_widget("miniframe"))
     {
-        get(m_pBeforeFrame, "beforeframe");
-        get(m_pAfterFrame, "afterframe");
-        get(m_pMinimalFrame, "miniframe");
-
-        assert(EID_NUM_PRE_BREAK == nRID ||
-               EID_NUM_POST_BREAK == nRID ||
-               EID_NUM_MIN_WORDLEN == nRID); //unexpected ID
+        assert(EID_NUM_PRE_BREAK == nRID || EID_NUM_POST_BREAK == nRID || EID_NUM_MIN_WORDLEN == nRID); //unexpected ID
 
         if (nRID == EID_NUM_PRE_BREAK)
         {
-            m_pBeforeFrame->Show();
-            get(m_pBreakNF, "beforebreak");
+            m_xBeforeFrame->show();
+            m_xBreakNF.reset(m_xBuilder->weld_spin_button("beforebreak"));
         }
         else if(nRID == EID_NUM_POST_BREAK)
         {
-            m_pAfterFrame->Show();
-            get(m_pBreakNF, "afterbreak");
+            m_xAfterFrame->show();
+            m_xBreakNF.reset(m_xBuilder->weld_spin_button("afterbreak"));
         }
         else if(nRID == EID_NUM_MIN_WORDLEN)
         {
-            m_pMinimalFrame->Show();
-            get(m_pBreakNF, "wordlength");
+            m_xMinimalFrame->show();
+            m_xBreakNF.reset(m_xBuilder->weld_spin_button("wordlength"));
         }
     }
-    virtual ~OptionsBreakSet() override { disposeOnce(); }
-    virtual void dispose() override
-    {
-        m_pBeforeFrame.clear();
-        m_pAfterFrame.clear();
-        m_pMinimalFrame.clear();
-        m_pBreakNF.clear();
-        ModalDialog::dispose();
-    }
 
-    NumericField&   GetNumericFld()
+    weld::SpinButton& GetNumericFld()
     {
-        return *m_pBreakNF;
+        return *m_xBreakNF;
     }
 };
 
@@ -1623,11 +1609,11 @@ IMPL_LINK( SvxLinguTabPage, ClickHdl_Impl, Button *, pBtn, void )
             if(aData.HasNumericValue())
             {
                 sal_uInt16 nRID = aData.GetEntryId();
-                ScopedVclPtrInstance< OptionsBreakSet > aDlg(this, nRID);
-                aDlg->GetNumericFld().SetValue( aData.GetNumericValue() );
-                if (RET_OK == aDlg->Execute() )
+                OptionsBreakSet aDlg(GetFrameWeld(), nRID);
+                aDlg.GetNumericFld().set_value(aData.GetNumericValue());
+                if (RET_OK == aDlg.run())
                 {
-                    long nVal = static_cast<long>(aDlg->GetNumericFld().GetValue());
+                    long nVal = static_cast<long>(aDlg.GetNumericFld().get_value());
                     if (-1 != nVal && aData.GetNumericValue() != nVal)
                     {
                         aData.SetNumericValue( static_cast<sal_uInt8>(nVal) ); //! sets IsModified !
diff --git a/cui/uiconfig/ui/breaknumberoption.ui b/cui/uiconfig/ui/breaknumberoption.ui
index ab99479e0983..0f60f687762d 100644
--- a/cui/uiconfig/ui/breaknumberoption.ui
+++ b/cui/uiconfig/ui/breaknumberoption.ui
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.18.3 -->
+<!-- Generated with glade 3.20.4 -->
 <interface domain="cui">
   <requires lib="gtk+" version="3.18"/>
   <object class="GtkAdjustment" id="adjustment1">
@@ -14,6 +14,8 @@
     <property name="border_width">6</property>
     <property name="title" translatable="yes" context="breaknumberoption|BreakNumberOption">Hyphenation</property>
     <property name="resizable">False</property>
+    <property name="default_width">0</property>
+    <property name="default_height">0</property>
     <property name="type_hint">dialog</property>
     <child internal-child="vbox">
       <object class="GtkBox" id="dialog-vbox1">
@@ -84,7 +86,7 @@
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
                         <property name="halign">start</property>
-                        <property name="invisible_char">•</property>
+                        <property name="activates_default">True</property>
                         <property name="adjustment">adjustment1</property>
                       </object>
                     </child>
@@ -123,7 +125,7 @@
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
                         <property name="halign">start</property>
-                        <property name="invisible_char">•</property>
+                        <property name="activates_default">True</property>
                         <property name="adjustment">adjustment1</property>
                       </object>
                     </child>
@@ -162,7 +164,7 @@
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
                         <property name="halign">start</property>
-                        <property name="invisible_char">•</property>
+                        <property name="activates_default">True</property>
                         <property name="adjustment">adjustment1</property>
                       </object>
                     </child>
@@ -197,5 +199,8 @@
       <action-widget response="-5">ok</action-widget>
       <action-widget response="-6">cancel</action-widget>
     </action-widgets>
+    <child>
+      <placeholder/>
+    </child>
   </object>
 </interface>


More information about the Libreoffice-commits mailing list