summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-10-03 14:48:35 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2018-10-31 10:27:12 +0100
commit12ed60bc8cc391811b9447300b0d06bba8e18975 (patch)
tree3a9bd7a73ae05b281e2447ca3e5a85eca8489751 /vcl
parent4ca51f7f34c820873fe423c132d97cabf846f59e (diff)
Resolves: tdf#120277 special character dialog not appearing in Online
the magic smoke connecting the dialog to the viewshell was in SfxModalDialog, so not inheriting from that drops the connection add a SfxDialogController to enable setting up the connection Change-Id: I29c45cd43e05295309fc647b039db0c6565ca0d1 Reviewed-on: https://gerrit.libreoffice.org/61311 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/app/salvtables.cxx5
-rw-r--r--vcl/source/window/dialog.cxx32
-rw-r--r--vcl/unx/gtk3/gtk3gtkinst.cxx5
3 files changed, 40 insertions, 2 deletions
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index b89ad836136c..baf21c15532c 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -676,6 +676,11 @@ public:
return m_xDialog->StartExecuteAsync(aCtx);
}
+ virtual void SetInstallLOKNotifierHdl(const Link<void*, vcl::ILibreOfficeKitNotifier*>& rLink) override
+ {
+ m_xDialog->SetInstallLOKNotifierHdl(rLink);
+ }
+
virtual int run() override
{
VclButtonBox* pActionArea = m_xDialog->get_action_area();
diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index c29227d86b25..2d34490b523b 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -343,6 +343,7 @@ struct DialogImpl
long mnResult;
bool mbStartedModal;
VclAbstractDialog::AsyncContext maEndCtx;
+ Link<void*, vcl::ILibreOfficeKitNotifier*> m_aInstallLOKNotifierHdl;
DialogImpl() : mnResult( -1 ), mbStartedModal( false ) {}
@@ -717,10 +718,30 @@ Size bestmaxFrameSizeForScreenSize(const Size &rScreenSize)
std::max<long>(h, 480 - 50));
}
+void Dialog::SetInstallLOKNotifierHdl(const Link<void*, vcl::ILibreOfficeKitNotifier*>& rLink)
+{
+ mpDialogImpl->m_aInstallLOKNotifierHdl = rLink;
+}
+
void Dialog::StateChanged( StateChangedType nType )
{
if (nType == StateChangedType::InitShow)
{
+ if (comphelper::LibreOfficeKit::isActive() && !GetLOKNotifier())
+ {
+ vcl::ILibreOfficeKitNotifier* pViewShell = mpDialogImpl->m_aInstallLOKNotifierHdl.Call(nullptr);
+ if (pViewShell)
+ {
+ SetLOKNotifier(pViewShell);
+ std::vector<vcl::LOKPayloadItem> aItems;
+ aItems.emplace_back("type", "dialog");
+ aItems.emplace_back("size", GetSizePixel().toString());
+ if (!GetText().isEmpty())
+ aItems.emplace_back("title", GetText().toUtf8());
+ pViewShell->notifyWindow(GetLOKWindowId(), "created", aItems);
+ }
+ }
+
DoInitialLayout();
if ( !HasChildPathFocus() || HasFocus() )
@@ -826,6 +847,13 @@ bool Dialog::ImplStartExecuteModal()
ImplSVData* pSVData = ImplGetSVData();
+ const bool bKitActive = comphelper::LibreOfficeKit::isActive();
+ if (bKitActive && !GetLOKNotifier())
+ {
+ if (vcl::ILibreOfficeKitNotifier* pViewShell = mpDialogImpl->m_aInstallLOKNotifierHdl.Call(nullptr))
+ SetLOKNotifier(pViewShell);
+ }
+
switch ( Application::GetDialogCancelMode() )
{
case Application::DialogCancelMode::Off:
@@ -887,7 +915,7 @@ bool Dialog::ImplStartExecuteModal()
}
mbInExecute = true;
// no real modality in LibreOfficeKit
- if (!comphelper::LibreOfficeKit::isActive())
+ if (!bKitActive)
SetModalInputMode(true);
// FIXME: no layouting, workaround some clipping issues
@@ -907,7 +935,7 @@ bool Dialog::ImplStartExecuteModal()
xEventBroadcaster->documentEventOccured(aObject);
UITestLogger::getInstance().log("DialogExecute");
- if (comphelper::LibreOfficeKit::isActive())
+ if (bKitActive)
{
if(const vcl::ILibreOfficeKitNotifier* pNotifier = GetLOKNotifier())
{
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index 0b855ebd4822..ee3dc615243a 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -2152,6 +2152,11 @@ public:
return new GtkInstanceContainer(GTK_CONTAINER(gtk_dialog_get_content_area(m_pDialog)), false);
}
+ virtual void SetInstallLOKNotifierHdl(const Link<void*, vcl::ILibreOfficeKitNotifier*>&) override
+ {
+ //not implemented for the gtk variant
+ }
+
virtual ~GtkInstanceDialog() override
{
g_signal_handler_disconnect(m_pDialog, m_nCloseSignalId);