[Libreoffice-commits] core.git: vcl/source
Caolán McNamara
caolanm at redhat.com
Thu Aug 4 14:01:08 UTC 2016
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 5a5db03acc605a02c76c0f2977079b3dcf48de22
Author: Caolán McNamara <caolanm at 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
diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx
index 0f64127..b6a4989 100644
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -2238,6 +2238,7 @@ void Edit::StateChanged( StateChangedType nType )
{
if (!mpSubEdit)
{
+ ApplySettings(*this);
ImplShowCursor();
Invalidate();
}
@@ -2246,6 +2247,7 @@ void Edit::StateChanged( StateChangedType nType )
{
if (!mpSubEdit)
{
+ ApplySettings(*this);
ImplShowCursor();
Invalidate();
}
@@ -2254,6 +2256,7 @@ void Edit::StateChanged( StateChangedType nType )
{
if (!mpSubEdit)
{
+ ApplySettings(*this);
Invalidate();
}
}
@@ -2261,6 +2264,7 @@ void Edit::StateChanged( StateChangedType nType )
{
if (!mpSubEdit)
{
+ ApplySettings(*this);
Invalidate();
}
}
@@ -2277,6 +2281,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 a1b3a21..3079dbd 100644
--- a/vcl/source/edit/vclmedit.cxx
+++ b/vcl/source/edit/vclmedit.cxx
@@ -1360,12 +1360,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 17b48cb..9149863 100644
--- a/vcl/source/window/window2.cxx
+++ b/vcl/source/window/window2.cxx
@@ -644,7 +644,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 );
More information about the Libreoffice-commits
mailing list