[Libreoffice-commits] core.git: include/vcl sc/source vcl/jsdialog
Szymon KÅos (via logerrit)
logerrit at kemper.freedesktop.org
Mon Nov 30 14:05:00 UTC 2020
include/vcl/jsdialog/executor.hxx | 2 ++
sc/source/ui/cctrl/checklistmenu.cxx | 20 +++++++++++++++++++-
sc/source/ui/view/gridwin2.cxx | 8 +++++++-
vcl/jsdialog/executor.cxx | 1 +
4 files changed, 29 insertions(+), 2 deletions(-)
New commits:
commit 73c0218956dcfd6730610f856b9d5d9ac376efd7
Author: Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Fri Nov 20 12:23:45 2020 +0100
Commit: Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Mon Nov 30 15:04:17 2020 +0100
autofilter: fix submenu popup for online
Change-Id: If48428f99b921d3c6f9927c612e6ade81b980678
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106847
Tested-by: Jenkins
Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
diff --git a/include/vcl/jsdialog/executor.hxx b/include/vcl/jsdialog/executor.hxx
index 5dde733a3823..038b86b30f64 100644
--- a/include/vcl/jsdialog/executor.hxx
+++ b/include/vcl/jsdialog/executor.hxx
@@ -29,6 +29,8 @@ public:
rTreeView.signal_row_activated();
}
+ static void trigger_changed(weld::TreeView& rTreeView) { rTreeView.signal_changed(); }
+
static void trigger_clicked(weld::Toolbar& rToolbar, const OString& rIdent)
{
rToolbar.signal_clicked(rIdent);
diff --git a/sc/source/ui/cctrl/checklistmenu.cxx b/sc/source/ui/cctrl/checklistmenu.cxx
index 319d2ef9089c..b9f51cb84471 100644
--- a/sc/source/ui/cctrl/checklistmenu.cxx
+++ b/sc/source/ui/cctrl/checklistmenu.cxx
@@ -32,6 +32,8 @@
#include <comphelper/lok.hxx>
#include <LibreOfficeKit/LibreOfficeKitEnums.h>
#include <tools/json_writer.hxx>
+#include <sfx2/viewsh.hxx>
+#include <vcl/jsdialog/executor.hxx>
#include <document.hxx>
@@ -167,8 +169,14 @@ ScCheckListMenuWindow* ScCheckListMenuControl::addSubMenuItem(const OUString& rT
MenuItemData aItem;
aItem.mbEnabled = bEnabled;
vcl::Window *pContainer = mxFrame->GetWindow(GetWindowType::FirstChild);
+
+ vcl::ILibreOfficeKitNotifier* pNotifier = nullptr;
+ if (comphelper::LibreOfficeKit::isActive())
+ pNotifier = SfxViewShell::Current();
+
aItem.mxSubMenuWin.reset(VclPtr<ScCheckListMenuWindow>::Create(pContainer, mpDoc, false,
- false, -1, mxFrame.get()));
+ false, -1, mxFrame.get(),
+ pNotifier));
maMenuItems.emplace_back(std::move(aItem));
mxMenu->append_text(rText);
@@ -285,6 +293,16 @@ void ScCheckListMenuControl::launchSubMenu(bool bSetMenuPos)
mxMenu->select(*mxScratchIter);
rSubMenuControl.GrabFocus();
+
+ // TODO: something better to retrigger JSON dialog invalidation
+ if (comphelper::LibreOfficeKit::isActive())
+ {
+ StringMap args;
+ args["cmd"] = "change";
+ args["type"] = "checkbox";
+ args["data"] = "true";
+ jsdialog::ExecuteAction(pSubMenu->GetLOKWindowId(), "toggle_all", args);
+ }
}
IMPL_LINK_NOARG(ScCheckListMenuControl, PostPopdownHdl, void*, void)
diff --git a/sc/source/ui/view/gridwin2.cxx b/sc/source/ui/view/gridwin2.cxx
index efb952dc7721..d71741cda2bc 100644
--- a/sc/source/ui/view/gridwin2.cxx
+++ b/sc/source/ui/view/gridwin2.cxx
@@ -467,8 +467,14 @@ void ScGridWindow::DPLaunchFieldPopupMenu(const Point& rScrPos, const Size& rScr
const ScDPLabelData& rLabelData = pDPData->maLabels;
mpDPFieldPopup.disposeAndClear();
+
+ vcl::ILibreOfficeKitNotifier* pNotifier = nullptr;
+ if (comphelper::LibreOfficeKit::isActive())
+ pNotifier = SfxViewShell::Current();
+
mpDPFieldPopup.reset(VclPtr<ScCheckListMenuWindow>::Create(this, &mrViewData.GetDocument(),
- bDimOrientNotPage, false));
+ bDimOrientNotPage, false, -1,
+ nullptr, pNotifier));
ScCheckListMenuControl& rControl = mpDPFieldPopup->get_widget();
rControl.setExtendedData(std::move(pDPData));
diff --git a/vcl/jsdialog/executor.cxx b/vcl/jsdialog/executor.cxx
index 83d19fd7b657..b2103fbe865f 100644
--- a/vcl/jsdialog/executor.cxx
+++ b/vcl/jsdialog/executor.cxx
@@ -205,6 +205,7 @@ bool ExecuteAction(sal_uInt64 nWindowId, const OString& rWidget, StringMap& rDat
int nRow = std::atoi(nRowString.getStr());
pTreeView->select(nRow);
+ LOKTrigger::trigger_changed(*pTreeView);
LOKTrigger::trigger_row_activated(*pTreeView);
return true;
}
More information about the Libreoffice-commits
mailing list