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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Sun Nov 25 14:40:37 UTC 2018


 cui/source/dialogs/hltpbase.cxx   |    8 ++++----
 cui/source/factory/dlgfact.cxx    |    9 ++++-----
 cui/source/factory/dlgfact.hxx    |    7 +++----
 cui/source/inc/macroass.hxx       |   13 ++++++++-----
 cui/source/tabpages/macroass.cxx  |   34 ++++++++++++----------------------
 include/sfx2/basedlgs.hxx         |    2 +-
 include/svx/svxdlg.hxx            |    5 ++---
 sc/source/ui/drawfunc/drawsh.cxx  |    4 ++--
 sc/source/ui/inc/drawsh.hxx       |    2 +-
 svx/source/dialog/imapwnd.cxx     |    2 +-
 sw/source/ui/chrdlg/chardlg.cxx   |    2 +-
 sw/source/ui/dialog/macassgn.cxx  |    6 +++---
 sw/source/ui/misc/glossary.cxx    |    2 +-
 sw/source/uibase/inc/macassgn.hxx |    4 ++--
 14 files changed, 45 insertions(+), 55 deletions(-)

New commits:
commit 3dacf98b70088e6435fb46c3e225bea35a451028
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Sat Nov 24 15:09:10 2018 +0000
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Sun Nov 25 15:40:15 2018 +0100

    weld SfxMacroAssignDlg
    
    Change-Id: I80045f1d1ca189fc490dc88b3471d68782df6f1c
    Reviewed-on: https://gerrit.libreoffice.org/63976
    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/hltpbase.cxx b/cui/source/dialogs/hltpbase.cxx
index f01447069da7..38402c8af924 100644
--- a/cui/source/dialogs/hltpbase.cxx
+++ b/cui/source/dialogs/hltpbase.cxx
@@ -336,10 +336,10 @@ IMPL_LINK_NOARG(SvxHyperlinkTabPageBase, ClickScriptHdl_Impl, Button*, void)
         bool bIsInputEnabled = GetParent()->IsInputEnabled();
         if ( bIsInputEnabled )
             GetParent()->EnableInput( false );
-        ScopedVclPtrInstance< SfxMacroAssignDlg > aDlg( this, mxDocumentFrame, *pItemSet );
+        SfxMacroAssignDlg aDlg(GetFrameWeld(), mxDocumentFrame, *pItemSet);
 
         // add events
-        SfxMacroTabPage *pMacroPage = static_cast<SfxMacroTabPage*>( aDlg->GetTabPage() );
+        SfxMacroTabPage *pMacroPage = aDlg.GetTabPage();
 
         if ( pHyperlinkItem->GetMacroEvents() & HyperDialogEvent::MouseOverObject )
             pMacroPage->AddEvent( CuiResId(RID_SVXSTR_HYPDLG_MACROACT1),
@@ -355,11 +355,11 @@ IMPL_LINK_NOARG(SvxHyperlinkTabPageBase, ClickScriptHdl_Impl, Button*, void)
             GetParent()->EnableInput();
         // execute dlg
         DisableClose( true );
-        short nRet = aDlg->Execute();
+        short nRet = aDlg.run();
         DisableClose( false );
         if ( RET_OK == nRet )
         {
-            const SfxItemSet* pOutSet = aDlg->GetOutputItemSet();
+            const SfxItemSet* pOutSet = aDlg.GetOutputItemSet();
             const SfxPoolItem* pItem;
             if( SfxItemState::SET == pOutSet->GetItemState( SID_ATTR_MACROITEM, false, &pItem ))
             {
diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx
index ff95f66b2574..f2f09863a5c4 100644
--- a/cui/source/factory/dlgfact.cxx
+++ b/cui/source/factory/dlgfact.cxx
@@ -1318,12 +1318,11 @@ VclPtr<SfxAbstractDialog> AbstractDialogFactory_Impl::CreateCharMapDialog(weld::
     return VclPtr<AbstractSvxCharacterMapDialog_Impl>::Create(o3tl::make_unique<SvxCharacterMap>(pParent, &rAttr, bInsert));
 }
 
-VclPtr<SfxAbstractDialog> AbstractDialogFactory_Impl::CreateEventConfigDialog( vcl::Window* pParent,
-                                                                        const SfxItemSet& rAttr,
-                                                                        const Reference< XFrame >& _rxDocumentFrame)
+VclPtr<SfxAbstractDialog> AbstractDialogFactory_Impl::CreateEventConfigDialog(weld::Window* pParent,
+                                                                              const SfxItemSet& rAttr,
+                                                                              const Reference< XFrame >& _rxDocumentFrame)
 {
-    SfxModalDialog* pDlg = VclPtr<SfxMacroAssignDlg>::Create(pParent, _rxDocumentFrame, rAttr);
-    return VclPtr<CuiAbstractSfxDialog_Impl>::Create(pDlg);
+    return VclPtr<CuiAbstractController_Impl>::Create(o3tl::make_unique<SfxMacroAssignDlg>(pParent, _rxDocumentFrame, rAttr));
 }
 
 VclPtr<SfxAbstractDialog> AbstractDialogFactory_Impl::CreateSfxDialog(vcl::Window* pParent,
diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx
index a662aa09ee07..0b1436f3c4d7 100644
--- a/cui/source/factory/dlgfact.hxx
+++ b/cui/source/factory/dlgfact.hxx
@@ -677,10 +677,9 @@ public:
     virtual VclPtr<SfxAbstractDialog>    CreateCharMapDialog(weld::Window* pParent,
                                                              const SfxItemSet& rAttr,
                                                              bool bInsert) override;
-    virtual VclPtr<SfxAbstractDialog>    CreateEventConfigDialog( vcl::Window* pParent,
-                                                             const SfxItemSet& rAttr,
-                                                             const css::uno::Reference< css::frame::XFrame >& _rxFrame
-                                                             ) override;
+    virtual VclPtr<SfxAbstractDialog>    CreateEventConfigDialog(weld::Window* pParent,
+                                                                 const SfxItemSet& rAttr,
+                                                                 const css::uno::Reference< css::frame::XFrame >& _rxFrame) override;
     virtual VclPtr<VclAbstractDialog>    CreateFrameDialog(vcl::Window* pParent, const css::uno::Reference< css::frame::XFrame >& rxFrame,
                                                            sal_uInt32 nResId,
                                                            const OUString& rParameter ) override;
diff --git a/cui/source/inc/macroass.hxx b/cui/source/inc/macroass.hxx
index 3a7231b374e7..7f233847fee7 100644
--- a/cui/source/inc/macroass.hxx
+++ b/cui/source/inc/macroass.hxx
@@ -79,13 +79,16 @@ public:
     static VclPtr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rAttrSet );
 };
 
-class SfxMacroAssignDlg : public SfxSingleTabDialog
+class SfxMacroAssignDlg : public SfxSingleTabDialogController
 {
 public:
-    SfxMacroAssignDlg(
-        vcl::Window* pParent,
-        const css::uno::Reference< css::frame::XFrame >& rxDocumentFrame,
-        const SfxItemSet& rSet );
+    SfxMacroAssignDlg(weld::Window* pParent,
+                      const css::uno::Reference< css::frame::XFrame >& rxDocumentFrame,
+                      const SfxItemSet& rSet);
+    SfxMacroTabPage* GetTabPage()
+    {
+        return static_cast<SfxMacroTabPage*>(m_xSfxPage.get());
+    }
 };
 
 #endif
diff --git a/cui/source/tabpages/macroass.cxx b/cui/source/tabpages/macroass.cxx
index 4788ccc404cf..75176ba85e30 100644
--- a/cui/source/tabpages/macroass.cxx
+++ b/cui/source/tabpages/macroass.cxx
@@ -318,23 +318,12 @@ void SfxMacroTabPage::AssignDeleteHdl(const weld::Widget* pBtn)
 IMPL_LINK( SfxMacroTabPage, TimeOut_Impl, Timer*,, void )
 {
     // FillMacroList() can take a long time -> show wait cursor and disable input
-    SfxTabDialog* pTabDlg = GetTabDialog();
-    // perhaps the tabpage is part of a SingleTabDialog then pTabDlg == NULL
-    if ( pTabDlg )
-    {
-        pTabDlg->EnterWait();
-        pTabDlg->EnableInput( false );
-    }
+    weld::Window* pDialog = GetDialogFrameWeld();
+    // perhaps the tabpage is part of a SingleTabDialog then pDialog == nullptr
+    std::unique_ptr<weld::WaitObject> xWait(pDialog ? new weld::WaitObject(pDialog) : nullptr);
     // fill macro list
-    mpImpl->m_xGroupLB->Init(
-        comphelper::getProcessComponentContext(),
-        GetFrame(),
-        OUString(), false);
-    if ( pTabDlg )
-    {
-        pTabDlg->EnableInput();
-        pTabDlg->LeaveWait();
-    }
+    mpImpl->m_xGroupLB->Init(comphelper::getProcessComponentContext(), GetFrame(),
+                             OUString(), false);
 }
 
 void SfxMacroTabPage::InitAndSetHandler()
@@ -398,14 +387,15 @@ VclPtr<SfxTabPage> SfxMacroTabPage::Create(TabPageParent pParent, const SfxItemS
     return CreateSfxMacroTabPage(pParent, *rAttrSet);
 }
 
-SfxMacroAssignDlg::SfxMacroAssignDlg(vcl::Window* pParent,
+SfxMacroAssignDlg::SfxMacroAssignDlg(weld::Window* pParent,
     const Reference< XFrame >& rxDocumentFrame, const SfxItemSet& rSet)
-    : SfxSingleTabDialog(pParent, rSet, "EventAssignDialog",
-        "cui/ui/eventassigndialog.ui")
+    : SfxSingleTabDialogController(pParent, rSet,"cui/ui/eventassigndialog.ui",
+                                   "EventAssignDialog")
 {
-    VclPtr<SfxMacroTabPage> pPage = CreateSfxMacroTabPage(get_content_area(), rSet);
-    pPage->SetFrame( rxDocumentFrame );
-    SetTabPage( pPage );
+    TabPageParent pPageParent(get_content_area(), this);
+    VclPtr<SfxMacroTabPage> pPage = CreateSfxMacroTabPage(pPageParent, rSet);
+    pPage->SetFrame(rxDocumentFrame);
+    SetTabPage(pPage);
     pPage->LaunchFillGroup();
 }
 
diff --git a/include/sfx2/basedlgs.hxx b/include/sfx2/basedlgs.hxx
index 06c928265277..91d412d48b46 100644
--- a/include/sfx2/basedlgs.hxx
+++ b/include/sfx2/basedlgs.hxx
@@ -227,7 +227,6 @@ private:
 class SFX2_DLLPUBLIC SfxSingleTabDialogController : public SfxDialogController
 {
 private:
-    VclPtr<SfxTabPage>          m_xSfxPage;
     std::unique_ptr<SfxItemSet> m_xOutputSet;
     const SfxItemSet* m_pInputSet;
 
@@ -247,6 +246,7 @@ public:
     const SfxItemSet*   GetInputItemSet() const { return m_pInputSet; }
 
 protected:
+    VclPtr<SfxTabPage> m_xSfxPage;
     std::unique_ptr<weld::Container> m_xContainer;
     std::unique_ptr<weld::Button> m_xOKBtn;
     std::unique_ptr<weld::Button> m_xHelpBtn;
diff --git a/include/svx/svxdlg.hxx b/include/svx/svxdlg.hxx
index 97030fefefa1..5ff7187537d7 100644
--- a/include/svx/svxdlg.hxx
+++ b/include/svx/svxdlg.hxx
@@ -438,9 +438,8 @@ public:
                                                                         const SdrView* pView,
                                                                         sal_uInt32 nResId )=0;
     virtual VclPtr<SfxAbstractDialog>       CreateCharMapDialog(weld::Window* pParent, const SfxItemSet& rAttr, bool bInsert) = 0;
-    virtual VclPtr<SfxAbstractDialog>       CreateEventConfigDialog( vcl::Window* pParent,
-                                                                        const SfxItemSet& rAttr,
-                                    const css::uno::Reference< css::frame::XFrame >& _rxFrame )=0;
+    virtual VclPtr<SfxAbstractDialog>       CreateEventConfigDialog(weld::Window* pParent, const SfxItemSet& rAttr,
+                                                                    const css::uno::Reference< css::frame::XFrame >& _rxFrame) = 0;
     virtual VclPtr<AbstractSvxPostItDialog>    CreateSvxPostItDialog(weld::Window* pParent, const SfxItemSet& rCoreSet, bool bPrevNext = false) = 0;
     virtual VclPtr<VclAbstractDialog>          CreateSvxScriptOrgDialog( vcl::Window* pParent, const OUString& rLanguage ) override = 0;
 
diff --git a/sc/source/ui/drawfunc/drawsh.cxx b/sc/source/ui/drawfunc/drawsh.cxx
index 41923ef3db05..4d68e8365fd2 100644
--- a/sc/source/ui/drawfunc/drawsh.cxx
+++ b/sc/source/ui/drawfunc/drawsh.cxx
@@ -116,7 +116,7 @@ void ScDrawShell::ExecDrawAttr( SfxRequest& rReq )
         case SID_ASSIGNMACRO:
             {
                 if ( pSingleSelectedObj )
-                    ExecuteMacroAssign( pSingleSelectedObj, pWin );
+                    ExecuteMacroAssign(pSingleSelectedObj, pWin ? pWin->GetFrameWeld() : nullptr);
             }
             break;
 
@@ -318,7 +318,7 @@ void ScDrawShell::ExecDrawAttr( SfxRequest& rReq )
     }
 }
 
-void ScDrawShell::ExecuteMacroAssign( SdrObject* pObj, vcl::Window* pWin )
+void ScDrawShell::ExecuteMacroAssign(SdrObject* pObj, weld::Window* pWin)
 {
     SvxMacroItem aItem ( SfxGetpApp()->GetPool().GetWhich( SID_ATTR_MACROITEM ) );
     ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( pObj, true );
diff --git a/sc/source/ui/inc/drawsh.hxx b/sc/source/ui/inc/drawsh.hxx
index 8f195484e278..b25b6b6e9000 100644
--- a/sc/source/ui/inc/drawsh.hxx
+++ b/sc/source/ui/inc/drawsh.hxx
@@ -80,7 +80,7 @@ public:
     void    ExecFormatPaintbrush(const SfxRequest& rReq);
     void    StateFormatPaintbrush(SfxItemSet& rSet);
 
-    void    ExecuteMacroAssign( SdrObject* pObj, vcl::Window* pWin );
+    void    ExecuteMacroAssign(SdrObject* pObj, weld::Window* pWin);
     void    ExecuteLineDlg( SfxRequest& rReq );
     void    ExecuteAreaDlg( SfxRequest& rReq );
     void    ExecuteTextAttrDlg( SfxRequest& rReq );
diff --git a/svx/source/dialog/imapwnd.cxx b/svx/source/dialog/imapwnd.cxx
index ea8feb26521b..7c65fc182735 100644
--- a/svx/source/dialog/imapwnd.cxx
+++ b/svx/source/dialog/imapwnd.cxx
@@ -667,7 +667,7 @@ void IMapWindow::DoMacroAssign()
     aSet.Put( aMacroItem );
 
     SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
-    ScopedVclPtr<SfxAbstractDialog> pMacroDlg(pFact->CreateEventConfigDialog( this, aSet, mxDocumentFrame ));
+    ScopedVclPtr<SfxAbstractDialog> pMacroDlg(pFact->CreateEventConfigDialog(GetFrameWeld(), aSet, mxDocumentFrame));
 
     if ( pMacroDlg->Execute() == RET_OK )
     {
diff --git a/sw/source/ui/chrdlg/chardlg.cxx b/sw/source/ui/chrdlg/chardlg.cxx
index 8b5177ebc166..15576805856c 100644
--- a/sw/source/ui/chrdlg/chardlg.cxx
+++ b/sw/source/ui/chrdlg/chardlg.cxx
@@ -307,7 +307,7 @@ IMPL_LINK_NOARG(SwCharURLPage, InsertFileHdl, weld::Button&, void)
 
 IMPL_LINK_NOARG(SwCharURLPage, EventHdl, weld::Button&, void)
 {
-    bModified |= SwMacroAssignDlg::INetFormatDlg(this,
+    bModified |= SwMacroAssignDlg::INetFormatDlg(GetDialogFrameWeld(),
                     ::GetActiveView()->GetWrtShell(), pINetItem);
 }
 
diff --git a/sw/source/ui/dialog/macassgn.cxx b/sw/source/ui/dialog/macassgn.cxx
index ec1c51062a99..8e247d052efb 100644
--- a/sw/source/ui/dialog/macassgn.cxx
+++ b/sw/source/ui/dialog/macassgn.cxx
@@ -104,8 +104,8 @@ SfxEventNamesItem SwMacroAssignDlg::AddEvents( DlgEventType eType )
     return aItem;
 }
 
-bool SwMacroAssignDlg::INetFormatDlg( vcl::Window* pParent, SwWrtShell& rSh,
-                                    std::unique_ptr<SvxMacroItem>& rpINetItem )
+bool SwMacroAssignDlg::INetFormatDlg(weld::Window* pParent, SwWrtShell& rSh,
+                                     std::unique_ptr<SvxMacroItem>& rpINetItem )
 {
     bool bRet = false;
     SfxItemSet aSet( rSh.GetAttrPool(), svl::Items<RES_FRMMACRO, RES_FRMMACRO, SID_EVENTCONFIG, SID_EVENTCONFIG>{} );
@@ -119,7 +119,7 @@ bool SwMacroAssignDlg::INetFormatDlg( vcl::Window* pParent, SwWrtShell& rSh,
     aSet.Put( AddEvents( MACASSGN_INETFMT ) );
 
     SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
-    ScopedVclPtr<SfxAbstractDialog> pMacroDlg( pFact->CreateEventConfigDialog( pParent, aSet,
+    ScopedVclPtr<SfxAbstractDialog> pMacroDlg( pFact->CreateEventConfigDialog(pParent, aSet,
         rSh.GetView().GetViewFrame()->GetFrame().GetFrameInterface() ) );
     if ( pMacroDlg && pMacroDlg->Execute() == RET_OK )
     {
diff --git a/sw/source/ui/misc/glossary.cxx b/sw/source/ui/misc/glossary.cxx
index 266739d03d8d..3e5467407377 100644
--- a/sw/source/ui/misc/glossary.cxx
+++ b/sw/source/ui/misc/glossary.cxx
@@ -531,7 +531,7 @@ IMPL_LINK( SwGlossaryDlg, MenuHdl, Menu *, pMn, bool )
 
         const SfxPoolItem* pItem;
         SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
-        ScopedVclPtr<SfxAbstractDialog> pMacroDlg(pFact->CreateEventConfigDialog( this, aSet,
+        ScopedVclPtr<SfxAbstractDialog> pMacroDlg(pFact->CreateEventConfigDialog(GetFrameWeld(), aSet,
             pSh->GetView().GetViewFrame()->GetFrame().GetFrameInterface() ));
         if ( pMacroDlg && pMacroDlg->Execute() == RET_OK &&
             SfxItemState::SET == pMacroDlg->GetOutputItemSet()->GetItemState( RES_FRMMACRO, false, &pItem ) )
diff --git a/sw/source/uibase/inc/macassgn.hxx b/sw/source/uibase/inc/macassgn.hxx
index 7437f094c9d2..059ea99900b1 100644
--- a/sw/source/uibase/inc/macassgn.hxx
+++ b/sw/source/uibase/inc/macassgn.hxx
@@ -38,8 +38,8 @@ class SwMacroAssignDlg
 {
 public:
     static SfxEventNamesItem AddEvents( DlgEventType eType );
-    static bool INetFormatDlg( vcl::Window* pParent, SwWrtShell& rSh,
-                            std::unique_ptr<SvxMacroItem>& rpINetItem );
+    static bool INetFormatDlg(weld::Window* pParent, SwWrtShell& rSh,
+                              std::unique_ptr<SvxMacroItem>& rpINetItem );
 };
 
 #endif


More information about the Libreoffice-commits mailing list