sc/source/ui/theme/ThemeColorChanger.cxx |   13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

New commits:
commit 30ee52e6c284be1095fdf278439b4c0a7c5982f0
Author:     Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk>
AuthorDate: Tue Jul 4 00:44:15 2023 +0900
Commit:     Tomaž Vajngerl <qui...@gmail.com>
CommitDate: Tue Jul 4 03:51:55 2023 +0200

    sc: change theme color for SdrObjects
    
    Change-Id: I318821c843fe937b7011f1674809f8c78df24a2d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153938
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <qui...@gmail.com>

diff --git a/sc/source/ui/theme/ThemeColorChanger.cxx 
b/sc/source/ui/theme/ThemeColorChanger.cxx
index a245f7b0c1c0..8eaa6ed0fcb6 100644
--- a/sc/source/ui/theme/ThemeColorChanger.cxx
+++ b/sc/source/ui/theme/ThemeColorChanger.cxx
@@ -18,6 +18,7 @@
 #include <editeng/brushitem.hxx>
 #include <editeng/boxitem.hxx>
 #include <editeng/borderline.hxx>
+#include <svx/svditer.hxx>
 
 #include <stlpool.hxx>
 #include <stlsheet.hxx>
@@ -129,9 +130,9 @@ void 
ThemeColorChanger::apply(std::shared_ptr<model::ColorSet> const& pColorSet)
         pStyle = static_cast<ScStyleSheet*>(pPool->Next());
     }
 
-    // Change Cell / Text attributes
     for (SCTAB nTab = 0; nTab < rDocument.GetTableCount(); nTab++)
     {
+        // Change Cell / Text attributes
         ScDocAttrIterator aAttributeIterator(rDocument, nTab, 0, 0, 
rDocument.MaxCol(),
                                              rDocument.MaxRow());
         SCCOL nCol = 0;
@@ -144,6 +145,16 @@ void 
ThemeColorChanger::apply(std::shared_ptr<model::ColorSet> const& pColorSet)
             auto& rItemSet = pNonConstPattern->GetItemSet();
             changeCellItems(rItemSet, *pColorSet);
         }
+
+        // Change all SdrObjects
+        SdrPage* pPage = 
rDocument.GetDrawLayer()->GetPage(static_cast<sal_uInt16>(nTab));
+        SdrObjListIter aIter(pPage, SdrIterMode::DeepNoGroups);
+        SdrObject* pObject = aIter.Next();
+        while (pObject)
+        {
+            svx::theme::updateSdrObject(*pColorSet, pObject);
+            pObject = aIter.Next();
+        }
     }
 }
 

Reply via email to