/[packages]/updates/5/libreoffice/current/SOURCES/0001-only-date-autofilter-menus-need-the-space-for-the-tr.patch
ViewVC logotype

Contents of /updates/5/libreoffice/current/SOURCES/0001-only-date-autofilter-menus-need-the-space-for-the-tr.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1188168 - (show annotations) (download)
Sat Dec 30 21:57:44 2017 UTC (6 years, 3 months ago) by luigiwalser
File size: 3674 byte(s)
5.1.6 (sync with f24)
1 From be0566097f3047a3f166f5192c58b40289f683b0 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
3 Date: Thu, 29 Sep 2016 10:09:02 +0100
4 Subject: [PATCH] only date autofilter menus need the space for the tree
5 expanders
6
7 so for lists that don't include dates then drop the tree view bits
8 to save space to the left of the entries
9
10 (cherry picked from commit 17f749afd75c407bf7adae9b8e15276de14ef5d5)
11
12 Change-Id: I44f624d8a06d578674806813239a408466c87d70
13 ---
14 sc/source/ui/cctrl/checklistmenu.cxx | 14 ++++++++++----
15 sc/source/ui/inc/checklistmenu.hxx | 1 +
16 sc/source/ui/view/gridwin.cxx | 1 +
17 3 files changed, 12 insertions(+), 4 deletions(-)
18
19 diff --git a/sc/source/ui/cctrl/checklistmenu.cxx b/sc/source/ui/cctrl/checklistmenu.cxx
20 index 9d3298e..2b2c35f 100644
21 --- a/sc/source/ui/cctrl/checklistmenu.cxx
22 +++ b/sc/source/ui/cctrl/checklistmenu.cxx
23 @@ -877,7 +877,7 @@ void ScCheckListMenuWindow::CancelButton::Click()
24 ScCheckListMenuWindow::ScCheckListMenuWindow(vcl::Window* pParent, ScDocument* pDoc) :
25 ScMenuFloatingWindow(pParent, pDoc),
26 maEdSearch(VclPtr<Edit>::Create(this)),
27 - maChecks(VclPtr<ScCheckListBox>::Create(this, WB_HASBUTTONS | WB_HASLINES | WB_HASLINESATROOT | WB_HASBUTTONSATROOT) ),
28 + maChecks(VclPtr<ScCheckListBox>::Create(this, 0)),
29 maChkToggleAll(VclPtr<TriStateBox>::Create(this, 0)),
30 maBtnSelectSingle(VclPtr<ImageButton>::Create(this, 0)),
31 maBtnUnselectSingle(VclPtr<ImageButton>::Create(this, 0)),
32 @@ -903,9 +903,6 @@ ScCheckListMenuWindow::ScCheckListMenuWindow(vcl::Window* pParent, ScDocument* p
33 maTabStopCtrls.push_back(maBtnUnselectSingle.get());
34 maTabStopCtrls.push_back(maBtnOk.get());
35 maTabStopCtrls.push_back(maBtnCancel.get());
36 -
37 - // Enable type-ahead search in the check list box.
38 - maChecks->SetStyle(maChecks->GetStyle() | WB_QUICK_SEARCH);
39 }
40
41 ScCheckListMenuWindow::~ScCheckListMenuWindow()
42 @@ -1726,6 +1723,15 @@ void ScCheckListBox::KeyInput( const KeyEvent& rKEvt )
43 SvTreeListBox::KeyInput( rKEvt );
44 }
45
46 +void ScCheckListMenuWindow::setHasDates(bool bHasDates)
47 +{
48 + // WB_QUICK_SEARCH Enables type-ahead search in the check list box.
49 + if (bHasDates)
50 + maChecks->SetStyle(WB_QUICK_SEARCH | WB_HASBUTTONS | WB_HASLINES | WB_HASLINESATROOT | WB_HASBUTTONSATROOT);
51 + else
52 + maChecks->SetStyle(WB_QUICK_SEARCH | WB_HASBUTTONS);
53 +}
54 +
55 void ScCheckListMenuWindow::initMembers()
56 {
57 size_t n = maMembers.size();
58 diff --git a/sc/source/ui/inc/checklistmenu.hxx b/sc/source/ui/inc/checklistmenu.hxx
59 index 9f7587a..cdd428f 100644
60 --- a/sc/source/ui/inc/checklistmenu.hxx
61 +++ b/sc/source/ui/inc/checklistmenu.hxx
62 @@ -276,6 +276,7 @@ public:
63 virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessible() override;
64
65 void setMemberSize(size_t n);
66 + void setHasDates(bool bHasDates);
67 void addDateMember(const OUString& rName, double nVal, bool bVisible);
68 void addMember(const OUString& rName, bool bVisible);
69 void initMembers();
70 diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
71 index 5c185bb..dc4c3d9 100644
72 --- a/sc/source/ui/view/gridwin.cxx
73 +++ b/sc/source/ui/view/gridwin.cxx
74 @@ -739,6 +739,7 @@ void ScGridWindow::LaunchAutoFilterMenu(SCCOL nCol, SCROW nRow)
75 std::vector<ScTypedStrData> aStrings;
76 pDoc->GetFilterEntries(nCol, nRow, nTab, true, aStrings, bHasDates);
77
78 + mpAutoFilterPopup->setHasDates(bHasDates);
79 mpAutoFilterPopup->setMemberSize(aStrings.size());
80 std::vector<ScTypedStrData>::const_iterator it = aStrings.begin(), itEnd = aStrings.end();
81 for (; it != itEnd; ++it)
82 --
83 2.7.4
84

  ViewVC Help
Powered by ViewVC 1.1.30