Resolves: tdf#147722 ScrolledWindow expands beyond buttonbox

Change-Id: Iaf65bf681739c7fc2c7cb14851621442a861c234
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131108
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
diff --git a/sc/source/ui/dbgui/tpsort.cxx b/sc/source/ui/dbgui/tpsort.cxx
index 51f8b64..0cbd1c3 100644
--- a/sc/source/ui/dbgui/tpsort.cxx
+++ b/sc/source/ui/dbgui/tpsort.cxx
@@ -90,6 +90,11 @@ ScTabPageSortFields::ScTabPageSortFields(weld::Container* pPage, weld::DialogCon
    , m_xBox(m_xBuilder->weld_container("SortKeyWindow"))
    , m_aSortWin(m_xBox.get())
{
    // tdf#147722 set some nominal small default height so the height adapts
    // to all the other contents and the natural height of this widget isn't
    // an input into the overall size
    m_xScrolledWindow->set_size_request(-1, 42);

    Init();

    m_aIdle.SetInvokeHandler(LINK(this, ScTabPageSortFields, ScrollToEndHdl));
diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx
index 995ae09..5cd885e 100644
--- a/vcl/source/window/layout.cxx
+++ b/vcl/source/window/layout.cxx
@@ -285,7 +285,7 @@ void VclBox::setAllocation(const Size &rAllocation)
// when it gets negative, it shrinks instead of expands and it becomes invisible
        if (nExtraSpace < 0)
        {
            SAL_WARN("vcl.layout", "nExtraSpace went negative, setting to zero");
            SAL_WARN("vcl.layout", "nExtraSpace went negative, setting to zero for VclBox: " << GetHelpId());
            nExtraSpace = 0;
        }
    }