svx/source/dialog/fntctrl.cxx |    6 ++++++
 1 file changed, 6 insertions(+)

New commits:
commit c4de5f1f40f7392306daaae8c05481ea346bbeb0
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Mon Feb 13 20:30:02 2023 +0000
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Tue Feb 14 08:36:39 2023 +0000

    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/+/146948
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/svx/source/dialog/fntctrl.cxx b/svx/source/dialog/fntctrl.cxx
index 255d8ab8d9d9..031eb7dabc91 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

Reply via email to