sc/source/ui/cctrl/checklistmenu.cxx | 34 ++++++++++++++++++++++++++++++++++ sc/source/ui/inc/checklistmenu.hxx | 2 ++ 2 files changed, 36 insertions(+)
New commits: commit 7120385d05a1f820c661ede1650af8bfb4f4ceff Author: Szymon Kłos <szymon.k...@collabora.com> AuthorDate: Wed Nov 4 11:37:15 2020 +0100 Commit: Szymon Kłos <szymon.k...@collabora.com> CommitDate: Tue Dec 1 11:03:07 2020 +0100 jsdialog: notify about autofilter dropdown close Change-Id: If6eb585f04f2d7441a7950bbdca378cc92ba641b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106906 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Szymon Kłos <szymon.k...@collabora.com> diff --git a/sc/source/ui/cctrl/checklistmenu.cxx b/sc/source/ui/cctrl/checklistmenu.cxx index 8c378849a83d..452e7c1eb61a 100644 --- a/sc/source/ui/cctrl/checklistmenu.cxx +++ b/sc/source/ui/cctrl/checklistmenu.cxx @@ -32,6 +32,8 @@ #include <rtl/math.hxx> #include <tools/wintypes.hxx> #include <unotools/charclass.hxx> +#include <comphelper/lok.hxx> +#include <LibreOfficeKit/LibreOfficeKitEnums.h> #include <document.hxx> @@ -1342,11 +1344,40 @@ void ScCheckListMenuControl::launch(const tools::Rectangle& rRect) StartPopupMode(aRect, FloatWinPopupFlags::Down); } +void ScCheckListMenuControl::NotifyCloseLOK() +{ + VclPtr<vcl::Window> aNotifierWindow = mxFrame->GetParentWithLOKNotifier(); + if (aNotifierWindow) { + try + { + const vcl::ILibreOfficeKitNotifier* pNotifier = aNotifierWindow->GetLOKNotifier(); + if (pNotifier) + { + std::stringstream aStream; + boost::property_tree::ptree aTree; + aTree.put("jsontype", "dockingwindow"); + aTree.put("action", "close"); + + boost::property_tree::write_json(aStream, aTree); + const std::string message = aStream.str(); + pNotifier->libreOfficeKitViewCallback(LOK_CALLBACK_JSDIALOG, message.c_str()); + } + } + catch (boost::property_tree::json_parser::json_parser_error& rError) + { + SAL_WARN("vcl", rError.message()); + } + } +} + void ScCheckListMenuControl::close(bool bOK) { if (bOK && mxOKAction) mxOKAction->execute(); EndPopupMode(); + + if (comphelper::LibreOfficeKit::isActive()) + NotifyCloseLOK(); } void ScCheckListMenuControl::setExtendedData(std::unique_ptr<ExtendedData> p) @@ -1374,6 +1405,9 @@ IMPL_LINK_NOARG(ScCheckListMenuControl, PopupModeEndHdl, FloatingWindow*, void) clearSelectedMenuItem(); if (mxPopupEndAction) mxPopupEndAction->execute(); + + if (comphelper::LibreOfficeKit::isActive()) + NotifyCloseLOK(); } int ScCheckListMenuControl::GetTextWidth(const OUString& rsName) const diff --git a/sc/source/ui/inc/checklistmenu.hxx b/sc/source/ui/inc/checklistmenu.hxx index eb5c418a3cad..49d4822ecd3b 100644 --- a/sc/source/ui/inc/checklistmenu.hxx +++ b/sc/source/ui/inc/checklistmenu.hxx @@ -209,6 +209,8 @@ private: void CreateDropDown(); + void NotifyCloseLOK(); + DECL_LINK(ButtonHdl, weld::Button&, void); DECL_LINK(TriStateHdl, weld::ToggleButton&, void); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits