include/xmloff/xmltoken.hxx                                 |    4 
 sc/qa/unit/ThemeImportExportTest.cxx                        |   20 ++++
 sc/source/filter/xml/xmlstyle.cxx                           |    9 --
 sc/source/filter/xml/xmlstyli.cxx                           |   45 +++++-----
 schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng |   52 ++++++++++++
 xmloff/Library_xo.mk                                        |    1 
 xmloff/source/core/xmltoken.cxx                             |    4 
 xmloff/source/style/StylePropertiesContext.cxx              |   44 ++++++++++
 xmloff/source/style/StylePropertiesContext.hxx              |   31 +++++++
 xmloff/source/style/prhdlfac.cxx                            |    5 -
 xmloff/source/style/prstylei.cxx                            |   11 +-
 xmloff/source/token/tokens.txt                              |    4 
 12 files changed, 197 insertions(+), 33 deletions(-)

New commits:
commit 5e34a25aa7f58b37a2303aef9318bbe5a9af5d37
Author:     Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk>
AuthorDate: Fri Jul 28 12:10:24 2023 +0200
Commit:     Tomaž Vajngerl <qui...@gmail.com>
CommitDate: Tue Aug 1 08:15:24 2023 +0200

    sc: Add import/export ODF support for border complex colors
    
    ODF Import and export support for border {left,right,top,bottom}
    complex colors. In addition round-trip test was extended with the
    border use case.
    
    Change-Id: I1d14690272c06e8ffcfcd483eb7f688ca5bb1e5d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155014
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <qui...@gmail.com>

diff --git a/include/xmloff/xmltoken.hxx b/include/xmloff/xmltoken.hxx
index 3cc97405e511..5c929137cad6 100644
--- a/include/xmloff/xmltoken.hxx
+++ b/include/xmloff/xmltoken.hxx
@@ -354,15 +354,19 @@ namespace xmloff::token {
         XML_BOOLEAN_VALUE,
         XML_BORDER,
         XML_BORDER_BOTTOM,
+        XML_BORDER_BOTTOM_COMPLEX_COLOR,
         XML_BORDER_COLOR,
         XML_BORDER_LEFT,
+        XML_BORDER_LEFT_COMPLEX_COLOR,
         XML_BORDER_LINE_WIDTH,
         XML_BORDER_LINE_WIDTH_BOTTOM,
         XML_BORDER_LINE_WIDTH_LEFT,
         XML_BORDER_LINE_WIDTH_RIGHT,
         XML_BORDER_LINE_WIDTH_TOP,
         XML_BORDER_RIGHT,
+        XML_BORDER_RIGHT_COMPLEX_COLOR,
         XML_BORDER_TOP,
+        XML_BORDER_TOP_COMPLEX_COLOR,
         XML_BOTH,
         XML_BOTTOM,
         XML_BOTTOM_LEFT,
diff --git a/sc/qa/unit/ThemeImportExportTest.cxx 
b/sc/qa/unit/ThemeImportExportTest.cxx
index 09e4288b8a4f..a0fb408fd4e9 100644
--- a/sc/qa/unit/ThemeImportExportTest.cxx
+++ b/sc/qa/unit/ThemeImportExportTest.cxx
@@ -342,6 +342,16 @@ CPPUNIT_TEST_FIXTURE(ThemeImportExportTest, 
testCellBorderThemeColor)
     checkCellBorderThemeColor(getScDoc());
 }
 
+CPPUNIT_TEST_FIXTURE(ThemeImportExportTest, testCellBorderThemeColorODF)
+{
+    // Open the OOXML source
+    loadFromURL(u"xlsx/Test_ThemeColor_Text_Background_Border.xlsx");
+    // Save as ODF and load again - checks import / export cycle
+    saveAndReload("calc8");
+    // Check the values and show that the document is unchanged and all the 
data preserved
+    checkCellBorderThemeColor(getScDoc());
+}
+
 } // end anonymous namespace
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sc/source/filter/xml/xmlstyle.cxx 
b/sc/source/filter/xml/xmlstyle.cxx
index 9e5fb1598308..ddcdd5440082 100644
--- a/sc/source/filter/xml/xmlstyle.cxx
+++ b/sc/source/filter/xml/xmlstyle.cxx
@@ -67,6 +67,7 @@ const XMLPropertyMapEntry aXMLScCellStylesProperties[] =
     MAP( SC_UNONAME_ASIANVERT, XML_NAMESPACE_STYLE, 
XML_GLYPH_ORIENTATION_VERTICAL, XML_TYPE_PROP_TABLE_CELL|XML_SC_TYPE_VERTICAL, 
0),
     MAP( SC_UNONAME_BOTTBORDER, XML_NAMESPACE_FO, XML_BORDER_BOTTOM, 
XML_TYPE_PROP_TABLE_CELL|XML_TYPE_BORDER, CTF_SC_BOTTOMBORDER ),
     MAP( SC_UNONAME_BOTTBORDER, XML_NAMESPACE_STYLE, 
XML_BORDER_LINE_WIDTH_BOTTOM, XML_TYPE_PROP_TABLE_CELL|XML_TYPE_BORDER_WIDTH, 
CTF_SC_BOTTOMBORDERWIDTH ),
+    MAP_EXT(SC_UNONAME_BOTTOM_BORDER_COMPLEX_COLOR, XML_NAMESPACE_LO_EXT, 
XML_BORDER_BOTTOM_COMPLEX_COLOR, XML_TYPE_PROP_TABLE_CELL | 
XML_TYPE_COMPLEX_COLOR | MID_FLAG_ELEMENT_ITEM, CTF_COMPLEX_COLOR),
     MAP( SC_UNONAME_CELLBACK, XML_NAMESPACE_FO, XML_BACKGROUND_COLOR, 
XML_TYPE_PROP_TABLE_CELL|XML_TYPE_COLORTRANSPARENT|MID_FLAG_MULTI_PROPERTY|MID_FLAG_MERGE_ATTRIBUTE,
 0 ),
     MAP_EXT( SC_UNONAME_CELL_BACKGROUND_COMPLEX_COLOR, XML_NAMESPACE_LO_EXT, 
XML_BACKGROUND_COMPLEX_COLOR, 
XML_TYPE_PROP_TABLE_CELL|XML_TYPE_COMPLEX_COLOR|MID_FLAG_ELEMENT_ITEM, 
CTF_COMPLEX_COLOR),
     MAP( SC_UNONAME_CELLPRO, XML_NAMESPACE_STYLE, XML_CELL_PROTECT, 
XML_TYPE_PROP_TABLE_CELL|XML_SC_TYPE_CELLPROTECTION|MID_FLAG_MERGE_PROPERTY, 0 
),
@@ -91,6 +92,7 @@ const XMLPropertyMapEntry aXMLScCellStylesProperties[] =
     MAP( SC_UNONAME_WRAP, XML_NAMESPACE_FO, XML_WRAP_OPTION, 
XML_TYPE_PROP_TABLE_CELL|XML_SC_ISTEXTWRAPPED, 0 ),
     MAP( SC_UNONAME_LEFTBORDER, XML_NAMESPACE_FO, XML_BORDER, 
XML_TYPE_PROP_TABLE_CELL|XML_TYPE_BORDER, CTF_SC_ALLBORDER ),
     MAP( SC_UNONAME_LEFTBORDER, XML_NAMESPACE_FO, XML_BORDER_LEFT, 
XML_TYPE_PROP_TABLE_CELL|XML_TYPE_BORDER, CTF_SC_LEFTBORDER ),
+    MAP_EXT(SC_UNONAME_LEFT_BORDER_COMPLEX_COLOR, XML_NAMESPACE_LO_EXT, 
XML_BORDER_LEFT_COMPLEX_COLOR, XML_TYPE_PROP_TABLE_CELL | 
XML_TYPE_COMPLEX_COLOR | MID_FLAG_ELEMENT_ITEM, CTF_COMPLEX_COLOR),
     MAP( SC_UNONAME_LEFTBORDER, XML_NAMESPACE_STYLE, XML_BORDER_LINE_WIDTH, 
XML_TYPE_PROP_TABLE_CELL|XML_TYPE_BORDER_WIDTH, CTF_SC_ALLBORDERWIDTH ),
     MAP( SC_UNONAME_LEFTBORDER, XML_NAMESPACE_STYLE, 
XML_BORDER_LINE_WIDTH_LEFT, XML_TYPE_PROP_TABLE_CELL|XML_TYPE_BORDER_WIDTH, 
CTF_SC_LEFTBORDERWIDTH ),
     MAP( SC_UNONAME_NUMFMT, XML_NAMESPACE_STYLE, XML_DATA_STYLE_NAME, 
XML_TYPE_PROP_TABLE_CELL|XML_TYPE_NUMBER|MID_FLAG_SPECIAL_ITEM, 
CTF_SC_NUMBERFORMAT),
@@ -103,6 +105,7 @@ const XMLPropertyMapEntry aXMLScCellStylesProperties[] =
     MAP( SC_UNONAME_PTMARGIN, XML_NAMESPACE_FO, XML_PADDING_TOP, 
XML_TYPE_PROP_TABLE_CELL|XML_TYPE_MEASURE, CTF_SC_TOPPADDING ),
     MAP( SC_UNONAME_RIGHTBORDER, XML_NAMESPACE_FO, XML_BORDER_RIGHT, 
XML_TYPE_PROP_TABLE_CELL|XML_TYPE_BORDER, CTF_SC_RIGHTBORDER ),
     MAP( SC_UNONAME_RIGHTBORDER, XML_NAMESPACE_STYLE, 
XML_BORDER_LINE_WIDTH_RIGHT, XML_TYPE_PROP_TABLE_CELL|XML_TYPE_BORDER_WIDTH, 
CTF_SC_RIGHTBORDERWIDTH ),
+    MAP_EXT(SC_UNONAME_RIGHT_BORDER_COMPLEX_COLOR, XML_NAMESPACE_LO_EXT, 
XML_BORDER_RIGHT_COMPLEX_COLOR, XML_TYPE_PROP_TABLE_CELL | 
XML_TYPE_COMPLEX_COLOR | MID_FLAG_ELEMENT_ITEM, CTF_COMPLEX_COLOR),
     MAP( SC_UNONAME_ROTANG, XML_NAMESPACE_STYLE, XML_ROTATION_ANGLE, 
XML_TYPE_PROP_TABLE_CELL|XML_SC_TYPE_ROTATEANGLE, 0 ),
     MAP( SC_UNONAME_ROTREF, XML_NAMESPACE_STYLE, XML_ROTATION_ALIGN, 
XML_TYPE_PROP_TABLE_CELL|XML_SC_TYPE_ROTATEREFERENCE, 0),
     MAP( SC_UNONAME_SHADOW, XML_NAMESPACE_STYLE, XML_SHADOW, 
XML_TYPE_PROP_TABLE_CELL|XML_TYPE_TEXT_SHADOW, 0 ),
@@ -110,6 +113,7 @@ const XMLPropertyMapEntry aXMLScCellStylesProperties[] =
     MAP( SC_UNO_STANDARDDEC, XML_NAMESPACE_STYLE, XML_DECIMAL_PLACES, 
XML_TYPE_PROP_TABLE_CELL|XML_TYPE_NUMBER16, 0 ),
     MAP( SC_UNONAME_TOPBORDER, XML_NAMESPACE_FO, XML_BORDER_TOP, 
XML_TYPE_PROP_TABLE_CELL|XML_TYPE_BORDER, CTF_SC_TOPBORDER ),
     MAP( SC_UNONAME_TOPBORDER, XML_NAMESPACE_STYLE, XML_BORDER_LINE_WIDTH_TOP, 
XML_TYPE_PROP_TABLE_CELL|XML_TYPE_BORDER_WIDTH, CTF_SC_TOPBORDERWIDTH ),
+    MAP_EXT(SC_UNONAME_TOP_BORDER_COMPLEX_COLOR, XML_NAMESPACE_LO_EXT, 
XML_BORDER_TOP_COMPLEX_COLOR, XML_TYPE_PROP_TABLE_CELL | XML_TYPE_COMPLEX_COLOR 
| MID_FLAG_ELEMENT_ITEM, CTF_COMPLEX_COLOR),
     MAP( SC_UNONAME_USERDEF, XML_NAMESPACE_TEXT, XML_XMLNS, 
XML_TYPE_PROP_TABLE_CELL|XML_TYPE_ATTRIBUTE_CONTAINER | MID_FLAG_SPECIAL_ITEM, 
0 ),
     MAP( SC_UNONAME_VALIXML, XML_NAMESPACE_TABLE, XML_CONTENT_VALIDATION, 
XML_TYPE_PROP_TABLE_CELL|XML_TYPE_BUILDIN_CMP_ONLY, CTF_SC_VALIDATION ),
     MAP( SC_UNONAME_CELLVJUS, XML_NAMESPACE_STYLE, XML_VERTICAL_ALIGN, 
XML_TYPE_PROP_TABLE_CELL|XML_SC_TYPE_VERTJUSTIFY, 0),
diff --git a/sc/source/filter/xml/xmlstyli.cxx 
b/sc/source/filter/xml/xmlstyli.cxx
index 84812db9d6ac..b938e4e5d174 100644
--- a/sc/source/filter/xml/xmlstyli.cxx
+++ b/sc/source/filter/xml/xmlstyli.cxx
@@ -301,34 +301,37 @@ css::uno::Reference< css::xml::sax::XFastContextHandler > 
XMLTableCellPropsConte
     sal_Int32 nElement,
     const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList,
     ::std::vector< XMLPropertyState > &rProperties,
-    const XMLPropertyState& rProp )
+    const XMLPropertyState& rProperty)
 {
-    // no need for a custom context or indeed a SvXMLTokenMap to grab just the
-    // single attribute ( href ) that we are interested in.
-    // still though, we will check namespaces etc.
-    if (nElement == XML_ELEMENT(STYLE, XML_HYPERLINK) ||
-        nElement == XML_ELEMENT(LO_EXT, XML_HYPERLINK) )
+    switch 
(mxMapper->getPropertySetMapper()->GetEntryContextId(rProperty.mnIndex))
     {
-        OUString sURL;
-        for (auto &aIter : sax_fastparser::castToFastAttributeList( xAttrList 
))
+        case CTF_COMPLEX_COLOR:
         {
-            if ( aIter.getToken() == XML_ELEMENT(XLINK, XML_HREF) )
-                sURL = aIter.toString();
-            else
-                XMLOFF_WARN_UNKNOWN("sc", aIter);
+            return new XMLComplexColorContext(GetImport(), nElement, 
xAttrList, rProperty, rProperties);
         }
-        if ( !sURL.isEmpty() )
+        break;
+        case CTF_SC_HYPERLINK:
         {
-            XMLPropertyState aProp( rProp );
-            aProp.maValue <<=  sURL;
-            rProperties.push_back( aProp );
+            OUString sURL;
+            for (auto &aIter : sax_fastparser::castToFastAttributeList( 
xAttrList ))
+            {
+                if ( aIter.getToken() == XML_ELEMENT(XLINK, XML_HREF) )
+                    sURL = aIter.toString();
+                else
+                    XMLOFF_WARN_UNKNOWN("sc", aIter);
+            }
+            if ( !sURL.isEmpty() )
+            {
+                XMLPropertyState aProp(rProperty);
+                aProp.maValue <<=  sURL;
+                rProperties.push_back( aProp );
+            }
         }
+        break;
+        default:
+            break;
     }
-    else if (nElement == XML_ELEMENT(LO_EXT, XML_BACKGROUND_COMPLEX_COLOR))
-    {
-        return new XMLComplexColorContext(GetImport(), nElement, xAttrList, 
rProp, rProperties);
-    }
-    return SvXMLPropertySetContext::createFastChildContext( nElement, 
xAttrList, rProperties, rProp );
+    return SvXMLPropertySetContext::createFastChildContext(nElement, 
xAttrList, rProperties, rProperty);
 }
 
 namespace {
diff --git a/schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng 
b/schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng
index c7e70f111342..593df76f851e 100644
--- a/schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng
+++ b/schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng
@@ -3574,11 +3574,63 @@ 
xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.
     </rng:element>
   </rng:define>
 
+  <!-- TODO no proposal - Document Themes -->
+  <rng:define name="loext-border-bottom-complex-color">
+    <rng:element name="loext:border-bottom-complex-color">
+      <rng:ref name="loext-complex-color-attlist"/>
+      <rng:zeroOrMore>
+        <rng:ref name="loext-transformation"/>
+      </rng:zeroOrMore>
+    </rng:element>
+  </rng:define>
+
+  <!-- TODO no proposal - Document Themes -->
+  <rng:define name="loext-border-top-complex-color">
+    <rng:element name="loext:border-top-complex-color">
+      <rng:ref name="loext-complex-color-attlist"/>
+      <rng:zeroOrMore>
+        <rng:ref name="loext-transformation"/>
+      </rng:zeroOrMore>
+    </rng:element>
+  </rng:define>
+
+  <!-- TODO no proposal - Document Themes -->
+  <rng:define name="loext-border-left-complex-color">
+    <rng:element name="loext:border-left-complex-color">
+      <rng:ref name="loext-complex-color-attlist"/>
+      <rng:zeroOrMore>
+        <rng:ref name="loext-transformation"/>
+      </rng:zeroOrMore>
+    </rng:element>
+  </rng:define>
+
+  <!-- TODO no proposal - Document Themes -->
+  <rng:define name="loext-border-right-complex-color">
+    <rng:element name="loext:border-right-complex-color">
+      <rng:ref name="loext-complex-color-attlist"/>
+      <rng:zeroOrMore>
+        <rng:ref name="loext-transformation"/>
+      </rng:zeroOrMore>
+    </rng:element>
+  </rng:define>
+
   <!-- TODO no proposal - Document Themes-->
   <rng:define name="style-table-cell-properties-elements" combine="interleave">
     <rng:optional>
         <rng:ref name="loext-background-complex-color"/>
     </rng:optional>
+    <rng:optional>
+        <rng:ref name="loext-border-bottom-complex-color"/>
+    </rng:optional>
+    <rng:optional>
+        <rng:ref name="loext-border-top-complex-color"/>
+    </rng:optional>
+    <rng:optional>
+        <rng:ref name="loext-border-left-complex-color"/>
+    </rng:optional>
+    <rng:optional>
+        <rng:ref name="loext-border-right-complex-color"/>
+    </rng:optional>
   </rng:define>
 
   <rng:define name="draw-frame-attlist" combine="interleave">
diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx
index ecefb14f20f1..2ecc3ea5ce7b 100644
--- a/xmloff/source/core/xmltoken.cxx
+++ b/xmloff/source/core/xmltoken.cxx
@@ -366,15 +366,19 @@ namespace xmloff::token {
         TOKEN( "boolean-value",                   XML_BOOLEAN_VALUE ),
         TOKEN( "border",                          XML_BORDER ),
         TOKEN( "border-bottom",                   XML_BORDER_BOTTOM ),
+        TOKEN( "border-bottom-complex-color",     
XML_BORDER_BOTTOM_COMPLEX_COLOR ),
         TOKEN( "border-color",                    XML_BORDER_COLOR ),
         TOKEN( "border-left",                     XML_BORDER_LEFT ),
+        TOKEN( "border-left-complex-color",       
XML_BORDER_LEFT_COMPLEX_COLOR ),
         TOKEN( "border-line-width",               XML_BORDER_LINE_WIDTH ),
         TOKEN( "border-line-width-bottom",        XML_BORDER_LINE_WIDTH_BOTTOM 
),
         TOKEN( "border-line-width-left",          XML_BORDER_LINE_WIDTH_LEFT ),
         TOKEN( "border-line-width-right",         XML_BORDER_LINE_WIDTH_RIGHT 
),
         TOKEN( "border-line-width-top",           XML_BORDER_LINE_WIDTH_TOP ),
         TOKEN( "border-right",                    XML_BORDER_RIGHT ),
+        TOKEN( "border-right-complex-color",      
XML_BORDER_RIGHT_COMPLEX_COLOR ),
         TOKEN( "border-top",                      XML_BORDER_TOP ),
+        TOKEN( "border-top-complex-color",        XML_BORDER_TOP_COMPLEX_COLOR 
),
         TOKEN( "both",                            XML_BOTH ),
         TOKEN( "bottom",                          XML_BOTTOM ),
         TOKEN( "bottom-left",                     XML_BOTTOM_LEFT ),
diff --git a/xmloff/source/token/tokens.txt b/xmloff/source/token/tokens.txt
index 1ab7518cd0d2..3dd0ab102f4d 100644
--- a/xmloff/source/token/tokens.txt
+++ b/xmloff/source/token/tokens.txt
@@ -271,15 +271,19 @@ boolean-style
 boolean-value
 border
 border-bottom
+border-bottom-complex-color
 border-color
 border-left
+border-left-complex-color
 border-line-width
 border-line-width-bottom
 border-line-width-left
 border-line-width-right
 border-line-width-top
 border-right
+border-right-complex-color
 border-top
+border-top-complex-color
 both
 bottom
 bottom-left
commit b543463f639ecee793484e8b419147d565a53d52
Author:     Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk>
AuthorDate: Fri Jul 28 09:03:50 2023 +0200
Commit:     Tomaž Vajngerl <qui...@gmail.com>
CommitDate: Tue Aug 1 08:15:15 2023 +0200

    xmloff: fix import of CharComplexColor - add StylePropertiesContext
    
    Import of CharComplexColor in Calc didn't work because the class
    XMLComplexColorContext wasn't used.
    
    This introduces a new class StylePropertiesContext, because the
    plain SvXMLPropertySetContext is not enough as we can't define to
    use XMLComplexColorContext when XML_CHAR_COMPLEX_COLOR is used on
    that class.
    
    Also adds a import/export test for CharComplexColor.
    
    Change-Id: I765ac71a801a5e9bcb105aaea73637df5e601b85
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155008
    Tested-by: Tomaž Vajngerl <qui...@gmail.com>
    Reviewed-by: Tomaž Vajngerl <qui...@gmail.com>

diff --git a/sc/qa/unit/ThemeImportExportTest.cxx 
b/sc/qa/unit/ThemeImportExportTest.cxx
index 9164d41668f1..09e4288b8a4f 100644
--- a/sc/qa/unit/ThemeImportExportTest.cxx
+++ b/sc/qa/unit/ThemeImportExportTest.cxx
@@ -213,6 +213,16 @@ CPPUNIT_TEST_FIXTURE(ThemeImportExportTest, 
testCellTextThemeColor)
     checkCellTextThemeColor(getScDoc());
 }
 
+CPPUNIT_TEST_FIXTURE(ThemeImportExportTest, testCellTextThemeColorODF)
+{
+    // Open the OOXML source
+    loadFromURL(u"xlsx/Test_ThemeColor_Text_Background_Border.xlsx");
+    // Save as ODF and load again - checks import / export cycle
+    saveAndReload("calc8");
+    // Check the values and show that the document is unchanged and all the 
data preserved
+    checkCellTextThemeColor(getScDoc());
+}
+
 void checkCellBorderThemeColor(ScDocument* pDoc)
 {
     // C1
diff --git a/sc/source/filter/xml/xmlstyle.cxx 
b/sc/source/filter/xml/xmlstyle.cxx
index bb38d305b9a3..9e5fb1598308 100644
--- a/sc/source/filter/xml/xmlstyle.cxx
+++ b/sc/source/filter/xml/xmlstyle.cxx
@@ -908,11 +908,6 @@ const XMLPropertyHandler* 
XMLScPropHdlFactory::GetPropertyHandler( sal_Int32 nTy
                 pHdl = new XmlScPropHdl_Vertical;
             }
             break;
-            case XML_TYPE_COMPLEX_COLOR:
-            {
-                pHdl = new XMLComplexColorHandler;
-            }
-            break;
         }
 
         if(pHdl)
diff --git a/xmloff/Library_xo.mk b/xmloff/Library_xo.mk
index 8e7f3208bfe9..2bad53c2130a 100644
--- a/xmloff/Library_xo.mk
+++ b/xmloff/Library_xo.mk
@@ -234,6 +234,7 @@ $(eval $(call gb_Library_add_exception_objects,xo,\
     xmloff/source/style/PagePropertySetContext \
     xmloff/source/style/SinglePropertySetInfoCache \
     xmloff/source/style/StyleMap \
+    xmloff/source/style/StylePropertiesContext \
     xmloff/source/style/TransGradientStyle \
     xmloff/source/style/WordWrapPropertyHdl \
     xmloff/source/style/XMLBackgroundImageContext \
diff --git a/xmloff/source/style/StylePropertiesContext.cxx 
b/xmloff/source/style/StylePropertiesContext.cxx
new file mode 100644
index 000000000000..1bda191485e6
--- /dev/null
+++ b/xmloff/source/style/StylePropertiesContext.cxx
@@ -0,0 +1,44 @@
+/* -*- 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 "StylePropertiesContext.hxx"
+
+#include <tools/debug.hxx>
+#include <xmloff/xmlnamespace.hxx>
+#include <xmloff/xmltypes.hxx>
+#include <xmloff/xmlimp.hxx>
+
+#include <xmloff/XMLComplexColorContext.hxx>
+
+using namespace xmloff::token;
+
+StylePropertiesContext::StylePropertiesContext(
+    SvXMLImport& rImport, sal_Int32 nElement,
+    const css::uno::Reference<css::xml::sax::XFastAttributeList>& xAttrList, 
sal_uInt32 nFamily,
+    std::vector<XMLPropertyState>& rProps, const 
rtl::Reference<SvXMLImportPropertyMapper>& rMap)
+    : SvXMLPropertySetContext(rImport, nElement, xAttrList, nFamily, rProps, 
rMap)
+{
+}
+
+StylePropertiesContext::~StylePropertiesContext() {}
+
+css::uno::Reference<css::xml::sax::XFastContextHandler>
+StylePropertiesContext::createFastChildContext(
+    sal_Int32 nElement, const 
css::uno::Reference<css::xml::sax::XFastAttributeList>& xAttrList,
+    std::vector<XMLPropertyState>& rProperties, const XMLPropertyState& 
rProperty)
+{
+    if (nElement == XML_ELEMENT(LO_EXT, XML_CHAR_COMPLEX_COLOR))
+    {
+        return new XMLComplexColorContext(GetImport(), nElement, xAttrList, 
rProperty, rProperties);
+    }
+    return SvXMLPropertySetContext::createFastChildContext(nElement, 
xAttrList, rProperties,
+                                                           rProperty);
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmloff/source/style/StylePropertiesContext.hxx 
b/xmloff/source/style/StylePropertiesContext.hxx
new file mode 100644
index 000000000000..6fa3ef8703d9
--- /dev/null
+++ b/xmloff/source/style/StylePropertiesContext.hxx
@@ -0,0 +1,31 @@
+/* -*- 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 <xmloff/xmlprcon.hxx>
+
+class StylePropertiesContext : public SvXMLPropertySetContext
+{
+public:
+    StylePropertiesContext(SvXMLImport& rImport, sal_Int32 nElement,
+                           const 
css::uno::Reference<css::xml::sax::XFastAttributeList>& xAttrList,
+                           sal_uInt32 nFamily, std::vector<XMLPropertyState>& 
rProps,
+                           const rtl::Reference<SvXMLImportPropertyMapper>& 
rMap);
+
+    virtual ~StylePropertiesContext() override;
+
+    using SvXMLPropertySetContext::createFastChildContext;
+
+    virtual css::uno::Reference<css::xml::sax::XFastContextHandler> 
createFastChildContext(
+        sal_Int32 nElement, const 
css::uno::Reference<css::xml::sax::XFastAttributeList>& xAttrList,
+        std::vector<XMLPropertyState>& rProperties, const XMLPropertyState& 
rProperty) override;
+};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmloff/source/style/prhdlfac.cxx b/xmloff/source/style/prhdlfac.cxx
index 5ff7172834e4..a3ab3290bef2 100644
--- a/xmloff/source/style/prhdlfac.cxx
+++ b/xmloff/source/style/prhdlfac.cxx
@@ -56,6 +56,7 @@
 #include <XMLRectangleMembersHandler.hxx>
 #include <XMLNumberWithAutoForVoidPropHdl.hxx>
 #include "DrawAspectHdl.hxx"
+#include <xmloff/XMLComplexColorHandler.hxx>
 
 #include <map>
 
@@ -474,7 +475,9 @@ std::unique_ptr<XMLPropertyHandler> 
XMLPropertyHandlerFactory::CreatePropertyHan
             pPropHdl.reset(new XMLNamedBoolPropertyHdl(GetXMLToken(XML_CLIP),
                                                        
GetXMLToken(XML_AUTO_CREATE_NEW_FRAME)));
             break;
-
+        case XML_TYPE_COMPLEX_COLOR:
+            pPropHdl.reset(new XMLComplexColorHandler);
+            break;
     }
 
     return pPropHdl;
diff --git a/xmloff/source/style/prstylei.cxx b/xmloff/source/style/prstylei.cxx
index c688a3a24b31..ec5f2d7d8d85 100644
--- a/xmloff/source/style/prstylei.cxx
+++ b/xmloff/source/style/prstylei.cxx
@@ -43,6 +43,7 @@
 #include <xmloff/xmlprmap.hxx>
 #include <comphelper/sequence.hxx>
 #include <com/sun/star/drawing/FillStyle.hpp>
+#include "StylePropertiesContext.hxx"
 
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
@@ -208,12 +209,10 @@ css::uno::Reference< css::xml::sax::XFastContextHandler > 
XMLPropStyleContext::c
     {
         rtl::Reference < SvXMLImportPropertyMapper > xImpPrMap =
             mxStyles->GetImportPropertyMapper( GetFamily() );
-        if( xImpPrMap.is() )
-            return new SvXMLPropertySetContext( GetImport(), nElement,
-                                                    xAttrList,
-                                                    nFamily,
-                                                    maProperties,
-                                                    xImpPrMap );
+        if (xImpPrMap.is())
+        {
+            return new StylePropertiesContext(GetImport(), nElement, 
xAttrList, nFamily, maProperties, xImpPrMap);
+        }
     }
     XMLOFF_WARN_UNKNOWN_ELEMENT("xmloff", nElement);
     return nullptr;

Reply via email to