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@allotropia.de>
diff --git a/sc/source/ui/condformat/condformatdlg.cxx b/sc/source/ui/condformat/condformatdlg.cxx
index 09432d8..4744b99 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 bf2d80f..aed63be 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;}