diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-11-08 16:05:32 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-11-09 06:42:20 +0100 |
commit | 224837289cb6c6753026173b35142b10e7e1538e (patch) | |
tree | bd027a62f0c45b600f328f5f8defd6620bc5fcce | |
parent | 20831ee1c0c856904cdd4fae4a9a55ecc885d04d (diff) |
fix bug in listbox height calc in ExtensionBox_Impl
found by loplugin:singlevalfields
Change-Id: Ide29da9222c8323e87fe640bd3548306c1778919
Reviewed-on: https://gerrit.libreoffice.org/63125
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | desktop/source/deployment/gui/dp_gui_extlistbox.cxx | 9 | ||||
-rw-r--r-- | desktop/source/deployment/gui/dp_gui_extlistbox.hxx | 1 |
2 files changed, 4 insertions, 6 deletions
diff --git a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx index e8442a20f8a1..b09ce623127f 100644 --- a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx +++ b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx @@ -183,7 +183,6 @@ ExtensionBox_Impl::ExtensionBox_Impl(vcl::Window* pParent) : m_nActive( 0 ), m_nTopIndex( 0 ), m_nActiveHeight( 0 ), - m_nExtraHeight( 2 ), m_aSharedImage(BitmapEx(RID_BMP_SHARED)), m_aLockedImage(BitmapEx(RID_BMP_LOCKED)), m_aWarningImage(BitmapEx(RID_BMP_WARNING)), @@ -314,10 +313,10 @@ void ExtensionBox_Impl::CalcActiveHeight( const long nPos ) if ( aTextHeight < m_nStdHeight ) aTextHeight = m_nStdHeight; + m_nActiveHeight = aTextHeight; + if ( m_vEntries[ nPos ]->m_bHasButtons ) - m_nActiveHeight = aTextHeight + m_nExtraHeight; - else - m_nActiveHeight = aTextHeight + 2; + m_nActiveHeight += 2; } tools::Rectangle ExtensionBox_Impl::GetEntryRect( const long nPos ) const @@ -530,7 +529,7 @@ void ExtensionBox_Impl::DrawRow(vcl::RenderContext& rRenderContext, const tools: long nExtraHeight = 0; if (rEntry->m_bHasButtons) - nExtraHeight = m_nExtraHeight; + nExtraHeight = 2; rRenderContext.DrawText(tools::Rectangle(aPos.X(), aPos.Y(), rRect.Right(), rRect.Bottom() - nExtraHeight), sDescription, DrawTextFlags::MultiLine | DrawTextFlags::WordBreak ); diff --git a/desktop/source/deployment/gui/dp_gui_extlistbox.hxx b/desktop/source/deployment/gui/dp_gui_extlistbox.hxx index 356a4ff2e238..abe69cf87623 100644 --- a/desktop/source/deployment/gui/dp_gui_extlistbox.hxx +++ b/desktop/source/deployment/gui/dp_gui_extlistbox.hxx @@ -118,7 +118,6 @@ class ExtensionBox_Impl : public ::svt::IExtensionListBox long m_nTopIndex; long m_nStdHeight; long m_nActiveHeight; - long m_nExtraHeight; Image m_aSharedImage; Image m_aLockedImage; Image m_aWarningImage; |