summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorHenry Castro <hcastro@collabora.com>2018-01-11 13:31:36 -0400
committerpranavk <pranavk@collabora.co.uk>2018-01-18 11:17:00 +0100
commit072e3ce1cfea5bb61cc5f3001c288df6deb45613 (patch)
tree60dcc15428c831065ed2c0673c2f73f0123a12ca /sfx2
parent64619789a45babbaa3071951e3502927f191e459 (diff)
lok dialog: enable MessageDialog tunneling
Change-Id: I05b270a19e29c5ed3a2482fd8163e61e66bfdf74 Reviewed-on: https://gerrit.libreoffice.org/47772 Reviewed-by: pranavk <pranavk@collabora.co.uk> Tested-by: pranavk <pranavk@collabora.co.uk>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/dialog/basedlgs.cxx24
-rw-r--r--sfx2/source/dialog/tabdlg.cxx21
-rw-r--r--sfx2/source/view/viewfrm.cxx5
-rw-r--r--sfx2/source/view/viewsh.cxx9
4 files changed, 14 insertions, 45 deletions
diff --git a/sfx2/source/dialog/basedlgs.cxx b/sfx2/source/dialog/basedlgs.cxx
index 5379702e7d0a..9ed41424e133 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 dea1658092fe..4eb7a29d1c49 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 149b24b89826..de705dc9ff61 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -1261,8 +1261,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 0f05946039f2..c64a50031119 100644
--- a/sfx2/source/view/viewsh.cxx
+++ b/sfx2/source/view/viewsh.cxx
@@ -1072,6 +1072,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);
}
@@ -1095,6 +1098,9 @@ SfxViewShell::~SfxViewShell()
pImpl->m_pController->ReleaseShell_Impl();
pImpl->m_pController.clear();
}
+
+ if (GetViewFrame()->GetWindow().GetLOKNotifier())
+ GetViewFrame()->GetWindow().ReleaseLOKNotifier();
}
bool SfxViewShell::PrepareClose
@@ -1102,6 +1108,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() )
{