diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2022-04-09 22:51:49 +0200 |
---|---|---|
committer | Szymon Kłos <szymon.klos@collabora.com> | 2022-04-30 11:47:53 +0200 |
commit | cdf2a60de28d7f36b5404451474cadb65db40a11 (patch) | |
tree | 66c824bb4a2154d2978a273eb301f15db32d4f08 /vcl | |
parent | 460951403745c2d08094f707e884ee99ab5b9364 (diff) |
jsdialog: used for formulabar
- do not block painting
- use welded wrappers to send JSON
- don't send tunneled dialog
Change-Id: I54c3cd02ab63bad4a50a3623a32f13b0c94a3595
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132757
Reviewed-by: Mert Tumer <mert.tumer@collabora.com>
Tested-by: Szymon Kłos <szymon.klos@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133651
Tested-by: Jenkins
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/inc/jsdialog/jsdialogbuilder.hxx | 7 | ||||
-rw-r--r-- | vcl/jsdialog/jsdialogbuilder.cxx | 34 | ||||
-rw-r--r-- | vcl/source/window/builder.cxx | 11 |
3 files changed, 48 insertions, 4 deletions
diff --git a/vcl/inc/jsdialog/jsdialogbuilder.hxx b/vcl/inc/jsdialog/jsdialogbuilder.hxx index e0232e32f241..08b16124a7e2 100644 --- a/vcl/inc/jsdialog/jsdialogbuilder.hxx +++ b/vcl/inc/jsdialog/jsdialogbuilder.hxx @@ -242,6 +242,9 @@ public: JSInstanceBuilder(vcl::Window* pParent, const OUString& rUIRoot, const OUString& rUIFile, const css::uno::Reference<css::frame::XFrame>& rFrame, sal_uInt64 nWindowId = 0); + /// used for formulabar + JSInstanceBuilder(vcl::Window* pParent, const OUString& rUIRoot, const OUString& rUIFile, + sal_uInt64 nLOKWindowId); static std::unique_ptr<JSInstanceBuilder> CreateDialogBuilder(weld::Widget* pParent, const OUString& rUIRoot, const OUString& rUIFile); @@ -255,6 +258,10 @@ public: sal_uInt64 nLOKWindowId = 0); static std::unique_ptr<JSInstanceBuilder> CreatePopupBuilder(weld::Widget* pParent, const OUString& rUIRoot, const OUString& rUIFile); + static std::unique_ptr<JSInstanceBuilder> CreateFormulabarBuilder(vcl::Window* pParent, + const OUString& rUIRoot, + const OUString& rUIFile, + sal_uInt64 nLOKWindowId); virtual ~JSInstanceBuilder() override; virtual std::unique_ptr<weld::MessageDialog> weld_message_dialog(const OString& id) override; diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx index 056a986ccf1f..f89d0ca0fc13 100644 --- a/vcl/jsdialog/jsdialogbuilder.cxx +++ b/vcl/jsdialog/jsdialogbuilder.cxx @@ -479,7 +479,8 @@ void JSDropTarget::fire_dragEnter(const css::datatransfer::dnd::DropTargetDragEn std::string JSInstanceBuilder::getMapIdFromWindowId() const { - if (m_sTypeOfJSON == "sidebar" || m_sTypeOfJSON == "notebookbar") + if (m_sTypeOfJSON == "sidebar" || m_sTypeOfJSON == "notebookbar" + || m_sTypeOfJSON == "formulabar") return std::to_string(m_nWindowId) + m_sTypeOfJSON; else return std::to_string(m_nWindowId); @@ -585,6 +586,30 @@ JSInstanceBuilder::JSInstanceBuilder(vcl::Window* pParent, const OUString& rUIRo initializeSender(GetNotifierWindow(), GetContentWindow(), GetTypeOfJSON()); } +// used for formulabar +JSInstanceBuilder::JSInstanceBuilder(vcl::Window* pParent, const OUString& rUIRoot, + const OUString& rUIFile, sal_uInt64 nLOKWindowId) + : SalInstanceBuilder(pParent, rUIRoot, rUIFile) + , m_nWindowId(nLOKWindowId) + , m_aParentDialog(nullptr) + , m_aContentWindow(nullptr) + , m_sTypeOfJSON("formulabar") + , m_bHasTopLevelDialog(false) + , m_bIsNotebookbar(false) + , m_aWindowToRelease(nullptr) +{ + vcl::Window* pRoot = m_xBuilder->get_widget_root(); + m_aContentWindow = pParent; + if (pRoot && pRoot->GetParent()) + { + m_aParentDialog = pRoot->GetParent()->GetParentWithLOKNotifier(); + InsertWindowToMap(getMapIdFromWindowId()); + } + + initializeSender(GetNotifierWindow(), GetContentWindow(), GetTypeOfJSON()); + sendFullUpdate(); +} + std::unique_ptr<JSInstanceBuilder> JSInstanceBuilder::CreateDialogBuilder(weld::Widget* pParent, const OUString& rUIRoot, const OUString& rUIFile) @@ -614,6 +639,13 @@ std::unique_ptr<JSInstanceBuilder> JSInstanceBuilder::CreatePopupBuilder(weld::W return std::make_unique<JSInstanceBuilder>(pParent, rUIRoot, rUIFile, true); } +std::unique_ptr<JSInstanceBuilder> +JSInstanceBuilder::CreateFormulabarBuilder(vcl::Window* pParent, const OUString& rUIRoot, + const OUString& rUIFile, sal_uInt64 nLOKWindowId) +{ + return std::make_unique<JSInstanceBuilder>(pParent, rUIRoot, rUIFile, nLOKWindowId); +} + JSInstanceBuilder::~JSInstanceBuilder() { if (m_aWindowToRelease) diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx index fbbbb678de37..021250bed594 100644 --- a/vcl/source/window/builder.cxx +++ b/vcl/source/window/builder.cxx @@ -198,9 +198,14 @@ std::unique_ptr<weld::Builder> Application::CreateBuilder(weld::Widget* pParent, std::unique_ptr<weld::Builder> Application::CreateInterimBuilder(vcl::Window* pParent, const OUString &rUIFile, bool bAllowCycleFocusOut, sal_uInt64 nLOKWindowId) { - // Notebookbar sub controls - if (comphelper::LibreOfficeKit::isActive() && jsdialog::isInterimBuilderEnabledForNotebookbar(rUIFile)) - return JSInstanceBuilder::CreateNotebookbarBuilder(pParent, AllSettings::GetUIRootDir(), rUIFile, css::uno::Reference<css::frame::XFrame>(), nLOKWindowId); + if (comphelper::LibreOfficeKit::isActive()) + { + // Notebookbar sub controls + if (jsdialog::isInterimBuilderEnabledForNotebookbar(rUIFile)) + return JSInstanceBuilder::CreateNotebookbarBuilder(pParent, AllSettings::GetUIRootDir(), rUIFile, css::uno::Reference<css::frame::XFrame>(), nLOKWindowId); + else if (rUIFile == u"modules/scalc/ui/inputbar.ui") + return JSInstanceBuilder::CreateFormulabarBuilder(pParent, AllSettings::GetUIRootDir(), rUIFile, nLOKWindowId); + } return ImplGetSVData()->mpDefInst->CreateInterimBuilder(pParent, AllSettings::GetUIRootDir(), rUIFile, bAllowCycleFocusOut, nLOKWindowId); } |