include/svx/svdmodel.hxx                   |    5 ++
 include/svx/svdpage.hxx                    |    4 +-
 oox/source/drawingml/theme.cxx             |    2 -
 sc/qa/unit/ucalc_DocumentThemes.cxx        |    8 +---
 sc/qa/unit/ucalc_sparkline.cxx             |    4 --
 sc/source/filter/excel/excdoc.cxx          |   26 +++++--------
 sc/source/filter/oox/workbookfragment.cxx  |    5 +-
 sc/source/ui/docshell/docsh.cxx            |   14 +------
 sc/source/ui/theme/ThemeColorChanger.cxx   |   16 +++++---
 sc/source/ui/undo/UndoThemeChange.cxx      |   36 ++++++++----------
 sc/source/ui/view/tabvwsh3.cxx             |    9 ++--
 sd/Library_sd.mk                           |    1 
 sd/qa/unit/ThemeTest.cxx                   |    2 -
 sd/source/core/ThemeColorChanger.cxx       |   23 +++++++++---
 sd/source/filter/eppt/pptx-epptooxml.cxx   |    2 -
 sd/source/ui/dlg/UndoThemeChange.cxx       |   55 +++++++++++++++++++++++++++++
 sd/source/ui/docshell/docshell.cxx         |    4 +-
 sd/source/ui/inc/UndoThemeChange.hxx       |   39 ++++++++++++++++++++
 sd/source/ui/unoidl/unopage.cxx            |    8 ++--
 sd/source/ui/view/drviews2.cxx             |    2 -
 svx/source/form/fmmodel.cxx                |    8 +---
 svx/source/svdraw/svdmodel.cxx             |    2 +
 svx/source/svdraw/svdpage.cxx              |   36 +++++++++++-------
 sw/qa/core/theme/ThemeTest.cxx             |   22 ++++++-----
 sw/source/core/model/ThemeColorChanger.cxx |    6 +--
 sw/source/core/undo/UndoThemeChange.cxx    |    8 ++--
 sw/source/core/unocore/unodraw.cxx         |    4 +-
 sw/source/filter/ww8/docxexport.cxx        |    6 ++-
 sw/source/filter/xml/xmlfmte.cxx           |    3 +
 sw/source/uibase/app/docst.cxx             |    6 +--
 sw/source/uibase/shells/basesh.cxx         |   10 ++---
 31 files changed, 240 insertions(+), 136 deletions(-)

New commits:
commit 54d9425bc3165ed2bbab67c4719e6a0146a2c663
Author:     Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk>
AuthorDate: Sun Aug 27 22:34:13 2023 +0200
Commit:     Tomaž Vajngerl <qui...@gmail.com>
CommitDate: Mon Aug 28 18:10:50 2023 +0200

    sd: add undo/redo action for changing the model::ColorSet
    
    And add the undo action when changing the theme colors in the
    ThemeColorChanger.
    
    Change-Id: Ibeee8aeff420b42fd961e0abd630569e74075585
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156178
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <qui...@gmail.com>
    (cherry picked from commit d3b06d044fafec0b31ada9ecbaf60f396555fb12)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156189
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Ashod Nakashian <a...@collabora.com>

diff --git a/sd/Library_sd.mk b/sd/Library_sd.mk
index 24e3c985a4ee..1d7333176c16 100644
--- a/sd/Library_sd.mk
+++ b/sd/Library_sd.mk
@@ -246,6 +246,7 @@ $(eval $(call gb_Library_add_exception_objects,sd,\
        sd/source/ui/dlg/sdtreelb \
        sd/source/ui/dlg/titledockwin \
        sd/source/ui/dlg/unchss \
+       sd/source/ui/dlg/UndoThemeChange \
        sd/source/ui/docshell/docshel2 \
        sd/source/ui/docshell/docshel3 \
        sd/source/ui/docshell/docshel4 \
diff --git a/sd/source/core/ThemeColorChanger.cxx 
b/sd/source/core/ThemeColorChanger.cxx
index 8d2a80aec281..573a5f085dd4 100644
--- a/sd/source/core/ThemeColorChanger.cxx
+++ b/sd/source/core/ThemeColorChanger.cxx
@@ -24,6 +24,8 @@
 #include <unchss.hxx>
 #include <ViewShell.hxx>
 #include <ViewShellBase.hxx>
+#include <undo/undomanager.hxx>
+#include <UndoThemeChange.hxx>
 
 using namespace css;
 
@@ -39,7 +41,8 @@ ThemeColorChanger::~ThemeColorChanger() = default;
 
 namespace
 {
-void changeTheTheme(SdrPage* pMasterPage, std::shared_ptr<model::ColorSet> 
const& pColorSet)
+void changeThemeColors(sd::DrawDocShell* pDocShell, SdrPage* pMasterPage,
+                       std::shared_ptr<model::ColorSet> const& pNewColorSet)
 {
     auto pTheme = pMasterPage->getSdrPageProperties().getTheme();
     if (!pTheme)
@@ -47,7 +50,17 @@ void changeTheTheme(SdrPage* pMasterPage, 
std::shared_ptr<model::ColorSet> const
         pTheme = std::make_shared<model::Theme>("Office");
         pMasterPage->getSdrPageProperties().setTheme(pTheme);
     }
-    pTheme->setColorSet(pColorSet);
+
+    std::shared_ptr<model::ColorSet> const& pOldColorSet = 
pTheme->getColorSet();
+
+    auto* pUndoManager = pDocShell->GetUndoManager();
+    if (pUndoManager)
+    {
+        pUndoManager->AddUndoAction(std::make_unique<UndoThemeChange>(
+            pDocShell->GetDoc(), pMasterPage, pOldColorSet, pNewColorSet));
+    }
+
+    pTheme->setColorSet(pNewColorSet);
 }
 
 bool changeStyle(sd::DrawDocShell* pDocShell, SdStyleSheet* pStyle,
@@ -164,7 +177,7 @@ void 
ThemeColorChanger::apply(std::shared_ptr<model::ColorSet> const& pColorSet)
         }
     }
 
-    changeTheTheme(mpMasterPage, pColorSet);
+    changeThemeColors(mpDocShell, mpMasterPage, pColorSet);
 
     pUndoManager->LeaveListAction();
 }
diff --git a/sd/source/ui/dlg/UndoThemeChange.cxx 
b/sd/source/ui/dlg/UndoThemeChange.cxx
new file mode 100644
index 000000000000..1270dc06cab7
--- /dev/null
+++ b/sd/source/ui/dlg/UndoThemeChange.cxx
@@ -0,0 +1,55 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include <UndoThemeChange.hxx>
+#include <svx/dialmgr.hxx>
+#include <svx/strings.hrc>
+
+namespace sd
+{
+UndoThemeChange::UndoThemeChange(SdDrawDocument* pDocument, SdrPage* 
pMasterPage,
+                                 std::shared_ptr<model::ColorSet> const& 
pOldColorSet,
+                                 std::shared_ptr<model::ColorSet> const& 
pNewColorSet)
+    : SdUndoAction(pDocument)
+    , mpMasterPage(pMasterPage)
+    , mpOldColorSet(pOldColorSet)
+    , mpNewColorSet(pNewColorSet)
+{
+    SetComment(SvxResId(RID_SVXSTR_UNDO_THEME_COLOR_CHANGE));
+}
+
+namespace
+{
+std::shared_ptr<model::Theme> getTheme(SdrPage* pMasterPage)
+{
+    auto pTheme = pMasterPage->getSdrPageProperties().getTheme();
+    if (!pTheme)
+    {
+        pTheme = std::make_shared<model::Theme>("Office");
+        pMasterPage->getSdrPageProperties().setTheme(pTheme);
+    }
+    return pTheme;
+}
+}
+
+void UndoThemeChange::Undo()
+{
+    auto pTheme = getTheme(mpMasterPage);
+    pTheme->setColorSet(mpOldColorSet);
+}
+
+void UndoThemeChange::Redo()
+{
+    auto pTheme = getTheme(mpMasterPage);
+    pTheme->setColorSet(mpNewColorSet);
+}
+
+} // end sd namespace
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/ui/inc/UndoThemeChange.hxx 
b/sd/source/ui/inc/UndoThemeChange.hxx
new file mode 100644
index 000000000000..798f2adb50bf
--- /dev/null
+++ b/sd/source/ui/inc/UndoThemeChange.hxx
@@ -0,0 +1,39 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#pragma once
+
+#include <memory>
+#include <sdundo.hxx>
+#include <svx/svdpage.hxx>
+#include <docmodel/theme/Theme.hxx>
+
+class SdDrawDocument;
+
+namespace sd
+{
+class UndoThemeChange : public SdUndoAction
+{
+private:
+    SdrPage* mpMasterPage;
+    std::shared_ptr<model::ColorSet> mpOldColorSet;
+    std::shared_ptr<model::ColorSet> mpNewColorSet;
+
+public:
+    UndoThemeChange(SdDrawDocument* pDocument, SdrPage* pMasterPage,
+                    std::shared_ptr<model::ColorSet> const& pOldColorSet,
+                    std::shared_ptr<model::ColorSet> const& pNewColorSet);
+
+    virtual void Undo() override;
+    virtual void Redo() override;
+};
+
+} // namespace sd
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit b04ab5b24a431d51d9941545ac1b81a165fd287e
Author:     Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk>
AuthorDate: Sat Aug 26 15:35:40 2023 +0200
Commit:     Tomaž Vajngerl <qui...@gmail.com>
CommitDate: Mon Aug 28 18:10:37 2023 +0200

    Change theme location to SdrModel and SdrPage (master page only)
    
    In Writer and Calc we only have one theme per document, so the
    theme can be stored inside the SdrModel. For Imporess/Draw the
    theme is defined per master page, so it needs to be stored on the
    master page. This changes the implementation to reflect that.
    
    In addition refactor all the usages in writer and calc to get and
    set the theme to SdrModel, when needed and rename the methods on
    the SdrPageProperties from {Get,Set}Theme to {get,set}Theme.
    
    Change-Id: I0cc3b332c029c28d15f8cda748c578c2a54a5c61
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156128
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <qui...@gmail.com>
    (cherry picked from commit d150b7a60d7be4b09a838ae4c038e78509f75126)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156175
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Ashod Nakashian <a...@collabora.com>

diff --git a/include/svx/svdmodel.hxx b/include/svx/svdmodel.hxx
index 705f67cdb947..56fc27cd9ef0 100644
--- a/include/svx/svdmodel.hxx
+++ b/include/svx/svdmodel.hxx
@@ -96,6 +96,11 @@ namespace model
 class Theme;
 }
 
+namespace svx
+{
+class IThemeColorChanger;
+}
+
 constexpr const sal_Unicode DEGREE_CHAR = u'\x00B0'; /* U+00B0 DEGREE SIGN */
 
 
diff --git a/include/svx/svdpage.hxx b/include/svx/svdpage.hxx
index b84bd7bf5276..5b9ccd9e8f7a 100644
--- a/include/svx/svdpage.hxx
+++ b/include/svx/svdpage.hxx
@@ -347,8 +347,8 @@ public:
     void SetStyleSheet(SfxStyleSheet* pStyleSheet);
     SfxStyleSheet* GetStyleSheet() const { return mpStyleSheet;}
 
-    void SetTheme(std::shared_ptr<model::Theme> const& pTheme);
-    std::shared_ptr<model::Theme> const& GetTheme() const;
+    void setTheme(std::shared_ptr<model::Theme> const& pTheme);
+    std::shared_ptr<model::Theme> const& getTheme() const;
 
     void dumpAsXml(xmlTextWriterPtr pWriter) const;
 };
diff --git a/oox/source/drawingml/theme.cxx b/oox/source/drawingml/theme.cxx
index e8511a32eb5d..32ae9b4349da 100644
--- a/oox/source/drawingml/theme.cxx
+++ b/oox/source/drawingml/theme.cxx
@@ -120,7 +120,7 @@ void Theme::addTheme(const 
css::uno::Reference<css::drawing::XDrawPage>& xDrawPa
     if (!pPage)
         return;
 
-    pPage->getSdrPageProperties().SetTheme(getTheme());
+    pPage->getSdrPageProperties().setTheme(getTheme());
 }
 
 } // namespace oox::drawingml
diff --git a/sc/qa/unit/ucalc_DocumentThemes.cxx 
b/sc/qa/unit/ucalc_DocumentThemes.cxx
index f40116742d23..664b06a879f9 100644
--- a/sc/qa/unit/ucalc_DocumentThemes.cxx
+++ b/sc/qa/unit/ucalc_DocumentThemes.cxx
@@ -37,9 +37,7 @@ CPPUNIT_TEST_FIXTURE(DocumentThemesTest, testGetTheme)
 
     ScDrawLayer* pDrawLayer = m_pDoc->GetDrawLayer();
     CPPUNIT_ASSERT(pDrawLayer);
-    const SdrPage* pPage(pDrawLayer->GetPage(0));
-    CPPUNIT_ASSERT(pPage);
-    auto const& pTheme = pPage->getSdrPageProperties().GetTheme();
+    auto const& pTheme = pDrawLayer->getTheme();
     CPPUNIT_ASSERT(pTheme);
 }
 
@@ -50,9 +48,7 @@ CPPUNIT_TEST_FIXTURE(DocumentThemesTest, testChangeTheme)
 
     ScDrawLayer* pDrawLayer = m_pDoc->GetDrawLayer();
     CPPUNIT_ASSERT(pDrawLayer);
-    const SdrPage* pPage(pDrawLayer->GetPage(0));
-    CPPUNIT_ASSERT(pPage);
-    auto const& pTheme = pPage->getSdrPageProperties().GetTheme();
+    auto const& pTheme = pDrawLayer->getTheme();
     CPPUNIT_ASSERT(pTheme);
 
     Color aBackgroundThemeColor(0xc99c00);
diff --git a/sc/qa/unit/ucalc_sparkline.cxx b/sc/qa/unit/ucalc_sparkline.cxx
index 459f1d651dca..cf5e985fd322 100644
--- a/sc/qa/unit/ucalc_sparkline.cxx
+++ b/sc/qa/unit/ucalc_sparkline.cxx
@@ -919,9 +919,7 @@ CPPUNIT_TEST_FIXTURE(SparklineTest, 
testSparklineThemeColorChange)
 
     ScDrawLayer* pDrawLayer = m_pDoc->GetDrawLayer();
     CPPUNIT_ASSERT(pDrawLayer);
-    const SdrPage* pPage(pDrawLayer->GetPage(0));
-    CPPUNIT_ASSERT(pPage);
-    auto const& pTheme = pPage->getSdrPageProperties().GetTheme();
+    auto const& pTheme = pDrawLayer->getTheme();
     CPPUNIT_ASSERT(pTheme);
 
     // Sparkline range
diff --git a/sc/source/filter/excel/excdoc.cxx 
b/sc/source/filter/excel/excdoc.cxx
index cdee12a7c11c..7b2afc7c6543 100644
--- a/sc/source/filter/excel/excdoc.cxx
+++ b/sc/source/filter/excel/excdoc.cxx
@@ -868,22 +868,18 @@ void ExcDocument::WriteXml( XclExpXmlStream& rStrm )
         auto* pDrawLayer = GetDoc().GetDrawLayer();
         if (pDrawLayer)
         {
-            SdrPage* pPage = pDrawLayer->GetPage(0);
-            if (pPage)
+            std::shared_ptr<model::Theme> pTheme = pDrawLayer->getTheme();
+            if (pTheme)
             {
-                std::shared_ptr<model::Theme> pTheme = 
pPage->getSdrPageProperties().GetTheme();
-                if (pTheme)
-                {
-                    OUString sThemeRelationshipPath = "theme/theme1.xml";
-                    OUString sThemeDocumentPath = "xl/" + 
sThemeRelationshipPath;
-
-                    oox::ThemeExport aThemeExport(&rStrm, 
oox::drawingml::DOCUMENT_XLSX);
-                    aThemeExport.write(sThemeDocumentPath, *pTheme);
-
-                    
rStrm.addRelation(rStrm.GetCurrentStream()->getOutputStream(),
-                                      
oox::getRelationship(Relationship::THEME),
-                                      sThemeRelationshipPath);
-                }
+                OUString sThemeRelationshipPath = "theme/theme1.xml";
+                OUString sThemeDocumentPath = "xl/" + sThemeRelationshipPath;
+
+                oox::ThemeExport aThemeExport(&rStrm, 
oox::drawingml::DOCUMENT_XLSX);
+                aThemeExport.write(sThemeDocumentPath, *pTheme);
+
+                rStrm.addRelation(rStrm.GetCurrentStream()->getOutputStream(),
+                                  oox::getRelationship(Relationship::THEME),
+                                  sThemeRelationshipPath);
             }
         }
 
diff --git a/sc/source/filter/oox/workbookfragment.cxx 
b/sc/source/filter/oox/workbookfragment.cxx
index 08df44404eb4..37019e52b216 100644
--- a/sc/source/filter/oox/workbookfragment.cxx
+++ b/sc/source/filter/oox/workbookfragment.cxx
@@ -487,10 +487,9 @@ void WorkbookFragment::finalizeImport()
     // load all worksheets
     importSheetFragments(*this, aSheetFragments);
 
-    SdrPage* pPage = pModel->GetPage(0);
-    if (pPage && pTheme && !pTheme->GetName().isEmpty())
+    if (pTheme && !pTheme->GetName().isEmpty())
     {
-        pPage->getSdrPageProperties().SetTheme(pTheme);
+        pModel->setTheme(pTheme);
     }
 
     // assumes getTables().finalizeImport ( which creates the DatabaseRanges )
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index a1a16f5b7c57..d682e4854233 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -225,19 +225,11 @@ std::shared_ptr<model::ColorSet> 
ScDocShell::GetThemeColors()
     if (!pShell)
         return {};
 
-    ScTabView* pTabView = pShell->GetViewData().GetView();
-    if (!pTabView)
+    SdrModel* pSdrModel = GetDocument().GetDrawLayer();
+    if (!pSdrModel)
         return {};
 
-    ScDrawView* pView = pTabView->GetScDrawView();
-    if (!pView)
-        return {};
-
-    SdrPage* pPage = pView->GetSdrPageView()->GetPage();
-    if (!pPage)
-        return {};
-
-    auto const& pTheme = pPage->getSdrPageProperties().GetTheme();
+    auto const& pTheme = pSdrModel->getTheme();
     if (!pTheme)
         return {};
 
diff --git a/sc/source/ui/theme/ThemeColorChanger.cxx 
b/sc/source/ui/theme/ThemeColorChanger.cxx
index 4b1b555ec647..8af2d4885abf 100644
--- a/sc/source/ui/theme/ThemeColorChanger.cxx
+++ b/sc/source/ui/theme/ThemeColorChanger.cxx
@@ -279,23 +279,27 @@ void changeSparklines(ScDocShell& rDocShell, 
std::shared_ptr<model::ColorSet> co
     }
 }
 
-void changeTheTheme(ScDocShell& rDocShell, std::shared_ptr<model::ColorSet> 
const& pColorSet)
+std::shared_ptr<model::Theme> getTheme(ScDocShell& rDocShell)
 {
-    ScDocument& rDocument = rDocShell.GetDocument();
-    ScDrawLayer* pModel = rDocument.GetDrawLayer();
-    SdrPage* pPage = pModel->GetPage(0);
+    ScDrawLayer* pModel = rDocShell.GetDocument().GetDrawLayer();
 
-    auto pTheme = pPage->getSdrPageProperties().GetTheme();
+    auto pTheme = pModel->getTheme();
     if (!pTheme)
     {
         pTheme = std::make_shared<model::Theme>("Office");
-        pPage->getSdrPageProperties().SetTheme(pTheme);
+        pModel->setTheme(pTheme);
     }
+    return pTheme;
+}
 
+void changeTheTheme(ScDocShell& rDocShell, std::shared_ptr<model::ColorSet> 
const& pColorSet)
+{
+    auto pTheme = getTheme(rDocShell);
     std::shared_ptr<model::ColorSet> pNewColorSet = pColorSet;
     std::shared_ptr<model::ColorSet> pOldColorSet = pTheme->getColorSet();
     pTheme->setColorSet(pNewColorSet);
 
+    ScDocument& rDocument = rDocShell.GetDocument();
     if (rDocument.IsUndoEnabled())
     {
         auto pUndoThemeChange
diff --git a/sc/source/ui/undo/UndoThemeChange.cxx 
b/sc/source/ui/undo/UndoThemeChange.cxx
index a6a3fe83652e..a977055070c5 100644
--- a/sc/source/ui/undo/UndoThemeChange.cxx
+++ b/sc/source/ui/undo/UndoThemeChange.cxx
@@ -26,20 +26,27 @@ UndoThemeChange::UndoThemeChange(ScDocShell& rDocShell,
 
 UndoThemeChange::~UndoThemeChange() = default;
 
-void UndoThemeChange::Undo()
+namespace
 {
-    BeginUndo();
-
-    ScDocument& rDocument = pDocShell->GetDocument();
-    ScDrawLayer* pModel = rDocument.GetDrawLayer();
-    SdrPage* pPage = pModel->GetPage(0);
+std::shared_ptr<model::Theme> getTheme(ScDocShell& rDocShell)
+{
+    ScDrawLayer* pModel = rDocShell.GetDocument().GetDrawLayer();
 
-    auto pTheme = pPage->getSdrPageProperties().GetTheme();
+    auto pTheme = pModel->getTheme();
     if (!pTheme)
     {
         pTheme = std::make_shared<model::Theme>("Office");
-        pPage->getSdrPageProperties().SetTheme(pTheme);
+        pModel->setTheme(pTheme);
     }
+    return pTheme;
+}
+}
+
+void UndoThemeChange::Undo()
+{
+    BeginUndo();
+
+    auto pTheme = getTheme(*pDocShell);
     pTheme->setColorSet(mpOldColorSet);
 
     EndUndo();
@@ -47,18 +54,9 @@ void UndoThemeChange::Undo()
 
 void UndoThemeChange::Redo()
 {
-    BeginRedo();
-
-    ScDocument& rDocument = pDocShell->GetDocument();
-    ScDrawLayer* pModel = rDocument.GetDrawLayer();
-    SdrPage* pPage = pModel->GetPage(0);
+    BeginUndo();
 
-    auto pTheme = pPage->getSdrPageProperties().GetTheme();
-    if (!pTheme)
-    {
-        pTheme = std::make_shared<model::Theme>("Office");
-        pPage->getSdrPageProperties().SetTheme(pTheme);
-    }
+    auto pTheme = getTheme(*pDocShell);
     pTheme->setColorSet(mpNewColorSet);
 
     EndRedo();
diff --git a/sc/source/ui/view/tabvwsh3.cxx b/sc/source/ui/view/tabvwsh3.cxx
index 03005edfb72d..fe36ab3a5528 100644
--- a/sc/source/ui/view/tabvwsh3.cxx
+++ b/sc/source/ui/view/tabvwsh3.cxx
@@ -1343,13 +1343,12 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
         case SID_THEME_DIALOG:
         {
             MakeDrawLayer();
-            ScTabView* pTabView = GetViewData().GetView();
-            ScDrawView* pView = pTabView->GetScDrawView();
-            SdrPage* pPage = pView->GetSdrPageView()->GetPage();
-            auto const& pTheme = pPage->getSdrPageProperties().GetTheme();
+            ScViewData& rViewData = GetViewData();
+            ScDocument& rDocument = rViewData.GetDocument();
+            ScDrawLayer* pModel = rDocument.GetDrawLayer();
+            auto const& pTheme = pModel->getTheme();
             if (pTheme)
             {
-                ScViewData& rViewData = GetViewData();
                 vcl::Window* pWin = rViewData.GetActiveWin();
                 auto pDialog = std::make_shared<svx::ThemeDialog>(pWin ? 
pWin->GetFrameWeld() : nullptr, pTheme.get());
                 weld::DialogController::runAsync(pDialog, [this, 
pDialog](sal_uInt32 nResult) {
diff --git a/sd/qa/unit/ThemeTest.cxx b/sd/qa/unit/ThemeTest.cxx
index 9a663106c1c8..ed45aadec129 100644
--- a/sd/qa/unit/ThemeTest.cxx
+++ b/sd/qa/unit/ThemeTest.cxx
@@ -133,7 +133,7 @@ CPPUNIT_TEST_FIXTURE(ThemeTest, testThemeChange)
     css::uno::Reference<css::drawing::XDrawPage> xDrawPageMaster(xMasterPage, 
uno::UNO_QUERY);
     CPPUNIT_ASSERT(xDrawPageMaster.is());
     auto* pMasterPage = GetSdrPageFromXDrawPage(xDrawPageMaster);
-    auto pTheme = pMasterPage->getSdrPageProperties().GetTheme();
+    auto pTheme = pMasterPage->getSdrPageProperties().getTheme();
 
     sd::ThemeColorChanger aChanger(pMasterPage, pDocShell);
     aChanger.apply(pTheme->getColorSet());
diff --git a/sd/source/core/ThemeColorChanger.cxx 
b/sd/source/core/ThemeColorChanger.cxx
index 163e51e091f9..8d2a80aec281 100644
--- a/sd/source/core/ThemeColorChanger.cxx
+++ b/sd/source/core/ThemeColorChanger.cxx
@@ -41,11 +41,11 @@ namespace
 {
 void changeTheTheme(SdrPage* pMasterPage, std::shared_ptr<model::ColorSet> 
const& pColorSet)
 {
-    auto pTheme = pMasterPage->getSdrPageProperties().GetTheme();
+    auto pTheme = pMasterPage->getSdrPageProperties().getTheme();
     if (!pTheme)
     {
         pTheme = std::make_shared<model::Theme>("Office");
-        pMasterPage->getSdrPageProperties().SetTheme(pTheme);
+        pMasterPage->getSdrPageProperties().setTheme(pTheme);
     }
     pTheme->setColorSet(pColorSet);
 }
diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx 
b/sd/source/filter/eppt/pptx-epptooxml.cxx
index 00340c03cbd8..437434c201fe 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -1517,7 +1517,7 @@ void PowerPointExport::ImplWriteSlideMaster(sal_uInt32 
nPageNum, Reference< XPro
     model::Theme* pTheme = nullptr;
     if (pMasterPage)
     {
-        pTheme = pMasterPage->getSdrPageProperties().GetTheme().get();
+        pTheme = pMasterPage->getSdrPageProperties().getTheme().get();
     }
 
     // write theme per master
diff --git a/sd/source/ui/docshell/docshell.cxx 
b/sd/source/ui/docshell/docshell.cxx
index 0cbee1370964..ad6d6b5f9f22 100644
--- a/sd/source/ui/docshell/docshell.cxx
+++ b/sd/source/ui/docshell/docshell.cxx
@@ -495,9 +495,9 @@ std::shared_ptr<model::ColorSet> 
DrawDocShell::GetThemeColors()
         return {};
 
     SdPage* pPage = pViewShell->getCurrentPage();
-    auto pTheme = pPage->getSdrPageProperties().GetTheme();
+    auto pTheme = pPage->getSdrPageProperties().getTheme();
     if (!pPage->IsMasterPage())
-        pTheme = pPage->TRG_GetMasterPage().getSdrPageProperties().GetTheme();
+        pTheme = pPage->TRG_GetMasterPage().getSdrPageProperties().getTheme();
 
     if (!pTheme)
         return {};
diff --git a/sd/source/ui/unoidl/unopage.cxx b/sd/source/ui/unoidl/unopage.cxx
index 80e8bc7e3e8d..d23ba1ad2e0e 100644
--- a/sd/source/ui/unoidl/unopage.cxx
+++ b/sd/source/ui/unoidl/unopage.cxx
@@ -981,7 +981,7 @@ void SAL_CALL SdGenericDrawPage::setPropertyValue( const 
OUString& aPropertyName
             if (aValue >>= xTheme)
             {
                 auto& rUnoTheme = dynamic_cast<UnoTheme&>(*xTheme);
-                pPage->getSdrPageProperties().SetTheme(rUnoTheme.getTheme());
+                pPage->getSdrPageProperties().setTheme(rUnoTheme.getTheme());
             }
             break;
         }
@@ -990,7 +990,7 @@ void SAL_CALL SdGenericDrawPage::setPropertyValue( const 
OUString& aPropertyName
         {
             SdrPage* pPage = GetPage();
             std::shared_ptr<model::Theme> pTheme = 
model::Theme::FromAny(aValue);
-            pPage->getSdrPageProperties().SetTheme(pTheme);
+            pPage->getSdrPageProperties().setTheme(pTheme);
             break;
         }
 
@@ -1312,7 +1312,7 @@ Any SAL_CALL SdGenericDrawPage::getPropertyValue( const 
OUString& PropertyName )
     {
         SdrPage* pPage = GetPage();
         css::uno::Reference<css::util::XTheme> xTheme;
-        auto pTheme = pPage->getSdrPageProperties().GetTheme();
+        auto pTheme = pPage->getSdrPageProperties().getTheme();
         if (pTheme)
             xTheme = model::theme::createXTheme(pTheme);
         aAny <<= xTheme;
@@ -1322,7 +1322,7 @@ Any SAL_CALL SdGenericDrawPage::getPropertyValue( const 
OUString& PropertyName )
     case WID_PAGE_THEME_UNO_REPRESENTATION:
     {
         SdrPage* pPage = GetPage();
-        auto pTheme = pPage->getSdrPageProperties().GetTheme();
+        auto pTheme = pPage->getSdrPageProperties().getTheme();
         if (pTheme)
             pTheme->ToAny(aAny);
         else
diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index e31294d536f0..8a4cb4fac976 100644
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -3558,7 +3558,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
         case SID_THEME_DIALOG:
         {
             SdrPage* pMasterPage = &GetActualPage()->TRG_GetMasterPage();
-            auto pTheme = pMasterPage->getSdrPageProperties().GetTheme();
+            auto pTheme = pMasterPage->getSdrPageProperties().getTheme();
             auto pDialog = std::make_shared<svx::ThemeDialog>(GetFrameWeld(), 
pTheme.get());
             auto* pDocShell = GetDocSh();
             weld::DialogController::runAsync(pDialog, [pDialog, pMasterPage, 
pDocShell](sal_uInt32 nResult)
diff --git a/svx/source/form/fmmodel.cxx b/svx/source/form/fmmodel.cxx
index e518319aab1e..58155f874c77 100644
--- a/svx/source/form/fmmodel.cxx
+++ b/svx/source/form/fmmodel.cxx
@@ -48,12 +48,8 @@ struct FmFormModelImplData
     }
 };
 
-FmFormModel::FmFormModel(
-    SfxItemPool* pPool,
-    SfxObjectShell* pPers)
-:   SdrModel(
-        pPool,
-        pPers)
+FmFormModel::FmFormModel(SfxItemPool* pPool, SfxObjectShell* pPers)
+    : SdrModel(pPool, pPers)
     , m_pObjShell(nullptr)
     , m_bOpenInDesignMode(false)
     , m_bAutoControlFocus(false)
diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx
index ca0c79479b4d..5c5d73d79a74 100644
--- a/svx/source/svdraw/svdmodel.cxx
+++ b/svx/source/svdraw/svdmodel.cxx
@@ -50,6 +50,7 @@
 #include <svx/svdoutl.hxx>
 #include <svx/dialmgr.hxx>
 #include <svx/strings.hrc>
+#include <svx/theme/IThemeColorChanger.hxx>
 #include <svdoutlinercache.hxx>
 #include <svx/sdasitm.hxx>
 #include <officecfg/Office/Common.hxx>
@@ -89,6 +90,7 @@ struct SdrModelImpl
     bool mbConnectorUseSnapRect;       // tdf#149756 compatibility flag
     bool mbIgnoreBreakAfterMultilineField; ///< tdf#148966 compatibility flag
     std::shared_ptr<model::Theme> mpTheme;
+    std::shared_ptr<svx::IThemeColorChanger> mpThemeColorChanger;
 
     SdrModelImpl()
         : mpUndoManager(nullptr)
diff --git a/svx/source/svdraw/svdpage.cxx b/svx/source/svdraw/svdpage.cxx
index 7caed6bbfc58..bc04316941c4 100644
--- a/svx/source/svdraw/svdpage.cxx
+++ b/svx/source/svdraw/svdpage.cxx
@@ -1222,17 +1222,6 @@ SdrPageProperties::SdrPageProperties(SdrPage& rSdrPage)
     {
         maProperties.Put(XFillStyleItem(drawing::FillStyle_NONE));
     }
-
-    //if (rSdrPage.getSdrModelFromSdrPage().IsWriter() || 
rSdrPage.IsMasterPage())
-    {
-        mpTheme.reset(new model::Theme("Office Theme"));
-        auto const* pColorSet = 
svx::ColorSets::get().getColorSet(u"LibreOffice");
-        if (pColorSet)
-        {
-            std::shared_ptr<model::ColorSet> pDefaultColorSet(new 
model::ColorSet(*pColorSet));
-            mpTheme->setColorSet(pDefaultColorSet);
-        }
-    }
 }
 
 SdrPageProperties::~SdrPageProperties()
@@ -1301,16 +1290,33 @@ void SdrPageProperties::SetStyleSheet(SfxStyleSheet* 
pStyleSheet)
     ImpPageChange(*mpSdrPage);
 }
 
-void SdrPageProperties::SetTheme(std::shared_ptr<model::Theme> const& pTheme)
+void SdrPageProperties::setTheme(std::shared_ptr<model::Theme> const& pTheme)
 {
-    if (mpTheme == pTheme)
+    if (!mpSdrPage)
         return;
 
-    mpTheme = pTheme;
+    // Only set the theme on a master page, else set it on the model
+
+    if (mpSdrPage->IsMasterPage())
+    {
+        if (mpTheme != pTheme)
+            mpTheme = pTheme;
+    }
+    else
+    {
+        mpSdrPage->getSdrModelFromSdrPage().setTheme(pTheme);
+    }
 }
 
-std::shared_ptr<model::Theme> const& SdrPageProperties::GetTheme() const
+std::shared_ptr<model::Theme> const& SdrPageProperties::getTheme() const
 {
+    // if set - page theme has priority
+    if (mpTheme)
+        return mpTheme;
+    // else the model theme
+    else if (mpSdrPage)
+        return mpSdrPage->getSdrModelFromSdrPage().getTheme();
+    // else return empty shared_ptr
     return mpTheme;
 }
 
diff --git a/sw/qa/core/theme/ThemeTest.cxx b/sw/qa/core/theme/ThemeTest.cxx
index de6132237a4b..fc9ed7be9abe 100644
--- a/sw/qa/core/theme/ThemeTest.cxx
+++ b/sw/qa/core/theme/ThemeTest.cxx
@@ -335,8 +335,9 @@ CPPUNIT_TEST_FIXTURE(SwCoreThemeTest, 
testDrawPageThemeExistsDOCX)
     SwDoc* pDoc = getSwDoc();
     CPPUNIT_ASSERT(pDoc);
 
-    SdrPage* pPage = 
pDoc->getIDocumentDrawModelAccess().GetDrawModel()->GetPage(0);
-    auto const& pTheme = pPage->getSdrPageProperties().GetTheme();
+    SdrModel* pModel = pDoc->getIDocumentDrawModelAccess().GetDrawModel();
+    CPPUNIT_ASSERT(pModel);
+    auto const& pTheme = pModel->getTheme();
     CPPUNIT_ASSERT(pTheme);
     CPPUNIT_ASSERT_EQUAL(OUString(u"Office Theme"), pTheme->GetName());
 
@@ -382,8 +383,9 @@ CPPUNIT_TEST_FIXTURE(SwCoreThemeTest, 
testDrawPageThemeExistsODT)
     SwDoc* pDoc = getSwDoc();
     CPPUNIT_ASSERT(pDoc);
 
-    SdrPage* pPage = 
pDoc->getIDocumentDrawModelAccess().GetDrawModel()->GetPage(0);
-    auto const& pTheme = pPage->getSdrPageProperties().GetTheme();
+    SdrModel* pModel = pDoc->getIDocumentDrawModelAccess().GetDrawModel();
+    CPPUNIT_ASSERT(pModel);
+    auto const& pTheme = pModel->getTheme();
     CPPUNIT_ASSERT(pTheme);
     CPPUNIT_ASSERT_EQUAL(OUString(u"Office Theme"), pTheme->GetName());
 
@@ -410,12 +412,12 @@ CPPUNIT_TEST_FIXTURE(SwCoreThemeTest, testThemeChanging)
     CPPUNIT_ASSERT(pDoc);
     SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
     CPPUNIT_ASSERT(pWrtShell);
-    SdrPage* pPage = 
pDoc->getIDocumentDrawModelAccess().GetDrawModel()->GetPage(0);
-    CPPUNIT_ASSERT(pPage);
+    SdrModel* pModel = pDoc->getIDocumentDrawModelAccess().GetDrawModel();
+    CPPUNIT_ASSERT(pModel);
 
     // Check current theme colors
     {
-        auto const& pTheme = pPage->getSdrPageProperties().GetTheme();
+        auto const& pTheme = pModel->getTheme();
         CPPUNIT_ASSERT(pTheme);
         CPPUNIT_ASSERT_EQUAL(OUString(u"Office Theme"), pTheme->GetName());
 
@@ -438,7 +440,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreThemeTest, testThemeChanging)
 
     // Check new theme colors
     {
-        auto const& pTheme = pPage->getSdrPageProperties().GetTheme();
+        auto const& pTheme = pModel->getTheme();
         CPPUNIT_ASSERT(pTheme);
         CPPUNIT_ASSERT_EQUAL(OUString(u"Office Theme"), pTheme->GetName());
 
@@ -453,7 +455,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreThemeTest, testThemeChanging)
 
     // Check theme colors have been reverted
     {
-        auto const& pTheme = pPage->getSdrPageProperties().GetTheme();
+        auto const& pTheme = pModel->getTheme();
         CPPUNIT_ASSERT(pTheme);
         CPPUNIT_ASSERT_EQUAL(OUString(u"Office Theme"), pTheme->GetName());
 
@@ -468,7 +470,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreThemeTest, testThemeChanging)
 
     // Check theme colors have been applied again
     {
-        auto const& pTheme = pPage->getSdrPageProperties().GetTheme();
+        auto const& pTheme = pModel->getTheme();
         CPPUNIT_ASSERT(pTheme);
         CPPUNIT_ASSERT_EQUAL(OUString(u"Office Theme"), pTheme->GetName());
 
diff --git a/sw/source/core/model/ThemeColorChanger.cxx 
b/sw/source/core/model/ThemeColorChanger.cxx
index 9b85db154d13..74dca3154d67 100644
--- a/sw/source/core/model/ThemeColorChanger.cxx
+++ b/sw/source/core/model/ThemeColorChanger.cxx
@@ -330,13 +330,13 @@ void 
ThemeColorChanger::apply(std::shared_ptr<model::ColorSet> const& pColorSet)
 
     pDocument->GetIDocumentUndoRedo().StartUndo(SwUndoId::EMPTY, nullptr);
 
-    SdrPage* pPage = 
pDocument->getIDocumentDrawModelAccess().GetDrawModel()->GetPage(0);
+    SdrModel* pModel = pDocument->getIDocumentDrawModelAccess().GetDrawModel();
 
-    auto pTheme = pPage->getSdrPageProperties().GetTheme();
+    auto pTheme = pModel->getTheme();
     if (!pTheme)
     {
         pTheme = std::make_shared<model::Theme>("Office");
-        pPage->getSdrPageProperties().SetTheme(pTheme);
+        pModel->setTheme(pTheme);
     }
 
     std::shared_ptr<model::ColorSet> pNewColorSet = pColorSet;
diff --git a/sw/source/core/undo/UndoThemeChange.cxx 
b/sw/source/core/undo/UndoThemeChange.cxx
index 468df82274e3..8e26106873e7 100644
--- a/sw/source/core/undo/UndoThemeChange.cxx
+++ b/sw/source/core/undo/UndoThemeChange.cxx
@@ -32,15 +32,15 @@ UndoThemeChange::~UndoThemeChange() {}
 
 void UndoThemeChange::UndoImpl(UndoRedoContext& /*rUndoRedoContext*/)
 {
-    SdrPage* pPage = 
mrDocument.getIDocumentDrawModelAccess().GetDrawModel()->GetPage(0);
-    auto pTheme = pPage->getSdrPageProperties().GetTheme();
+    SdrModel* pModel = mrDocument.getIDocumentDrawModelAccess().GetDrawModel();
+    auto pTheme = pModel->getTheme();
     pTheme->setColorSet(mpOldColorSet);
 }
 
 void UndoThemeChange::RedoImpl(UndoRedoContext& /*rUndoRedoContext*/)
 {
-    SdrPage* pPage = 
mrDocument.getIDocumentDrawModelAccess().GetDrawModel()->GetPage(0);
-    auto pTheme = pPage->getSdrPageProperties().GetTheme();
+    SdrModel* pModel = mrDocument.getIDocumentDrawModelAccess().GetDrawModel();
+    auto pTheme = pModel->getTheme();
     pTheme->setColorSet(mpNewColorSet);
 }
 }
diff --git a/sw/source/core/unocore/unodraw.cxx 
b/sw/source/core/unocore/unodraw.cxx
index a1a588182e4c..8f72cc2bee0a 100644
--- a/sw/source/core/unocore/unodraw.cxx
+++ b/sw/source/core/unocore/unodraw.cxx
@@ -406,7 +406,7 @@ void SwFmDrawPage::setPropertyValue(const OUString& 
rPropertyName, const uno::An
             if (aValue >>= xTheme)
             {
                 auto& rUnoTheme = dynamic_cast<UnoTheme&>(*xTheme);
-                pPage->getSdrPageProperties().SetTheme(rUnoTheme.getTheme());
+                pPage->getSdrModelFromSdrPage().setTheme(rUnoTheme.getTheme());
             }
         }
         break;
@@ -442,7 +442,7 @@ uno::Any SwFmDrawPage::getPropertyValue(const OUString& 
rPropertyName)
         {
             css::uno::Reference<css::util::XTheme> xTheme;
 
-            auto pTheme = GetSdrPage()->getSdrPageProperties().GetTheme();
+            auto pTheme = GetSdrPage()->getSdrModelFromSdrPage().getTheme();
             if (pTheme)
                 xTheme = model::theme::createXTheme(pTheme);
             aAny <<= xTheme;
diff --git a/sw/source/filter/ww8/docxexport.cxx 
b/sw/source/filter/ww8/docxexport.cxx
index 7ad0f16eb6fb..41bfeed89771 100644
--- a/sw/source/filter/ww8/docxexport.cxx
+++ b/sw/source/filter/ww8/docxexport.cxx
@@ -1469,8 +1469,10 @@ void DocxExport::WriteSettings()
 
 void DocxExport::WriteTheme()
 {
-    SdrPage* pPage = 
m_rDoc.getIDocumentDrawModelAccess().GetDrawModel()->GetPage(0);
-    auto const& pTheme = pPage->getSdrPageProperties().GetTheme();
+    SdrModel* pModel = m_rDoc.getIDocumentDrawModelAccess().GetDrawModel();
+    if (!pModel)
+        return;
+    auto const& pTheme = pModel->getTheme();
     if (!pTheme)
         return;
 
diff --git a/sw/source/filter/xml/xmlfmte.cxx b/sw/source/filter/xml/xmlfmte.cxx
index 91fd2a51095b..6da12046665b 100644
--- a/sw/source/filter/xml/xmlfmte.cxx
+++ b/sw/source/filter/xml/xmlfmte.cxx
@@ -46,6 +46,7 @@
 #include <o3tl/enumrange.hxx>
 #include <svx/unoapi.hxx>
 #include <svx/svdpage.hxx>
+#include <svx/svdmodel.hxx>
 #include <docmodel/theme/ThemeColorType.hxx>
 #include <docmodel/theme/Theme.hxx>
 
@@ -206,7 +207,7 @@ void SwXMLExport::ExportThemeElement(const 
uno::Reference<drawing::XDrawPage>& x
     if (!pPage)
         return;
 
-    auto const& pTheme = pPage->getSdrPageProperties().GetTheme();
+    auto const& pTheme = pPage->getSdrModelFromSdrPage().getTheme();
     if (!pTheme)
         return;
 
diff --git a/sw/source/uibase/app/docst.cxx b/sw/source/uibase/app/docst.cxx
index 6fe201784e76..f3ddbbe22dc2 100644
--- a/sw/source/uibase/app/docst.cxx
+++ b/sw/source/uibase/app/docst.cxx
@@ -1582,10 +1582,10 @@ std::set<Color> SwDocShell::GetDocColors()
 
 std::shared_ptr<model::ColorSet> SwDocShell::GetThemeColors()
 {
-    SdrPage* pPage = 
m_xDoc->getIDocumentDrawModelAccess().GetDrawModel()->GetPage(0);
-    if (!pPage)
+    SdrModel* pModel = m_xDoc->getIDocumentDrawModelAccess().GetDrawModel();
+    if (!pModel)
         return {};
-    auto const& pTheme = pPage->getSdrPageProperties().GetTheme();
+    auto const& pTheme = pModel->getTheme();
     if (!pTheme)
         return {};
     return pTheme->getColorSet();
diff --git a/sw/source/uibase/shells/basesh.cxx 
b/sw/source/uibase/shells/basesh.cxx
index 6932ed068fd7..a2b415cf27c9 100644
--- a/sw/source/uibase/shells/basesh.cxx
+++ b/sw/source/uibase/shells/basesh.cxx
@@ -2218,10 +2218,10 @@ void SwBaseShell::GetState( SfxItemSet &rSet )
                 auto* pDocumentShell = pDocument->GetDocShell();
                 if (pDocumentShell)
                 {
-                    SdrPage* pPage = 
pDocument->getIDocumentDrawModelAccess().GetDrawModel()->GetPage(0);
-                    if (pPage)
+                    SdrModel* pModel = 
pDocument->getIDocumentDrawModelAccess().GetDrawModel();
+                    if (pModel)
                     {
-                        auto const& pTheme = 
pPage->getSdrPageProperties().GetTheme();
+                        auto const& pTheme = pModel->getTheme();
                         if (pTheme)
                             bDisable = false;
                     }
@@ -3082,8 +3082,8 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq)
             auto* pDocumentShell = pDocument->GetDocShell();
             if (pDocumentShell)
             {
-                SdrPage* pPage = 
pDocument->getIDocumentDrawModelAccess().GetDrawModel()->GetPage(0);
-                auto const& pTheme = pPage->getSdrPageProperties().GetTheme();
+                SdrModel* pModel = 
pDocument->getIDocumentDrawModelAccess().GetDrawModel();
+                auto const& pTheme = pModel->getTheme();
                 if (pTheme)
                 {
                     std::shared_ptr<svx::IThemeColorChanger> pChanger(new 
sw::ThemeColorChanger(pDocumentShell));

Reply via email to