sc/source/ui/cctrl/checklistmenu.cxx | 38 ----------------------------------- sc/source/ui/inc/checklistmenu.hxx | 3 -- vcl/jsdialog/jsdialogbuilder.cxx | 7 +----- 3 files changed, 2 insertions(+), 46 deletions(-)
New commits: commit ace42fde4a7e15b9a6da8cbf40d34cd6141da781 Author: Szymon Kłos <szymon.k...@collabora.com> AuthorDate: Mon Apr 4 23:27:01 2022 +0200 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Mon Apr 11 11:15:11 2022 +0200 jsdialog: autofilter: unify with regular popup - remove special type "autofilter" - now autofilter will be handled by dialog code in online Change-Id: I3478c3e05ab2e83030a8d68632d0426a5cc0accd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132539 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Mert Tumer <mert.tu...@collabora.com> diff --git a/sc/source/ui/cctrl/checklistmenu.cxx b/sc/source/ui/cctrl/checklistmenu.cxx index f6778e32f85c..7c5da063116b 100644 --- a/sc/source/ui/cctrl/checklistmenu.cxx +++ b/sc/source/ui/cctrl/checklistmenu.cxx @@ -435,9 +435,6 @@ void ScCheckListMenuControl::StartPopupMode(weld::Widget* pParent, const tools:: void ScCheckListMenuControl::terminateAllPopupMenus() { - if (comphelper::LibreOfficeKit::isActive()) - NotifyCloseLOK(); - EndPopupMode(); } @@ -1400,27 +1397,11 @@ void ScCheckListMenuControl::launch(weld::Widget* pWidget, const tools::Rectangl StartPopupMode(pWidget, aRect); } -void ScCheckListMenuControl::NotifyCloseLOK() -{ - if (mpNotifier) - { - tools::JsonWriter aJsonWriter; - aJsonWriter.put("jsontype", "autofilter"); - aJsonWriter.put("action", "close"); - - const std::string message = aJsonWriter.extractAsStdString(); - mpNotifier->libreOfficeKitViewCallback(LOK_CALLBACK_JSDIALOG, message.c_str()); - } -} - void ScCheckListMenuControl::close(bool bOK) { if (bOK && mxOKAction) mxOKAction->execute(); EndPopupMode(); - - if (comphelper::LibreOfficeKit::isActive()) - NotifyCloseLOK(); } void ScCheckListMenuControl::setExtendedData(std::unique_ptr<ExtendedData> p) @@ -1451,9 +1432,6 @@ IMPL_LINK_NOARG(ScCheckListMenuControl, PopupModeEndHdl, weld::Popover&, void) mxPopupEndAction->execute(); DropPendingEvents(); - - if (comphelper::LibreOfficeKit::isActive()) - NotifyCloseLOK(); } int ScCheckListMenuControl::GetTextWidth(const OUString& rsName) const @@ -1617,24 +1595,8 @@ void ScListSubMenuControl::setPopupStartAction(ScCheckListMenuControl::Action* p void ScListSubMenuControl::terminateAllPopupMenus() { - if (comphelper::LibreOfficeKit::isActive()) - NotifyCloseLOK(); - EndPopupMode(); mrParentControl.terminateAllPopupMenus(); } -void ScListSubMenuControl::NotifyCloseLOK() -{ - if (mpNotifier) - { - tools::JsonWriter aJsonWriter; - aJsonWriter.put("jsontype", "autofilter"); - aJsonWriter.put("action", "close"); - - const std::string message = aJsonWriter.extractAsStdString(); - mpNotifier->libreOfficeKitViewCallback(LOK_CALLBACK_JSDIALOG, message.c_str()); - } -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/checklistmenu.hxx b/sc/source/ui/inc/checklistmenu.hxx index 8d135870d871..1108ca7705a8 100644 --- a/sc/source/ui/inc/checklistmenu.hxx +++ b/sc/source/ui/inc/checklistmenu.hxx @@ -227,8 +227,6 @@ private: void CreateDropDown(); - void NotifyCloseLOK(); - DECL_LINK(ButtonHdl, weld::Button&, void); DECL_LINK(TriStateHdl, weld::Toggleable&, void); @@ -368,7 +366,6 @@ private: DECL_LINK(CheckToggledHdl, const weld::TreeView::iter_col&, void); DECL_LINK(MenuKeyInputHdl, const KeyEvent&, bool); - void NotifyCloseLOK(); void executeMenuItem(size_t nPos); void addItem(ScCheckListMenuControl::Action* pAction); }; diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx index 1891e7f72c8e..408e7a9e53da 100644 --- a/vcl/jsdialog/jsdialogbuilder.cxx +++ b/vcl/jsdialog/jsdialogbuilder.cxx @@ -211,7 +211,7 @@ JSDialogNotifyIdle::generatePopupMessage(VclPtr<vcl::Window> pWindow, OUString s } } - if (m_sTypeOfJSON == "autofilter") + // try to get the position eg. for the autofilter { vcl::Window* pVclWindow = pWindow.get(); DockingWindow* pDockingWindow = dynamic_cast<DockingWindow*>(pVclWindow); @@ -231,7 +231,7 @@ JSDialogNotifyIdle::generatePopupMessage(VclPtr<vcl::Window> pWindow, OUString s } } - aJsonWriter->put("jsontype", (m_sTypeOfJSON == "autofilter") ? "autofilter" : "dialog"); + aJsonWriter->put("jsontype", "dialog"); aJsonWriter->put("type", "modalpopup"); aJsonWriter->put("cancellable", true); aJsonWriter->put("popupParent", sParentId); @@ -500,9 +500,6 @@ JSInstanceBuilder::JSInstanceBuilder(weld::Widget* pParent, const OUString& rUIR , m_bIsNotebookbar(false) , m_aWindowToRelease(nullptr) { - if (rUIFile == "modules/scalc/ui/filterdropdown.ui") - m_sTypeOfJSON = "autofilter"; - // when it is a popup we initialize sender in weld_popover if (bPopup) return;