include/svx/sidebar/AreaPropertyPanelBase.hxx |    3 ++-
 include/vcl/EnumContext.hxx                   |    2 ++
 svx/source/sidebar/area/AreaPropertyPanel.cxx |   11 +++++++++++
 svx/source/sidebar/area/AreaPropertyPanel.hxx |    2 ++
 4 files changed, 17 insertions(+), 1 deletion(-)

New commits:
commit 5e5e5832df6ed11bc664ef33ae833d2501b516c4
Author:     Oliver Specht <oliver.spe...@cib.de>
AuthorDate: Thu May 2 08:39:14 2024 +0200
Commit:     Thorsten Behrens <thorsten.behr...@allotropia.de>
CommitDate: Tue May 7 19:13:20 2024 +0200

    Sidebar: Direct update of FillStyle
    
    FillStyle is directly updated to prevent deferred resize
    when additional controls are created.
    
    Change-Id: I48ed987971cf6c711af31d552e8d64fa9982a416
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165993
    Tested-by: Jenkins
    Reviewed-by: Thorsten Behrens <thorsten.behr...@allotropia.de>

diff --git a/include/svx/sidebar/AreaPropertyPanelBase.hxx 
b/include/svx/sidebar/AreaPropertyPanelBase.hxx
index 92e2d2c39289..eca8220a0812 100644
--- a/include/svx/sidebar/AreaPropertyPanelBase.hxx
+++ b/include/svx/sidebar/AreaPropertyPanelBase.hxx
@@ -102,7 +102,6 @@ public:
 
 private:
     void Initialize();
-    virtual void HandleContextChange(const vcl::EnumContext& rContext) 
override;
 
 protected:
     const css::uno::Reference<css::frame::XFrame>&      mxFrame;
@@ -177,6 +176,8 @@ protected:
 
     // MCGR: Preserve ColorStops until we have a UI to edit these
     basegfx::BColorStops createColorStops();
+
+    virtual void HandleContextChange(const vcl::EnumContext& rContext) 
override;
 };
 
 } // end of namespace svx::sidebar
diff --git a/include/vcl/EnumContext.hxx b/include/vcl/EnumContext.hxx
index f852fea96068..790d938bd6e9 100644
--- a/include/vcl/EnumContext.hxx
+++ b/include/vcl/EnumContext.hxx
@@ -129,6 +129,8 @@ public:
     sal_Int32 GetCombinedContext_DI() const;
 
     Application GetApplication() const;
+    Context GetContext() const {return meContext;}
+
     SAL_DLLPRIVATE Application GetApplication_DI() const;
 
     bool operator == (const EnumContext& rOther) const;
diff --git a/svx/source/sidebar/area/AreaPropertyPanel.cxx 
b/svx/source/sidebar/area/AreaPropertyPanel.cxx
index 951028d61f32..1a5c02909c02 100644
--- a/svx/source/sidebar/area/AreaPropertyPanel.cxx
+++ b/svx/source/sidebar/area/AreaPropertyPanel.cxx
@@ -154,6 +154,17 @@ void AreaPropertyPanel::setFillStyleAndBitmap(const 
XFillStyleItem* pStyleItem,
             : std::initializer_list<SfxPoolItem const*>{ &rBitmapItem });
 }
 
+void AreaPropertyPanel::HandleContextChange(const vcl::EnumContext& rContext)
+{
+    AreaPropertyPanelBase::HandleContextChange(rContext);
+    if (rContext.GetContext() != vcl::EnumContext::Context::Default)
+    {
+        std::unique_ptr<SfxPoolItem> pFillState;
+        SfxItemState eState = mpBindings->QueryState( SID_ATTR_FILL_STYLE, 
pFillState );
+        NotifyItemUpdate(SID_ATTR_FILL_STYLE, eState, pFillState.get());
+    }
+}
+
 } // end of namespace svx::sidebar
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/sidebar/area/AreaPropertyPanel.hxx 
b/svx/source/sidebar/area/AreaPropertyPanel.hxx
index 6c398e6ac077..dc5b9d0194d2 100644
--- a/svx/source/sidebar/area/AreaPropertyPanel.hxx
+++ b/svx/source/sidebar/area/AreaPropertyPanel.hxx
@@ -83,6 +83,8 @@ private:
     ::sfx2::sidebar::ControllerItem maFillUseSlideBackgroundController;
 
     SfxBindings* mpBindings;
+    virtual void HandleContextChange(const vcl::EnumContext& rContext) 
override;
+
 };
 
 

Reply via email to