[Libreoffice-commits] core.git: Branch 'feature/eszka' - include/vcl sc/source vcl/inc vcl/jsdialog
Szymon KÅos (via logerrit)
logerrit at kemper.freedesktop.org
Fri Nov 20 15:45:38 UTC 2020
include/vcl/jsdialog/executor.hxx | 2 +
sc/source/ui/cctrl/checklistmenu.cxx | 36 +++++++++++++++++++++++++++++++++--
sc/source/ui/view/gridwin2.cxx | 8 ++++++-
vcl/inc/jsdialog/jsdialogbuilder.hxx | 1
vcl/jsdialog/executor.cxx | 1
5 files changed, 45 insertions(+), 3 deletions(-)
New commits:
commit ce7200240228a31a12954d1373686972d4c34142
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: Fri Nov 20 16:26:42 2020 +0100
autofilter: fix submenu popup for online
Change-Id: If48428f99b921d3c6f9927c612e6ade81b980678
diff --git a/include/vcl/jsdialog/executor.hxx b/include/vcl/jsdialog/executor.hxx
index 1282c3dcc48c..6dd4ca896461 100644
--- a/include/vcl/jsdialog/executor.hxx
+++ b/include/vcl/jsdialog/executor.hxx
@@ -46,6 +46,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 0df3819e686c..deeb987ee806 100644
--- a/sc/source/ui/cctrl/checklistmenu.cxx
+++ b/sc/source/ui/cctrl/checklistmenu.cxx
@@ -34,6 +34,8 @@
#include <unotools/charclass.hxx>
#include <comphelper/lok.hxx>
#include <LibreOfficeKit/LibreOfficeKitEnums.h>
+#include <sfx2/viewsh.hxx>
+#include <vcl/jsdialog/executor.hxx>
#include <document.hxx>
@@ -169,8 +171,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);
@@ -287,6 +295,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)
@@ -515,6 +533,8 @@ ScCheckListMenuControl::ScCheckListMenuControl(ScCheckListMenuWindow* pParent, v
mxMenu->connect_size_allocate(LINK(this, ScCheckListMenuControl, TreeSizeAllocHdl));
}
+ long nContainerHeight = mxContainer->get_preferred_size().Height() + nDiffHeight;
+
if (!bIsSubMenu)
{
// determine what width the checklist will end up with
@@ -524,9 +544,21 @@ ScCheckListMenuControl::ScCheckListMenuControl(ScCheckListMenuWindow* pParent, v
mxTreeChecks->set_size_request(mnCheckWidthReq, nChecksHeight);
mxListChecks->set_size_request(mnCheckWidthReq, nChecksHeight);
}
+ else
+ {
+ long nMenuWidth = mxMenu->get_preferred_size().Width();
+ long nMenuHeight = mxMenu->get_preferred_size().Height();
+
+ if (nMenuWidth < 200)
+ nMenuWidth = 200;
+ if (nMenuHeight < nContainerHeight * 90 / 100)
+ nMenuHeight = nContainerHeight * 90 / 100;
+
+ mxMenu->set_size_request(nMenuWidth, nMenuHeight);
+ }
mxContainer->set_size_request(mxContainer->get_preferred_size().Width(),
- mxContainer->get_preferred_size().Height() + nDiffHeight);
+ nContainerHeight);
}
IMPL_LINK_NOARG(ScCheckListMenuControl, FocusHdl, weld::Widget&, void)
diff --git a/sc/source/ui/view/gridwin2.cxx b/sc/source/ui/view/gridwin2.cxx
index e09017bcc068..ab28af6f63bc 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, pViewData->GetDocument(),
- bDimOrientNotPage, false));
+ bDimOrientNotPage, false, -1,
+ nullptr, pNotifier));
ScCheckListMenuControl& rControl = mpDPFieldPopup->get_widget();
rControl.setExtendedData(std::move(pDPData));
diff --git a/vcl/inc/jsdialog/jsdialogbuilder.hxx b/vcl/inc/jsdialog/jsdialogbuilder.hxx
index 45da94abfb33..1878b7ff739d 100644
--- a/vcl/inc/jsdialog/jsdialogbuilder.hxx
+++ b/vcl/inc/jsdialog/jsdialogbuilder.hxx
@@ -204,6 +204,7 @@ public:
notifyDialogState();
}
+ using BaseInstanceClass::set_sensitive;
virtual void set_sensitive(bool sensitive) override
{
BaseInstanceClass::set_sensitive(sensitive);
diff --git a/vcl/jsdialog/executor.cxx b/vcl/jsdialog/executor.cxx
index 0d8e1f121ced..b28612287c59 100644
--- a/vcl/jsdialog/executor.cxx
+++ b/vcl/jsdialog/executor.cxx
@@ -186,6 +186,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