[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sc/source
Szymon KÅos (via logerrit)
logerrit at kemper.freedesktop.org
Tue Dec 1 10:03:41 UTC 2020
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.klos at collabora.com>
AuthorDate: Wed Nov 4 11:37:15 2020 +0100
Commit: Szymon Kłos <szymon.klos at 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 <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Szymon Kłos <szymon.klos at 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);
More information about the Libreoffice-commits
mailing list