svx/source/sidebar/area/AreaPropertyPanel.cxx |   16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

New commits:
commit 6238758d80e170cdb586df2b34d479499574cb72
Author:     Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de>
AuthorDate: Mon Sep 19 13:24:05 2022 +0200
Commit:     Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de>
CommitDate: Mon Sep 19 19:51:51 2022 +0200

    tdf#150650 Fix changing fill style to None via Sidebar
    
    Regression from 5491a82854e3e6dd2dbb4b0012cb4bbeb4ee22e0
    
    Change-Id: I17cfb037f2064a508317090e6b66f20e253a9436
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140150
    Tested-by: Jenkins
    Reviewed-by: Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de>

diff --git a/svx/source/sidebar/area/AreaPropertyPanel.cxx 
b/svx/source/sidebar/area/AreaPropertyPanel.cxx
index 1bcbdac19e1e..fa634ee4499b 100644
--- a/svx/source/sidebar/area/AreaPropertyPanel.cxx
+++ b/svx/source/sidebar/area/AreaPropertyPanel.cxx
@@ -90,9 +90,19 @@ void AreaPropertyPanel::setFillTransparence(const 
XFillTransparenceItem& rItem)
 void AreaPropertyPanel::setFillUseBackground(const XFillStyleItem* pStyleItem,
                                              const 
XFillUseSlideBackgroundItem& rItem)
 {
-    GetBindings()->GetDispatcher()->ExecuteList(
-        SID_ATTR_FILL_USE_SLIDE_BACKGROUND, SfxCallMode::RECORD,
-        std::initializer_list<SfxPoolItem const*>{ &rItem, pStyleItem });
+    const SfxPoolItem* pItem = nullptr;
+    auto pDispatcher = GetBindings()->GetDispatcher();
+    auto state = pDispatcher->QueryState(SID_ATTR_FILL_USE_SLIDE_BACKGROUND, 
pItem);
+    // FillUseSlideBackground is only available in Impress
+    if (state == SfxItemState::DISABLED)
+    {
+        setFillStyle(*pStyleItem);
+    }
+    else
+    {
+        pDispatcher->ExecuteList(SID_ATTR_FILL_USE_SLIDE_BACKGROUND, 
SfxCallMode::RECORD,
+                                 std::initializer_list<SfxPoolItem const*>{ 
&rItem, pStyleItem });
+    }
 }
 
 void AreaPropertyPanel::setFillFloatTransparence(const 
XFillFloatTransparenceItem& rItem)

Reply via email to