tdf#153332 reset background to default if new preview has no bg
but the old did
Change-Id: I59ebd4d5974c5d67c4ac572b091febed879fc290
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146923
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
diff --git a/svx/source/dialog/fntctrl.cxx b/svx/source/dialog/fntctrl.cxx
index 255d8ab..031eb7da 100644
--- a/svx/source/dialog/fntctrl.cxx
+++ b/svx/source/dialog/fntctrl.cxx
@@ -987,6 +987,7 @@ void SvxFontPrevWindow::SetFromItemSet(const SfxItemSet &rSet, bool bPreviewBack
if( !bPreviewBackgroundToCharacter )
{
bool bBackColorFound = false;
if( GetWhich( rSet, SID_ATTR_BRUSH, nWhich ) )
{
const SvxBrushItem& rBrush = static_cast<const SvxBrushItem&>( rSet.Get( nWhich ) );
@@ -994,9 +995,14 @@ void SvxFontPrevWindow::SetFromItemSet(const SfxItemSet &rSet, bool bPreviewBack
{
const Color& rBrushColor = rBrush.GetColor();
if (rBrushColor != COL_TRANSPARENT)
{
pImpl->mxBackColor = rBrush.GetColor();
bBackColorFound = true;
}
}
}
if (!bBackColorFound)
pImpl->mxBackColor = svtools::ColorConfig().GetColorValue(svtools::DOCCOLOR).nColor;
}
// Font