tdf#151682 Fix gap above input bar
Remove vertical offset, looks like it's not needed anymore.
Change-Id: If0f7f7dce7a7e4249036930b60fe353890b495fc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146179
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
(cherry picked from commit f7544650cc4e31da67873898e2d587afa846b9b4)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146199
Reviewed-by: Kohei Yoshida <kohei@libreoffice.org>
diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index 14ef498..14249fe 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -495,7 +495,7 @@ void ScInputWindow::Resize()
if (pGroupBar->GetNumLines() > 1)
{
Size aGroupBarSize = pGroupBar->GetSizePixel();
aSize.setHeight(aGroupBarSize.Height() + 2 * (pGroupBar->GetVertOffset() + 1));
aSize.setHeight(aGroupBarSize.Height());
}
}
SetSizePixel(aSize);
@@ -847,7 +847,6 @@ ScInputBarGroup::ScInputBarGroup(vcl::Window* pParent, ScTabViewShell* pViewSh)
, mxTextWndGroup(new ScTextWndGroup(*this, pViewSh))
, mxButtonUp(m_xBuilder->weld_button("up"))
, mxButtonDown(m_xBuilder->weld_button("down"))
, mnVertOffset(0)
{
InitControlBase(m_xContainer.get());
@@ -1083,12 +1082,6 @@ void ScInputBarGroup::TriggerToolboxLayout()
ScInputWindow &rParent = dynamic_cast<ScInputWindow&>(*w);
SfxViewFrame* pViewFrm = SfxViewFrame::Current();
// Capture the vertical position of this window in the toolbar, when we increase
// the size of the toolbar to accommodate expanded line input we need to take this
// into account
if ( !mnVertOffset )
mnVertOffset = rParent.GetItemPosRect( rParent.GetItemCount() - 1 ).Top();
if ( !pViewFrm )
return;
diff --git a/sc/source/ui/inc/inputwin.hxx b/sc/source/ui/inc/inputwin.hxx
index 12bc461f..ac96062 100644
--- a/sc/source/ui/inc/inputwin.hxx
+++ b/sc/source/ui/inc/inputwin.hxx
@@ -262,7 +262,6 @@ public:
void DecrementVerticalSize();
void NumLinesChanged();
virtual tools::Long GetNumLines() const override { return mxTextWndGroup->GetNumLines(); }
tools::Long GetVertOffset() const { return mnVertOffset; }
int GetPixelHeightForLines() const
{
@@ -278,7 +277,6 @@ private:
std::unique_ptr<ScTextWndGroup> mxTextWndGroup;
std::unique_ptr<weld::Button> mxButtonUp;
std::unique_ptr<weld::Button> mxButtonDown;
tools::Long mnVertOffset;
DECL_LINK(ClickHdl, weld::Button&, void);
};