svx/source/sidebar/area/AreaPropertyPanelBase.cxx |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

New commits:
commit b5effb66ee1563689c27ff10b682357120ab7786
Author:     Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de>
AuthorDate: Mon Sep 4 11:52:08 2023 +0200
Commit:     Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de>
CommitDate: Mon Sep 4 13:29:08 2023 +0200

    tdf#151188 Select correct fill type in sidebar
    
    Change-Id: Ic123e6b21009cc57bf1c4b5f4edc6dcd277bae0a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156510
    Tested-by: Jenkins
    Reviewed-by: Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de>

diff --git a/svx/source/sidebar/area/AreaPropertyPanelBase.cxx 
b/svx/source/sidebar/area/AreaPropertyPanelBase.cxx
index 3659110f16db..9adff2c65dfd 100644
--- a/svx/source/sidebar/area/AreaPropertyPanelBase.cxx
+++ b/svx/source/sidebar/area/AreaPropertyPanelBase.cxx
@@ -1066,10 +1066,14 @@ void 
AreaPropertyPanelBase::updateFillUseBackground(bool bDisabled, bool bDefaul
         if (pState)
         {
             const XFillUseSlideBackgroundItem* pItem = static_cast<const 
XFillUseSlideBackgroundItem*>(pState);
-            // When XFillUseSlideBackgroundItem is true, select "Use 
Background Fill". When false, select "None"
+            // When XFillUseSlideBackgroundItem is set, select "Use Background 
Fill".
+            // When false, select "None" (only if "Use background fill" was 
selected beforehand)
             int nPos = pItem->GetValue() ? USE_BACKGROUND : NONE;
-            mxLbFillType->set_active(nPos);
-            FillStyleChanged(false);
+            if ((nPos == NONE && mxLbFillType->get_active() == USE_BACKGROUND) 
|| nPos == USE_BACKGROUND)
+            {
+                mxLbFillType->set_active(nPos);
+                FillStyleChanged(false);
+            }
         }
     }
 }

Reply via email to