Resolves: tdf#126042 measure text width with the bold font it will render with
Change-Id: I81cc0351e652c632bd85efa6dacb36be66fcfb3c Reviewed-on: https://gerrit.libreoffice.org/78385 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
This commit is contained in:
@@ -444,11 +444,11 @@ void ExtensionBox_Impl::DrawRow(vcl::RenderContext& rRenderContext, const tools:
|
|||||||
nMaxTitleWidth -= nLinkWidth + (2 * SPACE_BETWEEN);
|
nMaxTitleWidth -= nLinkWidth + (2 * SPACE_BETWEEN);
|
||||||
}
|
}
|
||||||
long aVersionWidth = rRenderContext.GetTextWidth(rEntry->m_sVersion);
|
long aVersionWidth = rRenderContext.GetTextWidth(rEntry->m_sVersion);
|
||||||
long aTitleWidth = rRenderContext.GetTextWidth(rEntry->m_sTitle) + (aTextHeight / 3);
|
|
||||||
|
|
||||||
aPos = rRect.TopLeft() + Point(ICON_OFFSET, TOP_OFFSET);
|
aPos = rRect.TopLeft() + Point(ICON_OFFSET, TOP_OFFSET);
|
||||||
|
|
||||||
rRenderContext.SetFont(aBoldFont);
|
rRenderContext.SetFont(aBoldFont);
|
||||||
|
long aTitleWidth = rRenderContext.GetTextWidth(rEntry->m_sTitle) + (aTextHeight / 3);
|
||||||
if (aTitleWidth > nMaxTitleWidth - aVersionWidth)
|
if (aTitleWidth > nMaxTitleWidth - aVersionWidth)
|
||||||
{
|
{
|
||||||
aTitleWidth = nMaxTitleWidth - aVersionWidth - (aTextHeight / 3);
|
aTitleWidth = nMaxTitleWidth - aVersionWidth - (aTextHeight / 3);
|
||||||
|
Reference in New Issue
Block a user