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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Sat Sep 29 15:28:32 UTC 2018


 cui/source/dialogs/cuifmsearch.cxx |    2 +-
 cui/source/factory/dlgfact.cxx     |   12 +++++++-----
 cui/source/factory/dlgfact.hxx     |   17 ++++++++++++-----
 cui/source/inc/cuisrchdlg.hxx      |   11 +++--------
 cui/source/options/cuisrchdlg.cxx  |   35 +++++++++++------------------------
 include/svx/svxdlg.hxx             |    6 +++---
 svx/source/dialog/srchdlg.cxx      |    2 +-
 7 files changed, 38 insertions(+), 47 deletions(-)

New commits:
commit 281a44a61b692f85007412d0b460284fc228b751
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Fri Sep 28 18:21:58 2018 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Sat Sep 29 17:28:11 2018 +0200

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

diff --git a/cui/source/dialogs/cuifmsearch.cxx b/cui/source/dialogs/cuifmsearch.cxx
index 103e3c599e94..2f3c9af13d13 100644
--- a/cui/source/dialogs/cuifmsearch.cxx
+++ b/cui/source/dialogs/cuifmsearch.cxx
@@ -370,7 +370,7 @@ IMPL_LINK(FmSearchDialog, OnClickedSpecialSettings, Button*, pButton, void )
     {
         SfxItemSet aSet( SfxGetpApp()->GetPool() );
         SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
-        ScopedVclPtr<AbstractSvxJSearchOptionsDialog> aDlg(pFact->CreateSvxJSearchOptionsDialog( this, aSet, m_pSearchEngine->GetTransliterationFlags() ));
+        ScopedVclPtr<AbstractSvxJSearchOptionsDialog> aDlg(pFact->CreateSvxJSearchOptionsDialog(GetFrameWeld(), aSet, m_pSearchEngine->GetTransliterationFlags() ));
         aDlg->Execute();
 
         TransliterationFlags nFlags = aDlg->GetTransliterationFlags();
diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx
index 125e5cd73d89..0c024e2f8079 100644
--- a/cui/source/factory/dlgfact.cxx
+++ b/cui/source/factory/dlgfact.cxx
@@ -167,7 +167,10 @@ bool AbstractSvxCaptionDialog_Impl::StartExecuteAsync(AsyncContext &rCtx)
     return SfxTabDialogController::runAsync(m_xDlg, rCtx.maEndDialogFn);
 }
 
-IMPL_ABSTDLG_BASE(AbstractSvxJSearchOptionsDialog_Impl);
+short AbstractSvxJSearchOptionsDialog_Impl::Execute()
+{
+    return m_xDlg->run();
+}
 
 short AbstractFmInputRecordNoDialog_Impl::Execute()
 {
@@ -692,7 +695,7 @@ void AbstractSvxCaptionDialog_Impl::SetValidateFramePosLink( const Link<SvxSwFra
 
 TransliterationFlags AbstractSvxJSearchOptionsDialog_Impl::GetTransliterationFlags() const
 {
-    return pDlg->GetTransliterationFlags();
+    return m_xDlg->GetTransliterationFlags();
 }
 
 void AbstractFmInputRecordNoDialog_Impl::SetValue(long nNew)
@@ -1221,12 +1224,11 @@ VclPtr<SfxAbstractTabDialog> AbstractDialogFactory_Impl::CreateSchTransformTabDi
     return VclPtr<CuiAbstractTabController_Impl>::Create(std::move(pDlg));
 }
 
-VclPtr<AbstractSvxJSearchOptionsDialog> AbstractDialogFactory_Impl::CreateSvxJSearchOptionsDialog( vcl::Window* pParent,
+VclPtr<AbstractSvxJSearchOptionsDialog> AbstractDialogFactory_Impl::CreateSvxJSearchOptionsDialog(weld::Window* pParent,
                                                             const SfxItemSet& rOptionsSet,
                                                             TransliterationFlags nInitialFlags)
 {
-    VclPtrInstance<SvxJSearchOptionsDialog> pDlg( pParent, rOptionsSet, nInitialFlags );
-    return VclPtr<AbstractSvxJSearchOptionsDialog_Impl>::Create( pDlg );
+    return VclPtr<AbstractSvxJSearchOptionsDialog_Impl>::Create(o3tl::make_unique<SvxJSearchOptionsDialog>(pParent, rOptionsSet, nInitialFlags));
 }
 
 VclPtr<AbstractFmInputRecordNoDialog> AbstractDialogFactory_Impl::CreateFmInputRecordNoDialog(weld::Window* pParent)
diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx
index 2316ff7be199..505ff1481b96 100644
--- a/cui/source/factory/dlgfact.hxx
+++ b/cui/source/factory/dlgfact.hxx
@@ -327,9 +327,16 @@ public:
 };
 
 class SvxJSearchOptionsDialog;
-class AbstractSvxJSearchOptionsDialog_Impl :public AbstractSvxJSearchOptionsDialog
+class AbstractSvxJSearchOptionsDialog_Impl : public AbstractSvxJSearchOptionsDialog
 {
-    DECL_ABSTDLG_BASE(AbstractSvxJSearchOptionsDialog_Impl,SvxJSearchOptionsDialog)
+protected:
+    std::unique_ptr<SvxJSearchOptionsDialog> m_xDlg;
+public:
+    explicit AbstractSvxJSearchOptionsDialog_Impl(std::unique_ptr<SvxJSearchOptionsDialog> p)
+        : m_xDlg(std::move(p))
+    {
+    }
+    virtual short Execute() override;
     virtual TransliterationFlags    GetTransliterationFlags() const override;
 };
 
@@ -757,9 +764,9 @@ public:
                                                             sal_uInt16 nOther,
                                                             sal_uInt16 nShorter,
                                                             sal_uInt16 nLonger) override;
-    virtual VclPtr<AbstractSvxJSearchOptionsDialog> CreateSvxJSearchOptionsDialog( vcl::Window* pParent,
-                                                            const SfxItemSet& rOptionsSet,
-                                                            TransliterationFlags nInitialFlags) override;
+    virtual VclPtr<AbstractSvxJSearchOptionsDialog> CreateSvxJSearchOptionsDialog(weld::Window* pParent,
+                                                                                  const SfxItemSet& rOptionsSet,
+                                                                                  TransliterationFlags nInitialFlags) override;
     virtual VclPtr<AbstractFmInputRecordNoDialog> CreateFmInputRecordNoDialog(weld::Window* pParent) override;
     virtual VclPtr<AbstractSvxNewDictionaryDialog> CreateSvxNewDictionaryDialog(weld::Window* pParent) override;
     virtual VclPtr<VclAbstractDialog>     CreateSvxEditDictionaryDialog(vcl::Window* pParent, const OUString& rName) override;
diff --git a/cui/source/inc/cuisrchdlg.hxx b/cui/source/inc/cuisrchdlg.hxx
index 8edf7623fa0e..146708567729 100644
--- a/cui/source/inc/cuisrchdlg.hxx
+++ b/cui/source/inc/cuisrchdlg.hxx
@@ -33,22 +33,17 @@
 
 class SvxJSearchOptionsPage;
 
-class SvxJSearchOptionsDialog : public SfxSingleTabDialog
+class SvxJSearchOptionsDialog : public SfxSingleTabDialogController
 {
-    TransliterationFlags          nInitialTlFlags;
-    VclPtr<SvxJSearchOptionsPage> pPage;
+    VclPtr<SvxJSearchOptionsPage> m_xPage;
 
     SvxJSearchOptionsDialog( const SvxJSearchOptionsDialog & ) = delete;
     SvxJSearchOptionsDialog & operator == ( const SvxJSearchOptionsDialog & ) = delete;
 
 public:
-    SvxJSearchOptionsDialog(vcl::Window *pParent,
+    SvxJSearchOptionsDialog(weld::Window *pParent,
         const SfxItemSet& rOptionsSet, TransliterationFlags nInitialFlags);
     virtual ~SvxJSearchOptionsDialog() override;
-    virtual void dispose() override;
-
-    // Window
-    virtual void    Activate() override;
 
     TransliterationFlags  GetTransliterationFlags() const;
 };
diff --git a/cui/source/options/cuisrchdlg.cxx b/cui/source/options/cuisrchdlg.cxx
index c8965ba7a7da..6b030bd70d0e 100644
--- a/cui/source/options/cuisrchdlg.cxx
+++ b/cui/source/options/cuisrchdlg.cxx
@@ -17,8 +17,6 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#include <vcl/wrkwin.hxx>
-#include <vcl/morebtn.hxx>
 #include <svl/slstitm.hxx>
 #include <svl/itemiter.hxx>
 #include <svl/style.hxx>
@@ -42,40 +40,29 @@
 
 // class SvxJSearchOptionsDialog -----------------------------------------
 
-SvxJSearchOptionsDialog::SvxJSearchOptionsDialog(vcl::Window *pParent,
+SvxJSearchOptionsDialog::SvxJSearchOptionsDialog(weld::Window *pParent,
     const SfxItemSet& rOptionsSet, TransliterationFlags nInitialFlags)
-    : SfxSingleTabDialog(pParent, rOptionsSet)
-    , nInitialTlFlags( nInitialFlags )
+    : SfxSingleTabDialogController(pParent, rOptionsSet)
 {
-    // pPage will be implicitly destroyed by the
+    // m_xPage will be implicitly destroyed by the
     // SfxSingleTabDialog destructor
-    pPage.reset( static_cast<SvxJSearchOptionsPage *>(
+    TabPageParent pPageParent(get_content_area(), this);
+    m_xPage.reset(static_cast<SvxJSearchOptionsPage*>(
                         SvxJSearchOptionsPage::Create(
-                                get_content_area(), &rOptionsSet ).get() ) );
-    SetTabPage( pPage );    //! implicitly calls pPage->Reset(...)!
-    pPage->EnableSaveOptions(false);
+                                pPageParent, &rOptionsSet).get()));
+    SetTabPage(m_xPage); //! implicitly calls m_xPage->Reset(...)!
+    m_xPage->EnableSaveOptions(false);
+    m_xPage->SetTransliterationFlags(nInitialFlags);
 }
 
 SvxJSearchOptionsDialog::~SvxJSearchOptionsDialog()
 {
-    disposeOnce();
-}
-
-void SvxJSearchOptionsDialog::dispose()
-{
-    pPage.clear();
-    SfxSingleTabDialog::dispose();
-}
-
-void SvxJSearchOptionsDialog::Activate()
-{
-    pPage->SetTransliterationFlags( nInitialTlFlags );
+    m_xPage.clear();
 }
 
 TransliterationFlags SvxJSearchOptionsDialog::GetTransliterationFlags() const
 {
-    return pPage->GetTransliterationFlags();
+    return m_xPage->GetTransliterationFlags();
 }
 
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/svxdlg.hxx b/include/svx/svxdlg.hxx
index 1c8ae7b1eeb2..92e57de3bea4 100644
--- a/include/svx/svxdlg.hxx
+++ b/include/svx/svxdlg.hxx
@@ -390,9 +390,9 @@ public:
                                                                      const SfxItemSet* pAttr,
                                                                      const SdrView* pSdrView,
                                                                      bool bSizeTabPage) = 0;
-    virtual VclPtr<AbstractSvxJSearchOptionsDialog> CreateSvxJSearchOptionsDialog( vcl::Window* pParent,
-                                                            const SfxItemSet& rOptionsSet,
-                                                            TransliterationFlags nInitialFlags )=0;
+    virtual VclPtr<AbstractSvxJSearchOptionsDialog> CreateSvxJSearchOptionsDialog(weld::Window* pParent,
+                                                                                  const SfxItemSet& rOptionsSet,
+                                                                                  TransliterationFlags nInitialFlags) = 0;
     virtual VclPtr<AbstractFmInputRecordNoDialog> CreateFmInputRecordNoDialog(weld::Window* pParent) = 0;
     virtual VclPtr<AbstractSvxNewDictionaryDialog> CreateSvxNewDictionaryDialog(weld::Window* pParent) = 0;
     virtual VclPtr<VclAbstractDialog>     CreateSvxEditDictionaryDialog( vcl::Window* pParent,
diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx
index eabfacde7d79..7f8595cf80ed 100644
--- a/svx/source/dialog/srchdlg.cxx
+++ b/svx/source/dialog/srchdlg.cxx
@@ -1426,7 +1426,7 @@ IMPL_LINK( SvxSearchDialog, CommandHdl_Impl, Button *, pBtn, void )
         SfxItemSet aSet( SfxGetpApp()->GetPool() );
         pSearchItem->SetTransliterationFlags( GetTransliterationFlags() );
         SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
-        ScopedVclPtr<AbstractSvxJSearchOptionsDialog> aDlg(pFact->CreateSvxJSearchOptionsDialog( this, aSet,
+        ScopedVclPtr<AbstractSvxJSearchOptionsDialog> aDlg(pFact->CreateSvxJSearchOptionsDialog(GetFrameWeld(), aSet,
                 pSearchItem->GetTransliterationFlags() ));
         int nRet = aDlg->Execute();
         if (RET_OK == nRet) //! true only if FillItemSet of SvxJSearchOptionsPage returns true


More information about the Libreoffice-commits mailing list