Kaydet (Commit) 22483728 authored tarafından Noel Grandin's avatar Noel Grandin

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: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 20831ee1
......@@ -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 );
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment