diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.com> | 2015-10-22 19:03:01 +0200 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2015-10-26 16:04:09 +0100 |
commit | 0f3c10eb3c7bd4fd80a2f45a0901cb5a2609a2c3 (patch) | |
tree | 7aec8b5435bd63612c5dca622c0c5611aee6487e | |
parent | 5c3c4776d521766a7c5de6c3aa2804d6fd1bbe15 (diff) |
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
(cherry picked from commit 825b3df7f1d987021ec4a08ff8e7ed78e5772c97)
Reviewed-on: https://gerrit.libreoffice.org/19530
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
(cherry picked from commit 356ac58e6ac6d6c37f4aaffe29099994fe118eaf)
-rw-r--r-- | vcl/source/control/edit.cxx | 2 | ||||
-rw-r--r-- | vcl/source/window/window2.cxx | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx index d83b7f297b97..325084582fb1 100644 --- a/vcl/source/control/edit.cxx +++ b/vcl/source/control/edit.cxx @@ -495,6 +495,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 e3c19d586440..0be48c760842 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 ); |