summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2018-01-13 12:10:43 +0000
committerJan Holesovsky <kendy@collabora.com>2018-01-15 17:40:11 +0100
commitd0f4f27465da113748ca63103692c45da64af6f5 (patch)
tree7f0d3c2038b080dd98127e298402ae0144b21758 /sfx2
parentaceaaaa85fd824611349e637f37b9644b6fe62cb (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. Change-Id: Idb2c1ec790e38f582438471a0419a56cdcf1439d Reviewed-on: https://gerrit.libreoffice.org/47817 Reviewed-by: Jan Holesovsky <kendy@collabora.com> Tested-by: Jan Holesovsky <kendy@collabora.com>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/control/request.cxx17
-rw-r--r--sfx2/source/dialog/tabdlg.cxx37
2 files changed, 41 insertions, 13 deletions
diff --git a/sfx2/source/control/request.cxx b/sfx2/source/control/request.cxx
index 2c8f1ea69cb4..751e2f30108a 100644
--- a/sfx2/source/control/request.cxx
+++ b/sfx2/source/control/request.cxx
@@ -152,6 +152,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 13033266ba47..c2228856465b 100644
--- a/sfx2/source/dialog/tabdlg.cxx
+++ b/sfx2/source/dialog/tabdlg.cxx
@@ -520,22 +520,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 )
{
@@ -592,6 +589,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 )