tdf#159865 Revert "tdf#136905 NBB: let ValueSetWithTextControl set optimal"

...height

This reverts my 24.2 commit 1876feb8a8805b2f80537e2828c152ccbdf67fe2
(as well as my initial attempt to fix it in 24.8).

Change-Id: I70c3668393a13992f9ce489e86b07860218445b6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163954
Tested-by: Justin Luth <jluth@mail.com>
Reviewed-by: Justin Luth <jluth@mail.com>
diff --git a/include/svx/sidebar/ValueSetWithTextControl.hxx b/include/svx/sidebar/ValueSetWithTextControl.hxx
index 407e960..ac397f9 100644
--- a/include/svx/sidebar/ValueSetWithTextControl.hxx
+++ b/include/svx/sidebar/ValueSetWithTextControl.hxx
@@ -40,7 +40,6 @@ public:

    SVX_DLLPRIVATE virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override;

    void SetOptimalDrawingAreaHeight();
    void AddItem(const OUString& rItemText, const OUString& rItemText2);

    SVX_DLLPRIVATE virtual void UserDraw(const UserDrawEvent& rUDEvt) override;
diff --git a/svx/source/sidebar/tools/ValueSetWithTextControl.cxx b/svx/source/sidebar/tools/ValueSetWithTextControl.cxx
index d557403..cddd7b0 100644
--- a/svx/source/sidebar/tools/ValueSetWithTextControl.cxx
+++ b/svx/source/sidebar/tools/ValueSetWithTextControl.cxx
@@ -42,17 +42,6 @@ void ValueSetWithTextControl::SetDrawingArea(weld::DrawingArea* pDrawingArea)
    SetColCount();
}

void ValueSetWithTextControl::SetOptimalDrawingAreaHeight()
{
    const vcl::Font aFont(Application::GetSettings().GetStyleSettings().GetLabelFont());
    double fRowHeight = aFont.GetFontSize().Height() * 9 / 4.0; // see UserDraw()
    // It still looks too small. Probably the height specified should be the leading point size?
    fRowHeight *= 1.2; // add 20% leading
    const Size aSize(GetOutputSizePixel().Width(), fRowHeight * maItems.size());
    GetDrawingArea()->set_size_request(aSize.Width(), aSize.Height());
    SetOutputSizePixel(aSize);
}

void ValueSetWithTextControl::AddItem(
    const OUString& rItemText,
    const OUString& rItemText2 )
diff --git a/sw/source/uibase/sidebar/PageSizeControl.cxx b/sw/source/uibase/sidebar/PageSizeControl.cxx
index 2591ffd..37ed183 100644
--- a/sw/source/uibase/sidebar/PageSizeControl.cxx
+++ b/sw/source/uibase/sidebar/PageSizeControl.cxx
@@ -168,7 +168,6 @@ PageSizeControl::PageSizeControl(PageSizePopup* pControl, weld::Widget* pParent)
    }
    mxSizeValueSet->SetNoSelection();
    mxSizeValueSet->SetSelectHdl( LINK(this, PageSizeControl, ImplSizeHdl ) );
    mxSizeValueSet->SetOptimalDrawingAreaHeight();
    mxSizeValueSet->Show();
    mxSizeValueSet->Resize();