include/vcl/toolkit/dialog.hxx | 1 + vcl/jsdialog/jsdialogbuilder.cxx | 1 + vcl/source/window/builder.cxx | 30 ++++++++++++++++++++---------- vcl/source/window/dialog.cxx | 30 +++++++++++++++++++++++------- 4 files changed, 45 insertions(+), 17 deletions(-)
New commits: commit 02e7718d25290b702721fa15b03ee538c0506f21 Author: Szymon Kłos <[email protected]> AuthorDate: Wed Nov 18 12:00:03 2020 +0100 Commit: Szymon Kłos <[email protected]> CommitDate: Mon Dec 7 12:19:44 2020 +0100 jsdialog: turn off tunneling for JSON dialogs Change-Id: I9a9d359d1769f6c34203bc558efe8189fbf81fd3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106929 Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-by: Szymon Kłos <[email protected]> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107337 Tested-by: Jenkins diff --git a/include/vcl/toolkit/dialog.hxx b/include/vcl/toolkit/dialog.hxx index 1d3064784bd4..efd2d2f0f6c0 100644 --- a/include/vcl/toolkit/dialog.hxx +++ b/include/vcl/toolkit/dialog.hxx @@ -149,6 +149,7 @@ public: void SetPopupMenuHdl(const Link<const CommandEvent&, bool>& rLink); void SetInstallLOKNotifierHdl(const Link<void*, vcl::ILibreOfficeKitNotifier*>& rLink); + void SetLOKTunnelingState(bool bEnabled); void add_button(PushButton* pButton, int nResponse, bool bTransferOwnership); void set_default_response(int nResponse); diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx index 13b438022e7e..051c90c7b6db 100644 --- a/vcl/jsdialog/jsdialogbuilder.cxx +++ b/vcl/jsdialog/jsdialogbuilder.cxx @@ -359,6 +359,7 @@ std::unique_ptr<weld::Dialog> JSInstanceBuilder::weld_dialog(const OString& id) { ::Dialog* pDialog = m_xBuilder->get<::Dialog>(id); m_nWindowId = pDialog->GetLOKWindowId(); + pDialog->SetLOKTunnelingState(false); InsertWindowToMap(m_nWindowId); diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx index c6aed4909b87..9a237ba5df9f 100644 --- a/vcl/source/window/dialog.cxx +++ b/vcl/source/window/dialog.cxx @@ -356,8 +356,9 @@ struct DialogImpl VclAbstractDialog::AsyncContext maEndCtx; Link<const CommandEvent&, bool> m_aPopupMenuHdl; Link<void*, vcl::ILibreOfficeKitNotifier*> m_aInstallLOKNotifierHdl; + bool m_bLOKTunneling; - DialogImpl() : mnResult( -1 ), mbStartedModal( false ) {} + DialogImpl() : mnResult( -1 ), mbStartedModal( false ), m_bLOKTunneling( true ) {} #ifndef NDEBUG short get_response(vcl::Window *pWindow) const @@ -610,6 +611,8 @@ Dialog::~Dialog() void Dialog::dispose() { + bool bTunnelingEnabled = mpDialogImpl->m_bLOKTunneling; + mpDialogImpl.reset(); RemoveFromDlgList(); mpActionArea.clear(); @@ -627,7 +630,8 @@ void Dialog::dispose() { if(const vcl::ILibreOfficeKitNotifier* pNotifier = GetLOKNotifier()) { - pNotifier->notifyWindow(GetLOKWindowId(), "close"); + if (bTunnelingEnabled) + pNotifier->notifyWindow(GetLOKWindowId(), "close"); ReleaseLOKNotifier(); } } @@ -734,14 +738,21 @@ void Dialog::SetInstallLOKNotifierHdl(const Link<void*, vcl::ILibreOfficeKitNoti mpDialogImpl->m_aInstallLOKNotifierHdl = rLink; } +void Dialog::SetLOKTunnelingState(bool bEnabled) +{ + mpDialogImpl->m_bLOKTunneling = bEnabled; +} + void Dialog::StateChanged( StateChangedType nType ) { + bool bTunnelingEnabled = mpDialogImpl->m_bLOKTunneling; + if (nType == StateChangedType::InitShow) { DoInitialLayout(); const bool bKitActive = comphelper::LibreOfficeKit::isActive(); - if (bKitActive) + if (bKitActive && bTunnelingEnabled) { std::vector<vcl::LOKPayloadItem> aItems; aItems.emplace_back("type", "dialog"); @@ -780,7 +791,8 @@ void Dialog::StateChanged( StateChangedType nType ) } else if (nType == StateChangedType::Text) { - if (const vcl::ILibreOfficeKitNotifier* pNotifier = GetLOKNotifier()) + const vcl::ILibreOfficeKitNotifier* pNotifier = GetLOKNotifier(); + if (pNotifier && bTunnelingEnabled) { std::vector<vcl::LOKPayloadItem> aPayload; aPayload.emplace_back("title", GetText().toUtf8()); @@ -798,7 +810,8 @@ void Dialog::StateChanged( StateChangedType nType ) if (!mbModalMode && nType == StateChangedType::Visible) { - if (const vcl::ILibreOfficeKitNotifier* pNotifier = GetLOKNotifier()) + const vcl::ILibreOfficeKitNotifier* pNotifier = GetLOKNotifier(); + if (pNotifier && bTunnelingEnabled) { std::vector<vcl::LOKPayloadItem> aPayload; aPayload.emplace_back("title", GetText().toUtf8()); @@ -986,7 +999,8 @@ bool Dialog::ImplStartExecute() else UITestLogger::getInstance().log("Open Modeless " + get_id()); - if (comphelper::LibreOfficeKit::isActive()) + bool bTunnelingEnabled = mpDialogImpl->m_bLOKTunneling; + if (comphelper::LibreOfficeKit::isActive() && bTunnelingEnabled) { if (const vcl::ILibreOfficeKitNotifier* pNotifier = GetLOKNotifier()) { @@ -1351,7 +1365,9 @@ void Dialog::Resize() if (comphelper::LibreOfficeKit::isDialogPainting()) return; - if (const vcl::ILibreOfficeKitNotifier* pNotifier = GetLOKNotifier()) + bool bTunnelingEnabled = mpDialogImpl->m_bLOKTunneling; + const vcl::ILibreOfficeKitNotifier* pNotifier = GetLOKNotifier(); + if (pNotifier && bTunnelingEnabled) { std::vector<vcl::LOKPayloadItem> aItems; aItems.emplace_back("size", GetSizePixel().toString()); commit 8f4e206520d9b6b5f41f08f5fc911123b4541320 Author: Szymon Kłos <[email protected]> AuthorDate: Wed Nov 25 13:39:28 2020 +0100 Commit: Szymon Kłos <[email protected]> CommitDate: Mon Dec 7 12:19:32 2020 +0100 jsdialog: enable Pivot Table dialogs Change-Id: Ic467c95f0d56d28e6c6590d488e2a0b10f65e803 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106997 Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-by: Szymon Kłos <[email protected]> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107338 Tested-by: Jenkins diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx index fa759ead51f8..3a05bb6a8f9d 100644 --- a/vcl/source/window/builder.cxx +++ b/vcl/source/window/builder.cxx @@ -166,17 +166,27 @@ weld::Builder* Application::CreateBuilder(weld::Widget* pParent, const OUString { bool bUseJSBuilder = false; - if (bMobile) - { - if (rUIFile == "modules/swriter/ui/wordcount-mobile.ui" || - rUIFile == "svx/ui/findreplacedialog-mobile.ui" || - rUIFile == "modules/swriter/ui/watermarkdialog.ui" || - rUIFile == "modules/scalc/ui/validationdialog.ui" || - rUIFile == "modules/scalc/ui/validationcriteriapage.ui" || - rUIFile == "modules/scalc/ui/validationhelptabpage-mobile.ui" || - rUIFile == "modules/scalc/ui/erroralerttabpage-mobile.ui" || - rUIFile == "modules/scalc/ui/validationdialog.ui") + if (comphelper::LibreOfficeKit::isActive()) + { + if (bMobile) + { + if (rUIFile == "modules/swriter/ui/wordcount-mobile.ui" || + rUIFile == "svx/ui/findreplacedialog-mobile.ui" || + rUIFile == "modules/swriter/ui/watermarkdialog.ui" || + rUIFile == "modules/scalc/ui/validationdialog.ui" || + rUIFile == "modules/scalc/ui/validationcriteriapage.ui" || + rUIFile == "modules/scalc/ui/validationhelptabpage-mobile.ui" || + rUIFile == "modules/scalc/ui/erroralerttabpage-mobile.ui" || + rUIFile == "modules/scalc/ui/validationdialog.ui") + { + bUseJSBuilder = true; + } + } + + if (rUIFile == "modules/scalc/ui/pivottablelayoutdialog.ui") + { bUseJSBuilder = true; + } } if (bUseJSBuilder) _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
