[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - sc/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Tue Mar 30 09:35:59 UTC 2021


 sc/source/ui/condformat/condformatdlg.cxx |    9 +++++++++
 sc/source/ui/inc/condformatdlgentry.hxx   |    1 +
 2 files changed, 10 insertions(+)

New commits:
commit f2cae3f0febc6f1909e14a4fd5060977fd096f00
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu Mar 18 14:21:22 2021 +0000
Commit:     Michael Stahl <michael.stahl at allotropia.de>
CommitDate: Tue Mar 30 11:35:25 2021 +0200

    tdf#118482 set a scroll step of the height of a collapsed entry
    
    Change-Id: I09ea056f6c2284afda5b387b6fdff3160bb7adc2
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112625
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.stahl at allotropia.de>

diff --git a/sc/source/ui/condformat/condformatdlg.cxx b/sc/source/ui/condformat/condformatdlg.cxx
index 09432d8f6454..4744b99e1125 100644
--- a/sc/source/ui/condformat/condformatdlg.cxx
+++ b/sc/source/ui/condformat/condformatdlg.cxx
@@ -177,6 +177,8 @@ void ScCondFormatList::RecalcAll()
     if (mbFrozen)
         return;
 
+    int nWheelScroll = SAL_MAX_INT32;
+
     sal_Int32 nIndex = 1;
     for (const auto& item : maEntries)
     {
@@ -184,8 +186,15 @@ void ScCondFormatList::RecalcAll()
             continue;
         item->SetIndex(nIndex);
         item->set_grid_top_attach(nIndex - 1);
+        nWheelScroll = std::min(nWheelScroll, item->get_preferred_height());
         ++nIndex;
     }
+
+    if (nWheelScroll != SAL_MAX_INT32)
+    {
+        // tdf#118482 set a scroll step of the height of a collapsed entry
+        mxScrollWindow->vadjustment_set_step_increment(nWheelScroll);
+    }
 }
 
 IMPL_LINK(ScCondFormatList, ColFormatTypeHdl, weld::ComboBox&, rBox, void)
diff --git a/sc/source/ui/inc/condformatdlgentry.hxx b/sc/source/ui/inc/condformatdlgentry.hxx
index bf2d80fba2e0..aed63be47729 100644
--- a/sc/source/ui/inc/condformatdlgentry.hxx
+++ b/sc/source/ui/inc/condformatdlgentry.hxx
@@ -77,6 +77,7 @@ public:
     void Show() { mxGrid->show(); }
 
     void set_grid_top_attach(int nAttach) { mxBorder->set_grid_top_attach(nAttach); }
+    int get_preferred_height() const { return mxBorder->get_preferred_size().Height(); }
 
     void SetPos(const ScAddress& rPos) { maPos = rPos; };
     bool IsSelected() const { return mbActive;}


More information about the Libreoffice-commits mailing list