Kaydet (Commit) 356ac58e authored tarafından Tomaž Vajngerl's avatar Tomaž Vajngerl Kaydeden (comit) Jan Holesovsky

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 825b3df7)
Reviewed-on: https://gerrit.libreoffice.org/19530Reviewed-by: 's avatarJan Holesovsky <kendy@collabora.com>
Tested-by: 's avatarJan Holesovsky <kendy@collabora.com>
üst 0c8d1c04
...@@ -495,6 +495,8 @@ void Edit::ImplRepaint(vcl::RenderContext& rRenderContext, const Rectangle& rRec ...@@ -495,6 +495,8 @@ void Edit::ImplRepaint(vcl::RenderContext& rRenderContext, const Rectangle& rRec
if (!IsReallyVisible()) if (!IsReallyVisible())
return; return;
ApplySettings(rRenderContext);
OUString aText = ImplGetText(); OUString aText = ImplGetText();
sal_Int32 nLen = aText.getLength(); sal_Int32 nLen = aText.getLength();
......
...@@ -654,7 +654,7 @@ Size Window::CalcOutputSize( const Size& rWinSz ) const ...@@ -654,7 +654,7 @@ Size Window::CalcOutputSize( const Size& rWinSz ) const
vcl::Font Window::GetDrawPixelFont(OutputDevice* pDev) 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(); Size aFontSize = aFont.GetSize();
MapMode aPtMapMode(MAP_POINT); MapMode aPtMapMode(MAP_POINT);
aFontSize = pDev->LogicToPixel( aFontSize, aPtMapMode ); aFontSize = pDev->LogicToPixel( aFontSize, aPtMapMode );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment