diff options
author | Caolán McNamara <caolanm@redhat.com> | 2016-08-04 12:12:40 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2016-08-04 15:00:37 +0100 |
commit | 5a5db03acc605a02c76c0f2977079b3dcf48de22 (patch) | |
tree | 41823a00f69bb557257dd69f447be9042734116c | |
parent | c63aaa624aa6e949e127fb8ef00c4f3744c72b76 (diff) |
Resolves: tdf#97120 printing controls uses wrong font and font sizes
regression apparently since
commit 825b3df7f1d987021ec4a08ff8e7ed78e5772c97
Date: Thu Oct 22 19:03:01 2015 +0200
tdf#94138 fix printing of edit form fields
revert the GetDrawPixelFont part of that so the font is pulled
from the control and not the device its printed to, this makes
tdf#97120 and tdf#97120 work properly again
then revert
commit 6c41727484a04ab89005ffb052937dae5d7dc223
Date: Tue Dec 1 17:44:23 2015 +0100
tdf#94138 Use correct fonts for multiline edit when printing
because that replicates the original GetDrawPixelFont behaviour
so its not needed after the other revert.
Then, to solve the original tdf#94138, in the edit StateChanged handler call
ApplySettings(*this); like FixedText::StateChanged does to merge in the
controlfont setting to the underlying OutputDevice of the control, which
presumably is what is then retrieved from GetDrawPixelFont
Change-Id: I992a0e2011ffce7748d39f7f2bc49fbf6b8eaa79
-rw-r--r-- | vcl/source/control/edit.cxx | 5 | ||||
-rw-r--r-- | vcl/source/edit/vclmedit.cxx | 7 | ||||
-rw-r--r-- | vcl/source/window/window2.cxx | 2 |
3 files changed, 7 insertions, 7 deletions
diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx index 0f64127df81b..b6a49898d7c8 100644 --- a/vcl/source/control/edit.cxx +++ b/vcl/source/control/edit.cxx @@ -2238,6 +2238,7 @@ void Edit::StateChanged( StateChangedType nType ) { if (!mpSubEdit) { + ApplySettings(*this); ImplShowCursor(); Invalidate(); } @@ -2246,6 +2247,7 @@ void Edit::StateChanged( StateChangedType nType ) { if (!mpSubEdit) { + ApplySettings(*this); ImplShowCursor(); Invalidate(); } @@ -2254,6 +2256,7 @@ void Edit::StateChanged( StateChangedType nType ) { if (!mpSubEdit) { + ApplySettings(*this); Invalidate(); } } @@ -2261,6 +2264,7 @@ void Edit::StateChanged( StateChangedType nType ) { if (!mpSubEdit) { + ApplySettings(*this); Invalidate(); } } @@ -2277,6 +2281,7 @@ void Edit::DataChanged( const DataChangedEvent& rDCEvt ) { if ( !mpSubEdit ) { + ApplySettings(*this); ImplShowCursor(); Invalidate(); } diff --git a/vcl/source/edit/vclmedit.cxx b/vcl/source/edit/vclmedit.cxx index a1b3a216e61f..3079dbd33c70 100644 --- a/vcl/source/edit/vclmedit.cxx +++ b/vcl/source/edit/vclmedit.cxx @@ -1360,12 +1360,7 @@ void VclMultiLineEdit::Draw( OutputDevice* pDev, const Point& rPos, const Size& Point aPos = pDev->LogicToPixel( rPos ); Size aSize = pDev->LogicToPixel( rSize ); - vcl::Font aFont = pImpVclMEdit->GetTextWindow()->GetPointFont(*this); - Size aFontSize = aFont.GetFontSize(); - MapMode aPtMapMode(MAP_POINT); - aFontSize = pDev->LogicToPixel(aFontSize, aPtMapMode); - aFont.SetFontSize(aFontSize); - + vcl::Font aFont = pImpVclMEdit->GetTextWindow()->GetDrawPixelFont(pDev); aFont.SetTransparent( true ); OutDevType eOutDevType = pDev->GetOutDevType(); diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx index 17b48cbaba2c..91498636fa77 100644 --- a/vcl/source/window/window2.cxx +++ b/vcl/source/window/window2.cxx @@ -644,7 +644,7 @@ Size Window::CalcOutputSize( const Size& rWinSz ) const vcl::Font Window::GetDrawPixelFont(OutputDevice* pDev) const { - vcl::Font aFont = GetPointFont(*pDev); + vcl::Font aFont = GetPointFont(*const_cast<Window*>(this)); Size aFontSize = aFont.GetFontSize(); MapMode aPtMapMode(MAP_POINT); aFontSize = pDev->LogicToPixel( aFontSize, aPtMapMode ); |