summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-08-04 12:12:40 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-08-09 12:14:39 +0000
commit1449d36eaf926ef321568253b68c546acee2f4db (patch)
tree6f391e332ae17c0503776e646fcd124ef522efe1
parent152de33c612f219471c96975f4ab6fd24d95dc1b (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 (cherry picked from commit 5a5db03acc605a02c76c0f2977079b3dcf48de22) Reviewed-on: https://gerrit.libreoffice.org/27879 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
-rw-r--r--vcl/source/control/edit.cxx5
-rw-r--r--vcl/source/edit/vclmedit.cxx7
-rw-r--r--vcl/source/window/window2.cxx2
3 files changed, 7 insertions, 7 deletions
diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx
index aab72e8a3af2..33032c3a226c 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 7f250666bfaf..cd1adb67402d 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 cd67ca6e72f4..3cd36e244a60 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 );