[Libreoffice-commits] core.git: svtools/source
Caolán McNamara
caolanm at redhat.com
Wed Aug 9 12:56:40 UTC 2017
svtools/source/control/scriptedtext.cxx | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
New commits:
commit 57b015d04d8f823163066cf455ba1ee3de43f2bb
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Aug 9 13:04:51 2017 +0100
autoformat dialog can draw 'None' invisible sometimes
if you switch from an entry which last draws white text, i.e. the "Gray" entry,
to "None" then the white text color is persistent and the preview appears to be
missing.
Instead of getting and resetting the Font to keep the output device font
unchanged, push/pop the font and text color setting
Change-Id: Ia3a8f0120f8df4b1ec57217e8e6071b0113b3a93
Reviewed-on: https://gerrit.libreoffice.org/40919
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/svtools/source/control/scriptedtext.cxx b/svtools/source/control/scriptedtext.cxx
index c077786e20e0..16f737fd22a1 100644
--- a/svtools/source/control/scriptedtext.cxx
+++ b/svtools/source/control/scriptedtext.cxx
@@ -123,7 +123,7 @@ const vcl::Font& SvtScriptedTextHelper_Impl::GetFont( sal_uInt16 _nScript ) cons
void SvtScriptedTextHelper_Impl::CalculateSizes()
{
maTextSize.Width() = maTextSize.Height() = 0;
- maDefltFont = mrOutDevice.GetFont();
+ mrOutDevice.Push(PushFlags::FONT | PushFlags::TEXTCOLOR);
// calculate text portion widths and total width
maWidthVec.clear();
@@ -163,7 +163,7 @@ void SvtScriptedTextHelper_Impl::CalculateSizes()
SetOutDevFont( i18n::ScriptType::COMPLEX );
maTextSize.Height() = std::max( maTextSize.Height(), mrOutDevice.GetTextHeight() );
- mrOutDevice.SetFont( maDefltFont );
+ mrOutDevice.Pop();
}
void SvtScriptedTextHelper_Impl::CalculateBreaks( const uno::Reference< i18n::XBreakIterator >& _xBreakIter )
@@ -265,7 +265,8 @@ void SvtScriptedTextHelper_Impl::DrawText( const Point& _rPos )
DBG_ASSERT( maPosVec.size() - 1 == maScriptVec.size(), "SvtScriptedTextHelper_Impl::DrawText - invalid vectors" );
DBG_ASSERT( maScriptVec.size() == maWidthVec.size(), "SvtScriptedTextHelper_Impl::DrawText - invalid vectors" );
- maDefltFont = mrOutDevice.GetFont();
+ mrOutDevice.Push(PushFlags::FONT | PushFlags::TEXTCOLOR);
+
Point aCurrPos( _rPos );
sal_Int32 nThisPos = maPosVec[ 0 ];
sal_Int32 nNextPos;
@@ -286,7 +287,8 @@ void SvtScriptedTextHelper_Impl::DrawText( const Point& _rPos )
aCurrPos.X() += mrOutDevice.GetTextHeight() / 5; // add 20% of font height as portion spacing
nThisPos = nNextPos;
}
- mrOutDevice.SetFont( maDefltFont );
+
+ mrOutDevice.Pop();
}
More information about the Libreoffice-commits
mailing list