summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.com>2015-12-01 17:44:23 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-12-04 13:37:15 +0000
commit52fe817a32bf69417563e0b66d451e8fca19d212 (patch)
treea156b159291e835f1b4a63a6653d8125b027ae24
parenteea70492fb19b2dbd6edc0c37a2b0ed81b3ead5c (diff)
tdf#94138 Use correct fonts for multiline edit when printing
When drawing a multiline edit we need to use a different device (current window) to get the correct font and adjust for the Draw method's input device. Change-Id: I7993790c02d10e4283c7a4e2caefff0c7747e978 (cherry picked from commit 6c41727484a04ab89005ffb052937dae5d7dc223) Reviewed-on: https://gerrit.libreoffice.org/20332 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
-rw-r--r--vcl/source/edit/vclmedit.cxx10
1 files changed, 8 insertions, 2 deletions
diff --git a/vcl/source/edit/vclmedit.cxx b/vcl/source/edit/vclmedit.cxx
index b6044dc6ab25..525f847ab8ed 100644
--- a/vcl/source/edit/vclmedit.cxx
+++ b/vcl/source/edit/vclmedit.cxx
@@ -1362,11 +1362,17 @@ void VclMultiLineEdit::DataChanged( const DataChangedEvent& rDCEvt )
void VclMultiLineEdit::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags )
{
- ImplInitSettings( true, true, true );
+ ImplInitSettings(true, true, true);
Point aPos = pDev->LogicToPixel( rPos );
Size aSize = pDev->LogicToPixel( rSize );
- vcl::Font aFont = pImpVclMEdit->GetTextWindow()->GetDrawPixelFont( pDev );
+
+ vcl::Font aFont = pImpVclMEdit->GetTextWindow()->GetPointFont(*this);
+ Size aFontSize = aFont.GetSize();
+ MapMode aPtMapMode(MAP_POINT);
+ aFontSize = pDev->LogicToPixel(aFontSize, aPtMapMode);
+ aFont.SetSize(aFontSize);
+
aFont.SetTransparent( true );
OutDevType eOutDevType = pDev->GetOutDevType();