From 4f75136b7cfc10b97000acc914633ed52f834b0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Thu, 29 Sep 2016 10:16:38 +0100 Subject: [PATCH] only date autofilter menus need the space for the tree expanders --- ...lter-menus-need-the-space-for-the-tr.patch | 82 +++++++++++++++++++ libreoffice.spec | 1 + 2 files changed, 83 insertions(+) create mode 100644 0001-only-date-autofilter-menus-need-the-space-for-the-tr.patch diff --git a/0001-only-date-autofilter-menus-need-the-space-for-the-tr.patch b/0001-only-date-autofilter-menus-need-the-space-for-the-tr.patch new file mode 100644 index 0000000..8c81a2a --- /dev/null +++ b/0001-only-date-autofilter-menus-need-the-space-for-the-tr.patch @@ -0,0 +1,82 @@ +From 17f749afd75c407bf7adae9b8e15276de14ef5d5 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Thu, 29 Sep 2016 10:09:02 +0100 +Subject: [PATCH] only date autofilter menus need the space for the tree + expanders + +so for lists that don't include dates then drop the tree view bits +to save space to the left of the entries + +Change-Id: I44f624d8a06d578674806813239a408466c87d70 +--- + sc/source/ui/cctrl/checklistmenu.cxx | 14 ++++++++++---- + sc/source/ui/inc/checklistmenu.hxx | 1 + + sc/source/ui/view/gridwin.cxx | 1 + + 3 files changed, 12 insertions(+), 4 deletions(-) + +diff --git a/sc/source/ui/cctrl/checklistmenu.cxx b/sc/source/ui/cctrl/checklistmenu.cxx +index a017cda..0b5174e 100644 +--- a/sc/source/ui/cctrl/checklistmenu.cxx ++++ b/sc/source/ui/cctrl/checklistmenu.cxx +@@ -877,7 +877,7 @@ void ScCheckListMenuWindow::CancelButton::Click() + ScCheckListMenuWindow::ScCheckListMenuWindow(vcl::Window* pParent, ScDocument* pDoc) : + ScMenuFloatingWindow(pParent, pDoc), + maEdSearch(VclPtr::Create(this)), +- maChecks(VclPtr::Create(this, WB_HASBUTTONS | WB_HASLINES | WB_HASLINESATROOT | WB_HASBUTTONSATROOT) ), ++ maChecks(VclPtr::Create(this)), + maChkToggleAll(VclPtr::Create(this, 0)), + maBtnSelectSingle(VclPtr::Create(this, 0)), + maBtnUnselectSingle(VclPtr::Create(this, 0)), +@@ -905,9 +905,6 @@ ScCheckListMenuWindow::ScCheckListMenuWindow(vcl::Window* pParent, ScDocument* p + + maEdSearch->SetTabStopsContainer( &maTabStops ); + maChecks->SetTabStopsContainer( &maTabStops ); +- +- // Enable type-ahead search in the check list box. +- maChecks->SetStyle(maChecks->GetStyle() | WB_QUICK_SEARCH); + } + + ScCheckListMenuWindow::~ScCheckListMenuWindow() +@@ -1831,6 +1828,15 @@ void ScSearchEdit::MouseButtonDown(const MouseEvent& rMEvt) + mpTabStops->SetTabStop( this ); + } + ++void ScCheckListMenuWindow::setHasDates(bool bHasDates) ++{ ++ // WB_QUICK_SEARCH Enables type-ahead search in the check list box. ++ if (bHasDates) ++ maChecks->SetStyle(WB_QUICK_SEARCH | WB_HASBUTTONS | WB_HASLINES | WB_HASLINESATROOT | WB_HASBUTTONSATROOT); ++ else ++ maChecks->SetStyle(WB_QUICK_SEARCH | WB_HASBUTTONS); ++} ++ + void ScCheckListMenuWindow::initMembers() + { + size_t n = maMembers.size(); +diff --git a/sc/source/ui/inc/checklistmenu.hxx b/sc/source/ui/inc/checklistmenu.hxx +index 6994bc1..856a607 100644 +--- a/sc/source/ui/inc/checklistmenu.hxx ++++ b/sc/source/ui/inc/checklistmenu.hxx +@@ -325,6 +325,7 @@ public: + virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessible() override; + + void setMemberSize(size_t n); ++ void setHasDates(bool bHasDates); + void addDateMember(const OUString& rName, double nVal, bool bVisible); + void addMember(const OUString& rName, bool bVisible); + void initMembers(); +diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx +index 6e4338c..34a4914 100644 +--- a/sc/source/ui/view/gridwin.cxx ++++ b/sc/source/ui/view/gridwin.cxx +@@ -714,6 +714,7 @@ void ScGridWindow::LaunchAutoFilterMenu(SCCOL nCol, SCROW nRow) + std::vector aStrings; + pDoc->GetFilterEntries(nCol, nRow, nTab, aStrings, bHasDates); + ++ mpAutoFilterPopup->setHasDates(bHasDates); + mpAutoFilterPopup->setMemberSize(aStrings.size()); + std::vector::const_iterator it = aStrings.begin(), itEnd = aStrings.end(); + for (; it != itEnd; ++it) +-- +2.7.4 + diff --git a/libreoffice.spec b/libreoffice.spec index 9d73cca..e1baded 100644 --- a/libreoffice.spec +++ b/libreoffice.spec @@ -247,6 +247,7 @@ Patch16: 0001-Related-rhbz-1353069-don-t-clear-XATTR_FILL-from-sty.patch Patch17: 0001-Resolves-tdf-102293-triple-click-results-in-visually.patch Patch18: 0001-Related-rhbz-1362451-avoid-recursive-ownerchanged-ha.patch Patch19: 0001-fix-build-on-32-bit-ARM-on-latest-Rawhide.patch +Patch20: 0001-only-date-autofilter-menus-need-the-space-for-the-tr.patch %if 0%{?rhel} # not upstreamed