summaryrefslogtreecommitdiff
path: root/svtools/source/control/scriptedtext.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-08-09 13:04:51 +0100
committerCaolán McNamara <caolanm@redhat.com>2017-08-09 14:55:56 +0200
commit57b015d04d8f823163066cf455ba1ee3de43f2bb (patch)
tree1e57065b73b32c3a8f306c1497abcd872e3e9f21 /svtools/source/control/scriptedtext.cxx
parentd7e92ad0c828a237b16c4643a457c9bd41da6eff (diff)
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@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svtools/source/control/scriptedtext.cxx')
-rw-r--r--svtools/source/control/scriptedtext.cxx10
1 files changed, 6 insertions, 4 deletions
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();
}