filter/source/svg/svgexport.cxx               |   12 +-
 sw/inc/unodraw.hxx                            |   21 +++-
 sw/inc/unomap.hxx                             |   18 +++
 sw/qa/core/theme/ThemeTest.cxx                |   29 +++++-
 sw/qa/core/theme/data/ThemeColorInHeading.odt |binary
 sw/qa/unoapi/knownissues.xcl                  |    8 -
 sw/source/core/unocore/unodraw.cxx            |  122 +++++++++++++++++++++++++-
 sw/source/core/unocore/unomap.cxx             |   23 ++++
 sw/source/core/unocore/unomap1.cxx            |    6 +
 xmloff/CppunitTest_xmloff_text.mk             |    1 
 xmloff/qa/unit/text.cxx                       |   49 ++++++++++
 xmloff/source/style/xmlstyle.cxx              |   21 +++-
 12 files changed, 289 insertions(+), 21 deletions(-)

New commits:
commit d8de2dc3c55a9013a71167c8058a333e7221a6a0
Author:     Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk>
AuthorDate: Sat Jan 28 18:43:51 2023 +0900
Commit:     Tomaž Vajngerl <qui...@gmail.com>
CommitDate: Wed Feb 1 08:41:30 2023 +0000

    xmloff: import of theme structure + import/export/round-trip tests
    
    Change-Id: I50e8c53c534895098613e81fd97b346fd3d7d05f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146287
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <qui...@gmail.com>

diff --git a/sw/qa/core/theme/ThemeTest.cxx b/sw/qa/core/theme/ThemeTest.cxx
index 8f12e8bdacbd..e3ed5548f528 100644
--- a/sw/qa/core/theme/ThemeTest.cxx
+++ b/sw/qa/core/theme/ThemeTest.cxx
@@ -42,7 +42,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreThemeTest, testThemeColorInHeading)
     CPPUNIT_ASSERT_EQUAL(model::ThemeColorType::Accent1, 
aThemeColor.getType());
 }
 
-CPPUNIT_TEST_FIXTURE(SwCoreThemeTest, testDrawPageThemeExists)
+CPPUNIT_TEST_FIXTURE(SwCoreThemeTest, testDrawPageThemeExistsDOCX)
 {
     createSwDoc("ThemeColorInHeading.docx");
     SwDoc* pDoc = getSwDoc();
@@ -83,6 +83,33 @@ CPPUNIT_TEST_FIXTURE(SwCoreThemeTest, 
testDrawPageThemeExists)
                          rFontScheme.findMinorSupplementalTypeface(u"Thai"));
 }
 
+CPPUNIT_TEST_FIXTURE(SwCoreThemeTest, testDrawPageThemeExistsODT)
+{
+    createSwDoc("ThemeColorInHeading.odt");
+    SwDoc* pDoc = getSwDoc();
+    CPPUNIT_ASSERT(pDoc);
+
+    SdrPage* pPage = 
pDoc->getIDocumentDrawModelAccess().GetDrawModel()->GetPage(0);
+    model::Theme* pTheme = pPage->getSdrPageProperties().GetTheme();
+    CPPUNIT_ASSERT(pTheme);
+    CPPUNIT_ASSERT_EQUAL(OUString(u"Office Theme"), pTheme->GetName());
+
+    model::ColorSet* pColorSet = pTheme->GetColorSet();
+    CPPUNIT_ASSERT(pColorSet);
+    CPPUNIT_ASSERT_EQUAL(OUString(u"Orange"), pColorSet->getName());
+
+    CPPUNIT_ASSERT_EQUAL(Color(0xE48312), 
pTheme->GetColor(model::ThemeColorType::Accent1));
+    CPPUNIT_ASSERT_EQUAL(Color(0xBD582C), 
pTheme->GetColor(model::ThemeColorType::Accent2));
+    CPPUNIT_ASSERT_EQUAL(Color(0x865640), 
pTheme->GetColor(model::ThemeColorType::Accent3));
+    CPPUNIT_ASSERT_EQUAL(Color(0x9B8357), 
pTheme->GetColor(model::ThemeColorType::Accent4));
+    CPPUNIT_ASSERT_EQUAL(Color(0xC2BC80), 
pTheme->GetColor(model::ThemeColorType::Accent5));
+    CPPUNIT_ASSERT_EQUAL(Color(0x94A088), 
pTheme->GetColor(model::ThemeColorType::Accent6));
+    CPPUNIT_ASSERT_EQUAL(Color(0x000000), 
pTheme->GetColor(model::ThemeColorType::Dark1));
+    CPPUNIT_ASSERT_EQUAL(Color(0x637052), 
pTheme->GetColor(model::ThemeColorType::Dark2));
+    CPPUNIT_ASSERT_EQUAL(Color(0xFFFFFF), 
pTheme->GetColor(model::ThemeColorType::Light1));
+    CPPUNIT_ASSERT_EQUAL(Color(0xCCDDEA), 
pTheme->GetColor(model::ThemeColorType::Light2));
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/qa/core/theme/data/ThemeColorInHeading.odt 
b/sw/qa/core/theme/data/ThemeColorInHeading.odt
new file mode 100644
index 000000000000..9931ac4e2dc1
Binary files /dev/null and b/sw/qa/core/theme/data/ThemeColorInHeading.odt 
differ
diff --git a/xmloff/CppunitTest_xmloff_text.mk 
b/xmloff/CppunitTest_xmloff_text.mk
index a611aa428af7..7fc0fa394950 100644
--- a/xmloff/CppunitTest_xmloff_text.mk
+++ b/xmloff/CppunitTest_xmloff_text.mk
@@ -24,6 +24,7 @@ $(eval $(call gb_CppunitTest_use_libraries,xmloff_text, \
     comphelper \
     cppu \
     cppuhelper \
+    docmodel \
     embobj \
     sal \
     subsequenttest \
diff --git a/xmloff/qa/unit/text.cxx b/xmloff/qa/unit/text.cxx
index f7155f546df3..5dfd52010a09 100644
--- a/xmloff/qa/unit/text.cxx
+++ b/xmloff/qa/unit/text.cxx
@@ -16,11 +16,13 @@
 #include <com/sun/star/text/BibliographyDataType.hpp>
 #include <com/sun/star/text/TextContentAnchorType.hpp>
 #include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
+#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
 
 #include <comphelper/propertysequence.hxx>
 #include <comphelper/propertyvalue.hxx>
 #include <comphelper/sequenceashashmap.hxx>
 #include <unotools/tempfile.hxx>
+#include <docmodel/uno/UnoTheme.hxx>
 
 using namespace ::com::sun::star;
 
@@ -907,6 +909,53 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, 
testScaleWidthRedline)
     assertXPath(pXmlDoc, "//draw:frame[@draw:name='Image45']", "width", 
"6.1728in");
 }
 
+CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testThemeExport)
+{
+    mxComponent = loadFromDesktop("private:factory/swriter");
+
+    uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, 
uno::UNO_QUERY);
+    uno::Reference<drawing::XDrawPage> xDrawPage = 
xDrawPageSupplier->getDrawPage();
+    uno::Reference<beans::XPropertySet> xPageProps(xDrawPage, uno::UNO_QUERY);
+
+    model::Theme aTheme("My Theme");
+    std::unique_ptr<model::ColorSet> pColorSet(new model::ColorSet("My Color 
Scheme"));
+    pColorSet->add(model::ThemeColorType::Dark1, 0x101010);
+    pColorSet->add(model::ThemeColorType::Light1, 0x202020);
+    pColorSet->add(model::ThemeColorType::Dark2, 0x303030);
+    pColorSet->add(model::ThemeColorType::Light2, 0x404040);
+    pColorSet->add(model::ThemeColorType::Accent1, 0x505050);
+    pColorSet->add(model::ThemeColorType::Accent2, 0x606060);
+    pColorSet->add(model::ThemeColorType::Accent3, 0x707070);
+    pColorSet->add(model::ThemeColorType::Accent4, 0x808080);
+    pColorSet->add(model::ThemeColorType::Accent5, 0x909090);
+    pColorSet->add(model::ThemeColorType::Accent6, 0xa0a0a0);
+    pColorSet->add(model::ThemeColorType::Hyperlink, 0xb0b0b0);
+    pColorSet->add(model::ThemeColorType::FollowedHyperlink, 0xc0c0c0);
+    aTheme.SetColorSet(std::move(pColorSet));
+
+    uno::Reference<util::XTheme> xTheme = model::theme::createXTheme(aTheme);
+    xPageProps->setPropertyValue("Theme", uno::Any(xTheme));
+
+    // Export to ODT:
+    save("writer8");
+
+    // Check if the 12 colors are written in the XML:
+    xmlDocUniquePtr pXmlDoc = parseExport("styles.xml");
+    assertXPath(pXmlDoc, 
"//office:styles/loext:theme/loext:color-table/loext:color", 12);
+    assertXPath(pXmlDoc, 
"//office:styles/loext:theme/loext:color-table/loext:color[1]", "name",
+                "dk1");
+    assertXPath(pXmlDoc, 
"//office:styles/loext:theme/loext:color-table/loext:color[1]", "color",
+                "#101010");
+    assertXPath(pXmlDoc, 
"//office:styles/loext:theme/loext:color-table/loext:color[2]", "name",
+                "lt1");
+    assertXPath(pXmlDoc, 
"//office:styles/loext:theme/loext:color-table/loext:color[2]", "color",
+                "#202020");
+    assertXPath(pXmlDoc, 
"//office:styles/loext:theme/loext:color-table/loext:color[12]", "name",
+                "folHlink");
+    assertXPath(pXmlDoc, 
"//office:styles/loext:theme/loext:color-table/loext:color[12]", "color",
+                "#c0c0c0");
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmloff/source/style/xmlstyle.cxx b/xmloff/source/style/xmlstyle.cxx
index bd4273056c98..c72684102a5f 100644
--- a/xmloff/source/style/xmlstyle.cxx
+++ b/xmloff/source/style/xmlstyle.cxx
@@ -27,6 +27,7 @@
 #include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
 #include <com/sun/star/style/XAutoStylesSupplier.hpp>
 #include <com/sun/star/style/XAutoStyleFamily.hpp>
+#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
 #include <PageMasterPropMapper.hxx>
 #include <sal/log.hxx>
 #include <svl/style.hxx>
@@ -44,6 +45,7 @@
 #include <xmloff/xmlnumfi.hxx>
 #include <XMLChartStyleContext.hxx>
 #include <XMLChartPropertySetMapper.hxx>
+#include <XMLThemeContext.hxx>
 #include <xmloff/XMLShapeStyleContext.hxx>
 #include "FillStyleContext.hxx"
 #include <XMLFootnoteConfigurationImportContext.hxx>
@@ -708,14 +710,23 @@ SvXMLStylesContext::~SvXMLStylesContext()
 css::uno::Reference< css::xml::sax::XFastContextHandler > 
SvXMLStylesContext::createFastChildContext(
         sal_Int32 nElement, const css::uno::Reference< 
css::xml::sax::XFastAttributeList >& xAttrList )
 {
-    SvXMLStyleContext *pStyle =
-        CreateStyleChildContext( nElement, xAttrList );
-    if( pStyle )
+    SvXMLStyleContext* pStyle = CreateStyleChildContext( nElement, xAttrList );
+    if (pStyle)
     {
-        if( !pStyle->IsTransient() )
-            mpImpl->AddStyle( pStyle );
+        if (!pStyle->IsTransient())
+            mpImpl->AddStyle(pStyle);
         return pStyle;
     }
+    else if (nElement ==  XML_ELEMENT(LO_EXT, XML_THEME))
+    {
+        uno::Reference<drawing::XDrawPageSupplier> const 
xDrawPageSupplier(GetImport().GetModel(), uno::UNO_QUERY);
+        if (xDrawPageSupplier.is())
+        {
+            uno::Reference<drawing::XDrawPage> xPage = 
xDrawPageSupplier->getDrawPage();
+            if (xPage.is())
+                return new XMLThemeContext(GetImport(), xAttrList, xPage);
+        }
+    }
 
     return nullptr;
 }
commit 7ab51def766ad6bfdcf5111e7b751bbc2bbf1d73
Author:     Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk>
AuthorDate: Fri Jan 27 15:04:33 2023 +0900
Commit:     Tomaž Vajngerl <qui...@gmail.com>
CommitDate: Wed Feb 1 08:41:21 2023 +0000

    sw: implement "Theme" property for the XDrawPage in Writer
    
    Change-Id: I8eed04f0ccb2e626a648abcaecd957b6f62c39d8
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146226
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <qui...@gmail.com>

diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx
index 55e4be02052b..c27481baf79b 100644
--- a/filter/source/svg/svgexport.cxx
+++ b/filter/source/svg/svgexport.cxx
@@ -935,10 +935,14 @@ bool SVGFilter::implExportDocument()
     // #i124608#
     mbExportShapeSelection = mbSinglePage && maShapeSelection.is() && 
maShapeSelection->getCount();
 
-    if(xDefaultPagePropertySet.is())
-    {
-        xDefaultPagePropertySet->getPropertyValue( "Width" ) >>= nDocWidth;
-        xDefaultPagePropertySet->getPropertyValue( "Height" ) >>= nDocHeight;
+    if (xDefaultPagePropertySet.is())
+    {
+        sal_Int32 nWidth = 0;
+        sal_Int32 nHeight = 0;
+        if (xDefaultPagePropertySet->getPropertyValue("Width") >>= nWidth)
+            nDocWidth = nWidth;
+        if (xDefaultPagePropertySet->getPropertyValue("Height") >>= nHeight)
+            nDocHeight = nHeight;
     }
 
     if(mbExportShapeSelection)
diff --git a/sw/inc/unodraw.hxx b/sw/inc/unodraw.hxx
index 0c926e28e16b..1f9efea10eac 100644
--- a/sw/inc/unodraw.hxx
+++ b/sw/inc/unodraw.hxx
@@ -31,7 +31,7 @@
 #include <com/sun/star/beans/XPropertyState.hpp>
 #include <com/sun/star/drawing/XShapes.hpp>
 #include <cppuhelper/implbase.hxx>
-#include <cppuhelper/implbase1.hxx>
+#include <cppuhelper/implbase2.hxx>
 #include <com/sun/star/container/XEnumerationAccess.hpp>
 #include <com/sun/star/drawing/HomogenMatrix3.hpp>
 
@@ -40,16 +40,20 @@ class SdrView;
 class SwDoc;
 class SwXShape;
 
-typedef cppu::AggImplInheritanceHelper1
+typedef cppu::AggImplInheritanceHelper2
 <
     SvxFmDrawPage,
-    css::container::XEnumerationAccess
-> SwFmDrawPage_Base;
+    css::container::XEnumerationAccess,
+    css::beans::XPropertySet>
+        SwFmDrawPage_Base;
+
 class SwFmDrawPage final : public SwFmDrawPage_Base
 {
     SwDoc*          m_pDoc;
     SdrPageView*        m_pPageView;
     std::vector<rtl::Reference<SwXShape>> m_vShapes;
+    const SfxItemPropertySet* m_pPropertySet;
+
 public:
     SwFmDrawPage( SwDoc* pDoc, SdrPage* pPage );
     virtual ~SwFmDrawPage() noexcept override;
@@ -98,6 +102,15 @@ public:
     virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) 
override;
     virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() 
override;
 
+    //XPropertySet
+    virtual css::uno::Reference<css::beans::XPropertySetInfo> SAL_CALL 
getPropertySetInfo() override;
+    virtual void SAL_CALL setPropertyValue(const OUString& aPropertyName, 
const css::uno::Any& aValue) override;
+    virtual css::uno::Any SAL_CALL getPropertyValue(const OUString& 
PropertyName) override;
+    virtual void SAL_CALL addPropertyChangeListener(const OUString& 
aPropertyName, const css::uno::Reference<css::beans::XPropertyChangeListener>& 
xListener) override;
+    virtual void SAL_CALL removePropertyChangeListener(const OUString& 
aPropertyName, const css::uno::Reference<css::beans::XPropertyChangeListener>& 
aListener) override;
+    virtual void SAL_CALL addVetoableChangeListener(const OUString& 
PropertyName, const css::uno::Reference<css::beans::XVetoableChangeListener>& 
aListener) override;
+    virtual void SAL_CALL removeVetoableChangeListener(const OUString& 
PropertyName, const css::uno::Reference<css::beans::XVetoableChangeListener>& 
aListener) override;
+
     // renamed and outlined to detect where it's called
     void    InvalidateSwDoc(); // {pDoc = 0;}
 };
diff --git a/sw/inc/unomap.hxx b/sw/inc/unomap.hxx
index 689fa87063a1..84245bea2d14 100644
--- a/sw/inc/unomap.hxx
+++ b/sw/inc/unomap.hxx
@@ -128,7 +128,8 @@ class SfxItemPropertySet;
 #define PROPERTY_MAP_FIELDMARK                          102
 #define PROPERTY_MAP_LINEBREAK                          103
 #define PROPERTY_MAP_CONTENTCONTROL                     104
-#define PROPERTY_MAP_END                                105
+#define PROPERTY_MAP_TEXT_PAGE                          105
+#define PROPERTY_MAP_END                                106
 
 //S&E
 #define WID_WORDS                0
@@ -307,6 +308,21 @@ class SfxItemPropertySet;
 #define WID_IS_OUTLINE                  4
 #define WID_DEFAULT_LIST_ID             5
 
+#define WID_PAGE_BOTTOM 0
+#define WID_PAGE_LEFT   1
+#define WID_PAGE_RIGHT  2
+#define WID_PAGE_TOP    3
+#define WID_PAGE_WIDTH  4
+#define WID_PAGE_HEIGHT 5
+#define WID_PAGE_NUMBER 6
+#define WID_PAGE_ORIENT 7
+#define WID_PAGE_USERATTRIBS 8
+#define WID_PAGE_ISDARK 9
+#define WID_NAVORDER 10
+#define WID_PAGE_BACKFULL 11
+
+#define WID_PAGE_THEME 12
+
 // This define would need the include of <svx/unoshprp.hxx>, but this ends
 // in a mess; there *are* double used symbols which are used in a #define in
 // editengine and as an enum in sw; these will then collide and lead to severe
diff --git a/sw/qa/unoapi/knownissues.xcl b/sw/qa/unoapi/knownissues.xcl
index fdd88e231de9..7b62e95407e6 100644
--- a/sw/qa/unoapi/knownissues.xcl
+++ b/sw/qa/unoapi/knownissues.xcl
@@ -114,14 +114,14 @@ sw.SwXTextDocument::com::sun::star::frame::XStorable
 
 ### i85640 ###
 sw.SwXMailMerge
-#-> disabled in sw.sce 
+#-> disabled in sw.sce
 
 ### i86656 ###
 
sw.SwAccessibleDocumentView::com::sun::star::accessibility::XAccessibleComponent
 
 ### i86751 ###
 
sw.SwAccessibleDocumentPageView::com::sun::star::accessibility::XAccessibleEventBroadcaster
-#-> disabled in sw.sce 
+#-> disabled in sw.sce
 
 ### i87978 ###
 sw.DocumentSettings::com::sun::star::beans::XPropertySet
@@ -148,11 +148,11 @@ 
sw.SwAccessibleTextGraphicObject::com::sun::star::accessibility::XAccessibleCont
 
 ### i89021 ###
 sw.SwXTextDefaults
-#-> disabled in sw.sce 
+#-> disabled in sw.sce
 
 ### i89022 ###
 sw.SwAccessiblePageView
-#-> disabled in sw.sce 
+#-> disabled in sw.sce
 
 ### i89419 ###
 sw.SwXTextEmbeddedObject::com::sun::star::text::BaseFrameProperties
diff --git a/sw/source/core/unocore/unodraw.cxx 
b/sw/source/core/unocore/unodraw.cxx
index b65f3d855902..f7603c423ad9 100644
--- a/sw/source/core/unocore/unodraw.cxx
+++ b/sw/source/core/unocore/unodraw.cxx
@@ -77,6 +77,7 @@
 #include <com/sun/star/drawing/PointSequence.hpp>
 #include <com/sun/star/lang/IllegalArgumentException.hpp>
 #include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
+#include <docmodel/uno/UnoTheme.hxx>
 
 using namespace ::com::sun::star;
 
@@ -252,8 +253,11 @@ public:
     }
 };
 
-SwFmDrawPage::SwFmDrawPage( SwDoc* pDoc, SdrPage* pPage ) :
-    SwFmDrawPage_Base( pPage ), m_pDoc(pDoc), m_pPageView(nullptr)
+SwFmDrawPage::SwFmDrawPage( SwDoc* pDoc, SdrPage* pPage )
+    : SwFmDrawPage_Base(pPage)
+    , m_pDoc(pDoc)
+    , m_pPageView(nullptr)
+    , m_pPropertySet(aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_PAGE))
 {
 }
 
@@ -382,6 +386,120 @@ uno::Reference< drawing::XShape > 
SwFmDrawPage::CreateShape( SdrObject *pObj ) c
     return xRet;
 }
 
+uno::Reference<beans::XPropertySetInfo> SwFmDrawPage::getPropertySetInfo()
+{
+    static uno::Reference<beans::XPropertySetInfo> xRet = 
m_pPropertySet->getPropertySetInfo();
+    return xRet;
+}
+
+void SwFmDrawPage::setPropertyValue(const OUString& rPropertyName, const 
uno::Any& aValue)
+{
+    SolarMutexGuard aGuard;
+    const SfxItemPropertyMapEntry* pEntry = 
m_pPropertySet->getPropertyMap().getByName(rPropertyName);
+
+    switch (pEntry ? pEntry->nWID : -1)
+    {
+        case WID_PAGE_THEME:
+        {
+            SdrPage* pPage = GetSdrPage();
+            css::uno::Reference<css::util::XTheme> xTheme;
+            if (aValue >>= xTheme)
+            {
+                auto* pUnoTheme = dynamic_cast<UnoTheme*>(xTheme.get());
+                std::unique_ptr<model::Theme> pTheme(new 
model::Theme(pUnoTheme->getTheme()));
+                pPage->getSdrPageProperties().SetTheme(std::move(pTheme));
+            }
+        }
+        break;
+        case WID_PAGE_BOTTOM:
+        case WID_PAGE_LEFT:
+        case WID_PAGE_RIGHT:
+        case WID_PAGE_TOP:
+        case WID_PAGE_WIDTH:
+        case WID_PAGE_HEIGHT:
+        case WID_PAGE_NUMBER:
+        case WID_PAGE_ORIENT:
+        case WID_PAGE_USERATTRIBS:
+        case WID_PAGE_ISDARK:
+        case WID_NAVORDER:
+        case WID_PAGE_BACKFULL:
+            break;
+
+        default:
+            throw beans::UnknownPropertyException(rPropertyName, 
static_cast<cppu::OWeakObject*>(this));
+    }
+}
+
+uno::Any SwFmDrawPage::getPropertyValue(const OUString& rPropertyName)
+{
+    SolarMutexGuard aGuard;
+    const SfxItemPropertyMapEntry* pEntry = 
m_pPropertySet->getPropertyMap().getByName( rPropertyName);
+
+    uno::Any aAny;
+
+    switch (pEntry ? pEntry->nWID : -1)
+    {
+        case WID_PAGE_THEME:
+        {
+            css::uno::Reference<css::util::XTheme> xTheme;
+
+            auto* pTheme = GetSdrPage()->getSdrPageProperties().GetTheme();
+            if (pTheme)
+                xTheme = new UnoTheme(*pTheme);
+            aAny <<= xTheme;
+        }
+        break;
+
+        case WID_PAGE_NUMBER:
+        {
+            const sal_uInt16 nPageNumber(GetSdrPage()->GetPageNum());
+            aAny <<= o3tl::narrowing<sal_Int16>(nPageNumber);
+        }
+        break;
+
+        case WID_PAGE_BOTTOM:
+        case WID_PAGE_LEFT:
+        case WID_PAGE_RIGHT:
+        case WID_PAGE_TOP:
+        case WID_PAGE_WIDTH:
+        case WID_PAGE_HEIGHT:
+        case WID_PAGE_ORIENT:
+        case WID_PAGE_USERATTRIBS:
+        case WID_PAGE_ISDARK:
+        case WID_NAVORDER:
+        case WID_PAGE_BACKFULL:
+            break;
+
+        default:
+            throw beans::UnknownPropertyException(rPropertyName, 
static_cast<cppu::OWeakObject*>(this));
+    }
+    return aAny;
+}
+
+void SwFmDrawPage::addPropertyChangeListener(const OUString& /*PropertyName*/,
+    const uno::Reference<beans::XPropertyChangeListener> & /*aListener*/)
+{
+    OSL_FAIL("not implemented");
+}
+
+void SwFmDrawPage::removePropertyChangeListener(const OUString& 
/*PropertyName*/,
+    const uno::Reference<beans::XPropertyChangeListener> & /*aListener*/)
+{
+    OSL_FAIL("not implemented");
+}
+
+void SwFmDrawPage::addVetoableChangeListener(const OUString& /*PropertyName*/,
+    const uno::Reference<beans::XVetoableChangeListener> & /*aListener*/)
+{
+    OSL_FAIL("not implemented");
+}
+
+void SwFmDrawPage::removeVetoableChangeListener(const OUString& 
/*PropertyName*/,
+    const uno::Reference<beans::XVetoableChangeListener> & /*aListener*/)
+{
+    OSL_FAIL("not implemented");
+}
+
 namespace
 {
     class SwXShapesEnumeration
diff --git a/sw/source/core/unocore/unomap.cxx 
b/sw/source/core/unocore/unomap.cxx
index f6765dadd4b9..a978b5b378cd 100644
--- a/sw/source/core/unocore/unomap.cxx
+++ b/sw/source/core/unocore/unomap.cxx
@@ -45,6 +45,8 @@
 #include <com/sun/star/text/XTextSection.hpp>
 #include <com/sun/star/util/Date.hpp>
 #include <com/sun/star/util/DateTime.hpp>
+#include <com/sun/star/util/XTheme.hpp>
+#include <com/sun/star/view/PaperOrientation.hpp>
 #include <com/sun/star/script/XLibraryContainer.hpp>
 #include <com/sun/star/drawing/HomogenMatrix3.hpp>
 #include <osl/diagnose.h>
@@ -232,6 +234,27 @@ o3tl::span<const SfxItemPropertyMapEntry> 
SwUnoPropertyMapProvider::GetPropertyM
                 m_aMapEntriesArr[nPropertyId] = GetEmbeddedPropertyMap();
             }
             break;
+            case PROPERTY_MAP_TEXT_PAGE:
+            {
+                static SfxItemPropertyMapEntry const aPageMap_Impl[] =
+                {
+                    { u"BorderBottom", WID_PAGE_BOTTOM, 
::cppu::UnoType<sal_Int32>::get(), PropertyAttribute::MAYBEVOID,  0},
+                    { u"BorderLeft", WID_PAGE_LEFT,     
::cppu::UnoType<sal_Int32>::get(), PropertyAttribute::MAYBEVOID,  0},
+                    { u"BorderRight", WID_PAGE_RIGHT,   
::cppu::UnoType<sal_Int32>::get(), PropertyAttribute::MAYBEVOID,  0},
+                    { u"BorderTop", WID_PAGE_TOP,       
::cppu::UnoType<sal_Int32>::get(), PropertyAttribute::MAYBEVOID,  0},
+                    { u"Height", WID_PAGE_HEIGHT,       
::cppu::UnoType<sal_Int32>::get(), PropertyAttribute::MAYBEVOID,  0},
+                    { u"Width", WID_PAGE_WIDTH,         
::cppu::UnoType<sal_Int32>::get(), PropertyAttribute::MAYBEVOID,  0},
+                    { u"Number", WID_PAGE_NUMBER,       
::cppu::UnoType<sal_Int16>::get(), PropertyAttribute::MAYBEVOID,  0},
+                    { u"Orientation", WID_PAGE_ORIENT,  
::cppu::UnoType<view::PaperOrientation>::get(), 
PropertyAttribute::MAYBEVOID|PropertyAttribute::READONLY,  0},
+                    { u"UserDefinedAttributes", WID_PAGE_USERATTRIBS, 
::cppu::UnoType<container::XNameContainer>::get(), 
PropertyAttribute::MAYBEVOID,  0},
+                    { u"IsBackgroundDark", WID_PAGE_ISDARK, 
::cppu::UnoType<bool>::get(), 
PropertyAttribute::MAYBEVOID|PropertyAttribute::READONLY,  0},
+                    { u"NavigationOrder", WID_NAVORDER,     
::cppu::UnoType<container::XIndexAccess>::get(), PropertyAttribute::MAYBEVOID,  
0},
+                    { u"BackgroundFullSize", WID_PAGE_BACKFULL, 
::cppu::UnoType<bool>::get(), PropertyAttribute::MAYBEVOID,  0},
+                    { u"Theme", WID_PAGE_THEME, 
cppu::UnoType<util::XTheme>::get(), PropertyAttribute::MAYBEVOID,  0}
+                };
+                m_aMapEntriesArr[nPropertyId] = aPageMap_Impl;
+            }
+            break;
             case PROPERTY_MAP_TEXT_SHAPE:
             {
                 static SfxItemPropertyMapEntry const aShapeMap_Impl[] =
diff --git a/sw/source/core/unocore/unomap1.cxx 
b/sw/source/core/unocore/unomap1.cxx
index 2d4dc92af0cd..4496a65bae07 100644
--- a/sw/source/core/unocore/unomap1.cxx
+++ b/sw/source/core/unocore/unomap1.cxx
@@ -1163,6 +1163,12 @@ const SfxItemPropertySet*  
SwUnoPropertyMapProvider::GetPropertySet( sal_uInt16
                 m_aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_TEXT_GRAPHIC;
             }
             break;
+            case PROPERTY_MAP_TEXT_PAGE:
+            {
+                static SfxItemPropertySet aPROPERTY_MAP_TEXT_PAGE(pEntries);
+                m_aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_TEXT_PAGE;
+            }
+            break;
             case PROPERTY_MAP_TEXT_SHAPE:
             {
                 static SfxItemPropertySet aPROPERTY_MAP_TEXT_SHAPE(pEntries);

Reply via email to