diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-10-03 14:48:35 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-10-03 21:03:18 +0200 |
commit | 349d0e679a4ee296c703145afe73e65efc5d2bff (patch) | |
tree | 0366283ed5245f10315eae53e518bea7299d65b1 /vcl/source | |
parent | 19ec881034dbabbdc72779eb9382d0deb17ac569 (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/61304
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/app/salvtables.cxx | 5 | ||||
-rw-r--r-- | vcl/source/window/dialog.cxx | 32 |
2 files changed, 35 insertions, 2 deletions
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index 739b6d97a5b7..e4647b02cb04 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -773,6 +773,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 f3e977e42c63..bc8da4fb219d 100644 --- a/vcl/source/window/dialog.cxx +++ b/vcl/source/window/dialog.cxx @@ -347,6 +347,7 @@ struct DialogImpl long mnResult; bool mbStartedModal; VclAbstractDialog::AsyncContext maEndCtx; + Link<void*, vcl::ILibreOfficeKitNotifier*> m_aInstallLOKNotifierHdl; DialogImpl() : mnResult( -1 ), mbStartedModal( false ) {} @@ -721,10 +722,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() ) @@ -830,6 +851,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: @@ -891,7 +919,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 @@ -911,7 +939,7 @@ bool Dialog::ImplStartExecuteModal() xEventBroadcaster->documentEventOccured(aObject); UITestLogger::getInstance().log("ModalDialogExecuted Id:" + get_id()); - if (comphelper::LibreOfficeKit::isActive()) + if (bKitActive) { if(const vcl::ILibreOfficeKitNotifier* pNotifier = GetLOKNotifier()) { |