diff options
author | Jan Holesovsky <kendy@collabora.com> | 2018-01-12 11:57:22 +0000 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2018-03-21 12:11:50 +0100 |
commit | de70c261103da079a8cf54c818aa1e6d6085202c (patch) | |
tree | 1fcdeabcc2d313c1933c05f7016b61672482a566 /sfx2 | |
parent | a1d6bb723907c0c5e0b1753f2e95724d16c67133 (diff) |
lokdialog: Allow closing the Format Cell dialogs in any order.
Includes also lots of infrastructural changes, making the
conversion of the rest of the dialogs much easier.
StartExecuteAsync should be used in-place of StartExecuteModal
and the latter removed from the code-base incrementally. More
common code from Dialog::Execute should be moved to
ImplStartExecuteModal in a next step, as this is used more widely.
Reviewed-on: https://gerrit.libreoffice.org/47722
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
(cherry picked from commit c40dfabd56ade10fe35690dc9810955c2e99e2c0)
Change-Id: Idb2c1ec790e38f582438471a0419a56cdcf1439d
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/control/request.cxx | 17 | ||||
-rw-r--r-- | sfx2/source/dialog/tabdlg.cxx | 37 |
2 files changed, 41 insertions, 13 deletions
diff --git a/sfx2/source/control/request.cxx b/sfx2/source/control/request.cxx index 2bd37d439613..d7e6e6af1346 100644 --- a/sfx2/source/control/request.cxx +++ b/sfx2/source/control/request.cxx @@ -155,6 +155,23 @@ SfxRequest::SfxRequest pImpl->SetPool( pArgs->GetPool() ); else pImpl->SetPool( rOrig.pImpl->pPool ); + + // setup macro recording if it was in the original SfxRequest + if (rOrig.pImpl->pViewFrame && rOrig.pImpl->xRecorder.is()) + { + nSlot = rOrig.nSlot; + pImpl->pViewFrame = rOrig.pImpl->pViewFrame; + if (pImpl->pViewFrame->GetDispatcher()->GetShellAndSlot_Impl(nSlot, &pImpl->pShell, &pImpl->pSlot, true, true)) + { + pImpl->SetPool( &pImpl->pShell->GetPool() ); + pImpl->xRecorder = SfxRequest::GetMacroRecorder(pImpl->pViewFrame); + pImpl->aTarget = pImpl->pShell->GetName(); + } + else + { + SAL_WARN("sfx", "Recording unsupported slot: " << pImpl->pPool->GetSlotId(nSlot)); + } + } } diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx index 784a0c274b45..d1c366490e88 100644 --- a/sfx2/source/dialog/tabdlg.cxx +++ b/sfx2/source/dialog/tabdlg.cxx @@ -518,22 +518,19 @@ short SfxTabDialog::Execute() return RET_CANCEL; Start_Impl(); - SfxViewShell* pViewShell = SfxViewShell::Current(); - if (comphelper::LibreOfficeKit::isActive() && pViewShell && !GetLOKNotifier()) - { - SetLOKNotifier(pViewShell); - const Size aSize = GetOptimalSize(); - std::vector<vcl::LOKPayloadItem> aItems; - aItems.emplace_back("type", "dialog"); - aItems.emplace_back("size", aSize.toString()); - if (!GetText().isEmpty()) - aItems.emplace_back("title", GetText().toUtf8()); - pViewShell->notifyWindow(GetLOKWindowId(), "created", aItems); - } - return TabDialog::Execute(); } +bool SfxTabDialog::StartExecuteAsync( VclAbstractDialog::AsyncContext &rCtx ) +{ + if ( !m_pTabCtrl->GetPageCount() ) + { + rCtx.mxOwner.disposeAndClear(); + return false; + } + Start_Impl(); + return TabDialog::StartExecuteAsync( rCtx ); +} void SfxTabDialog::StartExecuteModal( const Link<Dialog&,void>& rEndDialogHdl ) { @@ -590,6 +587,20 @@ void SfxTabDialog::Start_Impl() m_pTabCtrl->SetCurPageId( nActPage ); ActivatePageHdl( m_pTabCtrl ); + + SfxViewShell* pViewShell = SfxViewShell::Current(); + + if (comphelper::LibreOfficeKit::isActive() && pViewShell && !GetLOKNotifier()) + { + SetLOKNotifier(pViewShell); + const Size aSize = GetOptimalSize(); + std::vector<vcl::LOKPayloadItem> aItems; + aItems.emplace_back("type", "dialog"); + aItems.emplace_back("size", aSize.toString()); + if (!GetText().isEmpty()) + aItems.emplace_back("title", GetText().toUtf8()); + pViewShell->notifyWindow(GetLOKWindowId(), "created", aItems); + } } void SfxTabDialog::AddTabPage( sal_uInt16 nId, const OUString &rRiderText ) |