sc/source/ui/cctrl/checklistmenu.cxx |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 360e50fbc8bf55a52a0b9cee424ca5c6c5996e16
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Tue Nov 30 14:08:35 2021 +0000
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Wed Dec 1 09:43:14 2021 +0100

    make autofilter a row shorter, now it has extra menu items
    
    for the filter by color options, which have pushed its height up taller
    than it used to be.  I think it would be better to make more submenus
    here to shrink its height down further, but that's not attempted here.
    
    Change-Id: Idb484bd77d2cca6e175d997955b0967720d94ec6
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126106
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/sc/source/ui/cctrl/checklistmenu.cxx 
b/sc/source/ui/cctrl/checklistmenu.cxx
index 80a312b75194..efb4ab7dd2ce 100644
--- a/sc/source/ui/cctrl/checklistmenu.cxx
+++ b/sc/source/ui/cctrl/checklistmenu.cxx
@@ -438,6 +438,8 @@ ScCheckListMember::ScCheckListMember()
 
 // the value of border-width of FilterDropDown
 constexpr int nBorderWidth = 4;
+// number of rows visible in checklist
+constexpr int nCheckListVisibleRows = 8;
 
 ScCheckListMenuControl::ScCheckListMenuControl(weld::Widget* pParent,
                                                ScDocument* pDoc, bool 
bCanHaveSubMenu,
@@ -501,7 +503,7 @@ 
ScCheckListMenuControl::ScCheckListMenuControl(weld::Widget* pParent,
         mpChecks = mxListChecks.get();
     }
 
-    int nChecksHeight = mxTreeChecks->get_height_rows(9);
+    int nChecksHeight = mxTreeChecks->get_height_rows(nCheckListVisibleRows);
     if (nWidth != -1)
     {
         mnCheckWidthReq = nWidth - nBorderWidth * 2 - 4;
@@ -1429,7 +1431,7 @@ int 
ScCheckListMenuControl::IncreaseWindowWidthToFitText(int nMaxTextWidth)
     if (nNewWidth > mnCheckWidthReq)
     {
         mnCheckWidthReq = nNewWidth;
-        int nChecksHeight = mpChecks->get_height_rows(9);
+        int nChecksHeight = mpChecks->get_height_rows(nCheckListVisibleRows);
         mpChecks->set_size_request(mnCheckWidthReq, nChecksHeight);
     }
     return mnCheckWidthReq + nBorder;

Reply via email to