summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2023-01-18 21:19:26 +0000
committerAdolfo Jayme Barrientos <fitojb@ubuntu.com>2023-01-19 09:51:08 +0000
commitfa62e63d6b75aac80dd23520351de11c5a0c9ea4 (patch)
treeeead7575513ef7c282bc9b81dcebf5f88ec75f63 /svx
parent7ad6682475df099643c344b5d1cfefef9189d932 (diff)
tdf#153088 format cells example text black on dark background
with application colors, scheme: LibreOffice Dark enabled Change-Id: I465c97bf21b66c0122b59296d0c114bf115910ae Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145726 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/dialog/fntctrl.cxx17
1 files changed, 13 insertions, 4 deletions
diff --git a/svx/source/dialog/fntctrl.cxx b/svx/source/dialog/fntctrl.cxx
index de39993061fd..255d8ab8d9d9 100644
--- a/svx/source/dialog/fntctrl.cxx
+++ b/svx/source/dialog/fntctrl.cxx
@@ -475,8 +475,12 @@ static void SetPrevFontEscapement(SvxFont& rFont, sal_uInt8 nProp, sal_uInt8 nEs
void SvxFontPrevWindow::ApplySettings(vcl::RenderContext& rRenderContext)
{
- rRenderContext.SetTextColor( svtools::ColorConfig().GetColorValue(svtools::FONTCOLOR).nColor );
- rRenderContext.SetBackground( svtools::ColorConfig().GetColorValue(svtools::DOCCOLOR).nColor );
+ Color aBgColor = svtools::ColorConfig().GetColorValue(svtools::DOCCOLOR).nColor;
+ Color aFgColor = svtools::ColorConfig().GetColorValue(svtools::FONTCOLOR, false).nColor;
+ if (aFgColor == COL_AUTO)
+ aFgColor = aBgColor.IsDark() ? COL_WHITE : COL_BLACK;
+ rRenderContext.SetBackground(aBgColor);
+ rRenderContext.SetTextColor(aFgColor);
}
void SvxFontPrevWindow::SetDrawingArea(weld::DrawingArea* pDrawingArea)
@@ -583,6 +587,7 @@ void SvxFontPrevWindow::Paint(vcl::RenderContext& rRenderContext, const tools::R
rRenderContext.SetMapMode(MapMode(MapUnit::MapTwip));
ApplySettings(rRenderContext);
+ rRenderContext.Erase();
Printer* pPrinter = pImpl->mpPrinter;
const SvxFont& rFont = pImpl->maFont;
@@ -985,8 +990,12 @@ void SvxFontPrevWindow::SetFromItemSet(const SfxItemSet &rSet, bool bPreviewBack
if( GetWhich( rSet, SID_ATTR_BRUSH, nWhich ) )
{
const SvxBrushItem& rBrush = static_cast<const SvxBrushItem&>( rSet.Get( nWhich ) );
- if( GPOS_NONE == rBrush.GetGraphicPos() )
- pImpl->mxBackColor = rBrush.GetColor();
+ if (GPOS_NONE == rBrush.GetGraphicPos())
+ {
+ const Color& rBrushColor = rBrush.GetColor();
+ if (rBrushColor != COL_TRANSPARENT)
+ pImpl->mxBackColor = rBrush.GetColor();
+ }
}
}