diff options
author | Henry Castro <hcastro@collabora.com> | 2018-01-11 13:31:36 -0400 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2018-03-22 23:59:35 +0100 |
commit | e2e0ec0a01b5cb3f13349d364db9e643a7a1b295 (patch) | |
tree | 5b10dd67f4938527a0fbe298d430307a2ce95cc1 /sfx2 | |
parent | 2f6a337139f60307057fcc44cb0d6d563ee9f28c (diff) |
lok dialog: enable MessageDialog tunneling
Reviewed-on: https://gerrit.libreoffice.org/47772
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
(cherry picked from commit 072e3ce1cfea5bb61cc5f3001c288df6deb45613)
Change-Id: I05b270a19e29c5ed3a2482fd8163e61e66bfdf74
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/dialog/basedlgs.cxx | 24 | ||||
-rw-r--r-- | sfx2/source/dialog/tabdlg.cxx | 21 | ||||
-rw-r--r-- | sfx2/source/view/viewfrm.cxx | 5 | ||||
-rw-r--r-- | sfx2/source/view/viewsh.cxx | 9 |
4 files changed, 14 insertions, 45 deletions
diff --git a/sfx2/source/dialog/basedlgs.cxx b/sfx2/source/dialog/basedlgs.cxx index 0f03e15ebf3a..32ba042b8b76 100644 --- a/sfx2/source/dialog/basedlgs.cxx +++ b/sfx2/source/dialog/basedlgs.cxx @@ -161,33 +161,9 @@ void SfxModalDialog::dispose() SetDialogData_Impl(); delete pOutputSet; - if (comphelper::LibreOfficeKit::isActive() && GetLOKNotifier()) - { - SfxViewShell::Current()->notifyWindow(GetLOKWindowId(), "close"); - ReleaseLOKNotifier(); - } - ModalDialog::dispose(); } -short SfxModalDialog::Execute() -{ - 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 ModalDialog::Execute(); -} - void SfxModalDialog::CreateOutputItemSet( SfxItemPool& rPool ) { DBG_ASSERT( !pOutputSet, "Double creation of OutputSet!" ); diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx index d1c366490e88..9fe10f844c14 100644 --- a/sfx2/source/dialog/tabdlg.cxx +++ b/sfx2/source/dialog/tabdlg.cxx @@ -403,13 +403,6 @@ void SfxTabDialog::dispose() m_pBaseFmtBtn.clear(); m_pActionArea.clear(); - SfxViewShell* pViewShell = SfxViewShell::Current(); - if (comphelper::LibreOfficeKit::isActive() && pViewShell) - { - pViewShell->notifyWindow(GetLOKWindowId(), "close"); - ReleaseLOKNotifier(); - } - TabDialog::dispose(); } @@ -587,20 +580,6 @@ 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 ) diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index 36cb0dbf3f4d..8f4d56792435 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -1255,8 +1255,13 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint ) } case SfxHintId::Deinitializing: + { + if (GetWindow().GetLOKNotifier()) + GetWindow().ReleaseLOKNotifier(); + GetFrame().DoClose(); break; + } case SfxHintId::Dying: // when the Object is being deleted, destroy the view too if ( m_xObjSh.is() ) diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx index 3eb162ffe642..0174aa2caa40 100644 --- a/sfx2/source/view/viewsh.cxx +++ b/sfx2/source/view/viewsh.cxx @@ -1071,6 +1071,9 @@ SfxViewShell::SfxViewShell // Insert into list SfxViewShellArr_Impl &rViewArr = SfxGetpApp()->GetViewShells_Impl(); rViewArr.push_back(this); + + if (comphelper::LibreOfficeKit::isActive()) + pViewFrame->GetWindow().SetLOKNotifier(this, true); } @@ -1094,6 +1097,9 @@ SfxViewShell::~SfxViewShell() pImpl->m_pController->ReleaseShell_Impl(); pImpl->m_pController.clear(); } + + if (GetViewFrame()->GetWindow().GetLOKNotifier()) + GetViewFrame()->GetWindow().ReleaseLOKNotifier(); } bool SfxViewShell::PrepareClose @@ -1101,6 +1107,9 @@ bool SfxViewShell::PrepareClose bool bUI // TRUE: Allow Dialog and so on, FALSE: silent-mode ) { + if (GetViewFrame()->GetWindow().GetLOKNotifier()) + GetViewFrame()->GetWindow().ReleaseLOKNotifier(); + SfxPrinter *pPrinter = GetPrinter(); if ( pPrinter && pPrinter->IsPrinting() ) { |