diff options
author | Réka Csékei <reka.csekei@gmail.com> | 2018-11-20 12:26:34 +0100 |
---|---|---|
committer | Tamás Zolnai <tamas.zolnai@collabora.com> | 2018-11-20 14:48:58 +0100 |
commit | 4610388a6cccf45c232bcdfb67d45c0443058b9f (patch) | |
tree | 8f721c481218caea2457c98a48d7b930cf4b8dce /cui/source | |
parent | 5e2322ec84840df9e268a5d2855073912413d463 (diff) |
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@collabora.com>
Tested-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Diffstat (limited to 'cui/source')
-rw-r--r-- | cui/source/tabpages/numpages.cxx | 20 |
1 files changed, 15 insertions, 5 deletions
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))) |