vcl/source/control/edit.cxx | 5 +++++ vcl/source/edit/vclmedit.cxx | 7 +------ vcl/source/window/window2.cxx | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-)
New commits: commit 1449d36eaf926ef321568253b68c546acee2f4db Author: Caolán McNamara <caol...@redhat.com> Date: Thu Aug 4 12:12:40 2016 +0100 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 (cherry picked from commit 5a5db03acc605a02c76c0f2977079b3dcf48de22) Reviewed-on: https://gerrit.libreoffice.org/27879 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk> diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx index aab72e8..33032c3 100644 --- a/vcl/source/control/edit.cxx +++ b/vcl/source/control/edit.cxx @@ -2268,6 +2268,7 @@ void Edit::StateChanged( StateChangedType nType ) { if (!mpSubEdit) { + ApplySettings(*this); ImplShowCursor(); Invalidate(); } @@ -2276,6 +2277,7 @@ void Edit::StateChanged( StateChangedType nType ) { if (!mpSubEdit) { + ApplySettings(*this); ImplShowCursor(); Invalidate(); } @@ -2284,6 +2286,7 @@ void Edit::StateChanged( StateChangedType nType ) { if (!mpSubEdit) { + ApplySettings(*this); Invalidate(); } } @@ -2291,6 +2294,7 @@ void Edit::StateChanged( StateChangedType nType ) { if (!mpSubEdit) { + ApplySettings(*this); Invalidate(); } } @@ -2307,6 +2311,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 7f25066..cd1adb6 100644 --- a/vcl/source/edit/vclmedit.cxx +++ b/vcl/source/edit/vclmedit.cxx @@ -1365,12 +1365,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 cd67ca6..3cd36e24 100644 --- a/vcl/source/window/window2.cxx +++ b/vcl/source/window/window2.cxx @@ -654,7 +654,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 );
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits