[Libreoffice-commits] core.git: vcl/source

Tomaž Vajngerl tomaz.vajngerl at collabora.com
Thu Oct 22 10:17:27 PDT 2015


 vcl/source/control/edit.cxx   |    2 ++
 vcl/source/window/window2.cxx |    2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 825b3df7f1d987021ec4a08ff8e7ed78e5772c97
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.com>
Date:   Thu Oct 22 19:03:01 2015 +0200

    tdf#94138 fix printing of edit form fields
    
    There are 2 bugs:
    
    - In Window::GetDrawPixelFont we asked for the font to the
    current window, which didn't work correctly when printing. The
    device itself should provide the font and not the window.
    
    - In paint method the font wasn't setup correctly which should
    happen before painting by calling ApplySettings. The effect of
    this is that print preview didn't show the correct font for the
    edit control and similar when you copy + paste the edit control.
    The work around for this is to call ApplySettings again.
    
    Change-Id: I74960355823c71c1d5a18a82bbc86561a3c4b760

diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx
index d287058..b5ed8b1 100644
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -506,6 +506,8 @@ void Edit::ImplRepaint(vcl::RenderContext& rRenderContext, const Rectangle& rRec
     if (!IsReallyVisible())
         return;
 
+    ApplySettings(rRenderContext);
+
     OUString aText = ImplGetText();
     sal_Int32 nLen = aText.getLength();
 
diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx
index e90569b..5eaaf6f 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(*const_cast<Window*>(this));
+    vcl::Font aFont = GetPointFont(*pDev);
     Size aFontSize = aFont.GetSize();
     MapMode aPtMapMode(MAP_POINT);
     aFontSize = pDev->LogicToPixel( aFontSize, aPtMapMode );


More information about the Libreoffice-commits mailing list