diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-11-24 15:09:10 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-11-25 15:40:15 +0100 |
commit | 3dacf98b70088e6435fb46c3e225bea35a451028 (patch) | |
tree | a222c973d25f69b957bff6429c337809e766a530 /cui | |
parent | 3a713e78a03f8200668ce146b153e12384de5bee (diff) |
weld SfxMacroAssignDlg
Change-Id: I80045f1d1ca189fc490dc88b3471d68782df6f1c
Reviewed-on: https://gerrit.libreoffice.org/63976
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/dialogs/hltpbase.cxx | 8 | ||||
-rw-r--r-- | cui/source/factory/dlgfact.cxx | 9 | ||||
-rw-r--r-- | cui/source/factory/dlgfact.hxx | 7 | ||||
-rw-r--r-- | cui/source/inc/macroass.hxx | 13 | ||||
-rw-r--r-- | cui/source/tabpages/macroass.cxx | 34 |
5 files changed, 31 insertions, 40 deletions
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(); } |