summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorHeiko Tietze <tietze.heiko@gmail.com>2022-03-24 08:40:24 +0100
committerHeiko Tietze <heiko.tietze@documentfoundation.org>2022-03-24 15:36:03 +0100
commit5b2238ce779c44378f0a86e498eda39f50df3542 (patch)
tree84afa14c1494f35fa8651aba2956a9c26f7d7344 /svtools
parente697506a60b85495e9863ea97438f16d7f7b457b (diff)
Resolves tdf#140439 - AutoFormat Table preview not using DOCCOLOR
WYSIWYG preview should use the actual document color instead the dialog/window background Change-Id: Ifff07b2f754ed88cb7e60e0494092e266d3c7cf1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132023 Tested-by: Jenkins Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
Diffstat (limited to 'svtools')
-rw-r--r--svtools/source/control/scriptedtext.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/svtools/source/control/scriptedtext.cxx b/svtools/source/control/scriptedtext.cxx
index fc7e3e8a703e..18c6445b95e5 100644
--- a/svtools/source/control/scriptedtext.cxx
+++ b/svtools/source/control/scriptedtext.cxx
@@ -262,8 +262,10 @@ void SvtScriptedTextHelper_Impl::DrawText( const Point& _rPos )
{
nNextPos = maPosVec[ nPosVecIndex++ ];
nScript = maScriptVec[ nVecIndex ];
-
- SetOutDevFont( nScript );
+ vcl::Font aFont = GetFont( nScript );
+ mrOutDevice.SetFont( aFont );
+ if (aFont.GetColor() == COL_AUTO)
+ mrOutDevice.SetTextColor( mrOutDevice.GetFillColor().IsDark() ? COL_WHITE : COL_BLACK);
mrOutDevice.DrawText( aCurrPos, maText, nThisPos, nNextPos - nThisPos );
aCurrPos.AdjustX(maWidthVec[ nVecIndex++ ] );
aCurrPos.AdjustX(mrOutDevice.GetTextHeight() / 5 ); // add 20% of font height as portion spacing