[Libreoffice-commits] core.git: cui/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Tue Nov 20 13:49:24 UTC 2018
cui/source/tabpages/numpages.cxx | 20 +++++++++++++++-----
1 file changed, 15 insertions(+), 5 deletions(-)
New commits:
commit 4610388a6cccf45c232bcdfb67d45c0443058b9f
Author: Réka Csékei <reka.csekei at gmail.com>
AuthorDate: Tue Nov 20 12:26:34 2018 +0100
Commit: Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Tue Nov 20 14:48:58 2018 +0100
tdf#120563 Improve the preview of numbering with relative size
Fixes the preview on Customize tab page
Change-Id: If918522bda573c0f312b04592b4b7de957c9416b
Reviewed-on: https://gerrit.libreoffice.org/63649
Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>
Tested-by: Tamás Zolnai <tamas.zolnai at collabora.com>
diff --git a/cui/source/tabpages/numpages.cxx b/cui/source/tabpages/numpages.cxx
index 5904c18affcf..07b1c912bf7b 100644
--- a/cui/source/tabpages/numpages.cxx
+++ b/cui/source/tabpages/numpages.cxx
@@ -2436,23 +2436,33 @@ void SvxNumberingPreview::Paint(vcl::RenderContext& rRenderContext, const ::tool
}
else
{
- vcl::Font aColorFont(aStdFont);
+ vcl::Font aFont(aStdFont);
+ Size aTmpSize(aStdFont.GetFontSize());
+ aTmpSize.setWidth( aTmpSize.Width() * ( rFmt.GetBulletRelSize()) );
+ aTmpSize.setWidth( aTmpSize.Width() / 100 ) ;
+ aTmpSize.setHeight( aTmpSize.Height() * ( rFmt.GetBulletRelSize()) );
+ aTmpSize.setHeight( aTmpSize.Height() / 100 ) ;
+ if(!aTmpSize.Height())
+ aTmpSize.setHeight( 1 );
+ aFont.SetFontSize(aTmpSize);
Color aTmpBulletColor = rFmt.GetBulletColor();
if (aTmpBulletColor == COL_AUTO)
aTmpBulletColor = aBackColor.IsDark() ? COL_WHITE : COL_BLACK;
else if (aTmpBulletColor == aBackColor)
aTmpBulletColor.Invert();
- aColorFont.SetColor(aTmpBulletColor);
- pVDev->SetFont(aColorFont);
+ aFont.SetColor(aTmpBulletColor);
+ pVDev->SetFont(aFont);
aNum.SetLevel( nLevel );
if (pActNum->IsContinuousNumbering())
aNum.GetLevelVal()[nLevel] = nPreNum;
OUString aText(pActNum->MakeNumString(aNum));
- pVDev->DrawText(Point(nXStart, nYStart), aText);
- pVDev->SetFont(aStdFont);
+ long nY = nYStart;
+ nY -= (pVDev->GetTextHeight() - nTextHeight - pVDev->GetFontMetric().GetDescent());
+ pVDev->DrawText(Point(nXStart, nY), aText);
nTextOffset = pVDev->GetTextWidth(aText);
nTextOffset = nTextOffset + nXStep;
nPreNum++;
+ pVDev->SetFont(aStdFont);
}
//#i5153# the selected rectangle(s) should be black
if (0 != (nActLevel & (1<<nLevel)))
More information about the Libreoffice-commits
mailing list