sc/inc/unonames.hxx                |    2 ++
 sc/qa/extras/scstyleobj.cxx        |   35 ++++++++++++++++++++++++++---------
 sc/source/ui/unoobj/cellsuno.cxx   |   13 +++++++++++++
 sc/source/ui/unoobj/styleuno.cxx   |    2 ++
 test/Library_subsequenttest.mk     |    1 +
 test/source/beans/xpropertyset.cxx |    9 +++++++++
 6 files changed, 53 insertions(+), 9 deletions(-)

New commits:
commit 56e58e6a1280d9bdd23550ba998f14aef4980244
Author:     Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk>
AuthorDate: Thu May 11 19:40:06 2023 +0900
Commit:     Tomaž Vajngerl <qui...@gmail.com>
CommitDate: Wed Jun 21 10:58:13 2023 +0200

    sc: add CharComplexColor and CellBackgroundComplexColor properties
    
    Change-Id: I30153796a39b2aa3648cb107905974ed6f0f3851
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151668
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <qui...@gmail.com>

diff --git a/sc/inc/unonames.hxx b/sc/inc/unonames.hxx
index 4617bcf46700..7a7396a358e4 100644
--- a/sc/inc/unonames.hxx
+++ b/sc/inc/unonames.hxx
@@ -50,6 +50,7 @@ inline constexpr OUStringLiteral SC_UNO_HASDRAWPAGES         
= u"HasDrawPages";
 
 //  CharacterProperties
 inline constexpr OUStringLiteral SC_UNONAME_CCOLOR           = u"CharColor";
+inline constexpr OUStringLiteral SC_UNONAME_CHAR_COMPLEX_COLOR = 
u"CharComplexColor";
 inline constexpr OUStringLiteral SC_UNONAME_CHEIGHT          = u"CharHeight";
 inline constexpr OUStringLiteral SC_UNONAME_CUNDER           = 
u"CharUnderline";
 inline constexpr OUStringLiteral SC_UNONAME_CUNDLCOL         = 
u"CharUnderlineColor";
@@ -97,6 +98,7 @@ inline constexpr OUStringLiteral SC_UNO_CTL_CLOCAL           
= u"CharLocaleCompl
 //  CellProperties
 inline constexpr OUStringLiteral SC_UNONAME_CELLSTYL         = u"CellStyle";
 inline constexpr OUStringLiteral SC_UNONAME_CELLBACK         = 
u"CellBackColor";
+inline constexpr OUStringLiteral SC_UNONAME_CELL_BACKGROUND_COMPLEX_COLOR = 
u"CellBackgroundComplexColor";
 inline constexpr OUStringLiteral SC_UNONAME_CELLTRAN         = 
u"IsCellBackgroundTransparent";
 inline constexpr OUStringLiteral SC_UNONAME_CELLPRO          = 
u"CellProtection";
 inline constexpr OUStringLiteral SC_UNONAME_CELLHJUS         = u"HoriJustify";
diff --git a/sc/qa/extras/scstyleobj.cxx b/sc/qa/extras/scstyleobj.cxx
index 7b8ca77c03ab..813a59db944b 100644
--- a/sc/qa/extras/scstyleobj.cxx
+++ b/sc/qa/extras/scstyleobj.cxx
@@ -59,15 +59,32 @@ public:
 ScStyleObj::ScStyleObj()
     : UnoApiTest("/sc/qa/extras/testdocuments")
     , XNamed("ScStyleObj")
-    , XPropertySet({
-          "BottomBorder",          "BottomBorder2",     "CellProtection", 
"CharLocale",
-          "CharLocaleAsian",       "CharLocaleComplex", "CharPosture",    
"CharPostureAsian",
-          "CharPostureComplex",    "DiagonalBLTR",      "DiagonalBLTR2",  
"DiagonalTLBR",
-          "DiagonalTLBR2",         "HoriJustify",       "LeftBorder",     
"LeftBorder2",
-          "NumberFormat",          "Orientation",       "RightBorder",    
"RightBorder2",
-          "ShadowFormat",          "TableBorder",       "TopBorder",      
"TopBorder2",
-          "UserDefinedAttributes",
-      })
+    , XPropertySet({ "BottomBorder",
+                     "BottomBorder2",
+                     "CellProtection",
+                     "CharLocale",
+                     "CharLocaleAsian",
+                     "CharLocaleComplex",
+                     "CharPosture",
+                     "CharPostureAsian",
+                     "CharPostureComplex",
+                     "DiagonalBLTR",
+                     "DiagonalBLTR2",
+                     "DiagonalTLBR",
+                     "DiagonalTLBR2",
+                     "HoriJustify",
+                     "LeftBorder",
+                     "LeftBorder2",
+                     "NumberFormat",
+                     "Orientation",
+                     "RightBorder",
+                     "RightBorder2",
+                     "ShadowFormat",
+                     "TableBorder",
+                     "TopBorder",
+                     "TopBorder2",
+                     "UserDefinedAttributes",
+                     "CellBackgroundComplexColor" })
 {
 }
 
diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx
index 55f72d3dce09..371ea346d364 100644
--- a/sc/source/ui/unoobj/cellsuno.cxx
+++ b/sc/source/ui/unoobj/cellsuno.cxx
@@ -65,6 +65,7 @@
 #include <com/sun/star/text/WritingMode2.hpp>
 #include <com/sun/star/text/textfield/Type.hpp>
 #include <com/sun/star/sheet/XConditionalFormats.hpp>
+#include <com/sun/star/util/XComplexColor.hpp>
 
 #include <autoform.hxx>
 #include <cellvalue.hxx>
@@ -156,9 +157,11 @@ static const SfxItemPropertySet* lcl_GetCellsPropertySet()
         { SC_UNONAME_BOTTBORDER,ATTR_BORDER,       
::cppu::UnoType<table::BorderLine>::get(), 0, BOTTOM_BORDER | CONVERT_TWIPS },
         { SC_UNONAME_BOTTBORDER2,ATTR_BORDER,      
::cppu::UnoType<table::BorderLine2>::get(), 0, BOTTOM_BORDER | CONVERT_TWIPS },
         { SC_UNONAME_CELLBACK, ATTR_BACKGROUND,    
cppu::UnoType<sal_Int32>::get(),            0, MID_BACK_COLOR },
+        { SC_UNONAME_CELL_BACKGROUND_COMPLEX_COLOR, ATTR_BACKGROUND, 
cppu::UnoType<css::util::XComplexColor>::get(), 0, MID_BACKGROUND_COMPLEX_COLOR 
},
         { SC_UNONAME_CELLPRO,  ATTR_PROTECTION,    
cppu::UnoType<util::CellProtection>::get(), 0, 0 },
         { SC_UNONAME_CELLSTYL, 
SC_WID_UNO_CELLSTYL,cppu::UnoType<OUString>::get(),        0, 0 },
         { SC_UNONAME_CCOLOR,   ATTR_FONT_COLOR,    
cppu::UnoType<sal_Int32>::get(),            0, 0 },
+        { SC_UNONAME_CHAR_COMPLEX_COLOR,   ATTR_FONT_COLOR, 
cppu::UnoType<css::util::XComplexColor>::get(), 0, MID_BACKGROUND_COMPLEX_COLOR 
},
         { SC_UNONAME_COUTL,    ATTR_FONT_CONTOUR,  cppu::UnoType<bool>::get(), 
                 0, 0 },
         { SC_UNONAME_CCROSS,   
ATTR_FONT_CROSSEDOUT,cppu::UnoType<bool>::get(),                 0, 
MID_CROSSED_OUT },
         { SC_UNONAME_CEMPHAS,  
ATTR_FONT_EMPHASISMARK,cppu::UnoType<sal_Int16>::get(),         0, MID_EMPHASIS 
},
@@ -265,9 +268,11 @@ static const SfxItemPropertySet* lcl_GetRangePropertySet()
         { SC_UNONAME_BOTTBORDER,ATTR_BORDER,       
::cppu::UnoType<table::BorderLine>::get(), 0, BOTTOM_BORDER | CONVERT_TWIPS },
         { SC_UNONAME_BOTTBORDER2,ATTR_BORDER,      
::cppu::UnoType<table::BorderLine2>::get(), 0, BOTTOM_BORDER | CONVERT_TWIPS },
         { SC_UNONAME_CELLBACK, ATTR_BACKGROUND,    
cppu::UnoType<sal_Int32>::get(),            0, MID_BACK_COLOR },
+        { SC_UNONAME_CELL_BACKGROUND_COMPLEX_COLOR, ATTR_BACKGROUND, 
cppu::UnoType<css::util::XComplexColor>::get(), 0, MID_BACKGROUND_COMPLEX_COLOR 
},
         { SC_UNONAME_CELLPRO,  ATTR_PROTECTION,    
cppu::UnoType<util::CellProtection>::get(), 0, 0 },
         { SC_UNONAME_CELLSTYL, 
SC_WID_UNO_CELLSTYL,cppu::UnoType<OUString>::get(),        0, 0 },
         { SC_UNONAME_CCOLOR,   ATTR_FONT_COLOR,    
cppu::UnoType<sal_Int32>::get(),            0, 0 },
+        { SC_UNONAME_CHAR_COMPLEX_COLOR,   ATTR_FONT_COLOR, 
cppu::UnoType<css::util::XComplexColor>::get(), 0, MID_BACKGROUND_COMPLEX_COLOR 
},
         { SC_UNONAME_COUTL,    ATTR_FONT_CONTOUR,  cppu::UnoType<bool>::get(), 
                 0, 0 },
         { SC_UNONAME_CCROSS,   
ATTR_FONT_CROSSEDOUT,cppu::UnoType<bool>::get(),                 0, 
MID_CROSSED_OUT },
         { SC_UNONAME_CEMPHAS,  
ATTR_FONT_EMPHASISMARK,cppu::UnoType<sal_Int16>::get(),         0, MID_EMPHASIS 
},
@@ -375,9 +380,11 @@ static const SfxItemPropertySet* lcl_GetCellPropertySet()
         { SC_UNONAME_BOTTBORDER,ATTR_BORDER,       
::cppu::UnoType<table::BorderLine>::get(), 0, BOTTOM_BORDER | CONVERT_TWIPS },
         { SC_UNONAME_BOTTBORDER2,ATTR_BORDER,      
::cppu::UnoType<table::BorderLine2>::get(), 0, BOTTOM_BORDER | CONVERT_TWIPS },
         { SC_UNONAME_CELLBACK, ATTR_BACKGROUND,    
cppu::UnoType<sal_Int32>::get(),            0, MID_BACK_COLOR },
+        { SC_UNONAME_CELL_BACKGROUND_COMPLEX_COLOR, ATTR_BACKGROUND, 
cppu::UnoType<css::util::XComplexColor>::get(), 0, MID_BACKGROUND_COMPLEX_COLOR 
},
         { SC_UNONAME_CELLPRO,  ATTR_PROTECTION,    
cppu::UnoType<util::CellProtection>::get(), 0, 0 },
         { SC_UNONAME_CELLSTYL, 
SC_WID_UNO_CELLSTYL,cppu::UnoType<OUString>::get(),        0, 0 },
         { SC_UNONAME_CCOLOR,   ATTR_FONT_COLOR,    
cppu::UnoType<sal_Int32>::get(),            0, 0 },
+        { SC_UNONAME_CHAR_COMPLEX_COLOR,   ATTR_FONT_COLOR, 
cppu::UnoType<css::util::XComplexColor>::get(), 0, MID_BACKGROUND_COMPLEX_COLOR 
},
         { SC_UNONAME_COUTL,    ATTR_FONT_CONTOUR,  cppu::UnoType<bool>::get(), 
                 0, 0 },
         { SC_UNONAME_CCROSS,   
ATTR_FONT_CROSSEDOUT,cppu::UnoType<bool>::get(),                 0, 
MID_CROSSED_OUT },
         { SC_UNONAME_CEMPHAS,  
ATTR_FONT_EMPHASISMARK,cppu::UnoType<sal_Int16>::get(),         0, MID_EMPHASIS 
},
@@ -491,9 +498,11 @@ static const SfxItemPropertySet* lcl_GetColumnPropertySet()
         { SC_UNONAME_BOTTBORDER,ATTR_BORDER,       
::cppu::UnoType<table::BorderLine>::get(), 0, BOTTOM_BORDER | CONVERT_TWIPS },
         { SC_UNONAME_BOTTBORDER2,ATTR_BORDER,      
::cppu::UnoType<table::BorderLine2>::get(), 0, BOTTOM_BORDER | CONVERT_TWIPS },
         { SC_UNONAME_CELLBACK, ATTR_BACKGROUND,    
cppu::UnoType<sal_Int32>::get(),            0, MID_BACK_COLOR },
+        { SC_UNONAME_CELL_BACKGROUND_COMPLEX_COLOR, ATTR_BACKGROUND, 
cppu::UnoType<css::util::XComplexColor>::get(), 0, MID_BACKGROUND_COMPLEX_COLOR 
},
         { SC_UNONAME_CELLPRO,  ATTR_PROTECTION,    
cppu::UnoType<util::CellProtection>::get(), 0, 0 },
         { SC_UNONAME_CELLSTYL, 
SC_WID_UNO_CELLSTYL,cppu::UnoType<OUString>::get(),        0, 0 },
         { SC_UNONAME_CCOLOR,   ATTR_FONT_COLOR,    
cppu::UnoType<sal_Int32>::get(),            0, 0 },
+        { SC_UNONAME_CHAR_COMPLEX_COLOR,   ATTR_FONT_COLOR, 
cppu::UnoType<css::util::XComplexColor>::get(), 0, MID_BACKGROUND_COMPLEX_COLOR 
},
         { SC_UNONAME_COUTL,    ATTR_FONT_CONTOUR,  cppu::UnoType<bool>::get(), 
                 0, 0 },
         { SC_UNONAME_CCROSS,   
ATTR_FONT_CROSSEDOUT,cppu::UnoType<bool>::get(),                 0, 
MID_CROSSED_OUT },
         { SC_UNONAME_CEMPHAS,  
ATTR_FONT_EMPHASISMARK,cppu::UnoType<sal_Int16>::get(),         0, MID_EMPHASIS 
},
@@ -602,9 +611,11 @@ static const SfxItemPropertySet* lcl_GetRowPropertySet()
         { SC_UNONAME_BOTTBORDER,ATTR_BORDER,       
::cppu::UnoType<table::BorderLine>::get(), 0, BOTTOM_BORDER | CONVERT_TWIPS },
         { SC_UNONAME_BOTTBORDER2,ATTR_BORDER,      
::cppu::UnoType<table::BorderLine2>::get(), 0, BOTTOM_BORDER | CONVERT_TWIPS },
         { SC_UNONAME_CELLBACK, ATTR_BACKGROUND,    
cppu::UnoType<sal_Int32>::get(),            0, MID_BACK_COLOR },
+        { SC_UNONAME_CELL_BACKGROUND_COMPLEX_COLOR, ATTR_BACKGROUND, 
cppu::UnoType<css::util::XComplexColor>::get(), 0, MID_BACKGROUND_COMPLEX_COLOR 
},
         { SC_UNONAME_CELLPRO,  ATTR_PROTECTION,    
cppu::UnoType<util::CellProtection>::get(), 0, 0 },
         { SC_UNONAME_CELLSTYL, 
SC_WID_UNO_CELLSTYL,cppu::UnoType<OUString>::get(),        0, 0 },
         { SC_UNONAME_CCOLOR,   ATTR_FONT_COLOR,    
cppu::UnoType<sal_Int32>::get(),            0, 0 },
+        { SC_UNONAME_CHAR_COMPLEX_COLOR,   ATTR_FONT_COLOR, 
cppu::UnoType<css::util::XComplexColor>::get(), 0, MID_BACKGROUND_COMPLEX_COLOR 
},
         { SC_UNONAME_COUTL,    ATTR_FONT_CONTOUR,  cppu::UnoType<bool>::get(), 
                 0, 0 },
         { SC_UNONAME_CCROSS,   
ATTR_FONT_CROSSEDOUT,cppu::UnoType<bool>::get(),                 0, 
MID_CROSSED_OUT },
         { SC_UNONAME_CEMPHAS,  
ATTR_FONT_EMPHASISMARK,cppu::UnoType<sal_Int16>::get(),         0, MID_EMPHASIS 
},
@@ -716,9 +727,11 @@ static const SfxItemPropertySet* lcl_GetSheetPropertySet()
         { SC_UNONAME_BOTTBORDER,ATTR_BORDER,       
::cppu::UnoType<table::BorderLine>::get(), 0, BOTTOM_BORDER | CONVERT_TWIPS },
         { SC_UNONAME_BOTTBORDER2,ATTR_BORDER,      
::cppu::UnoType<table::BorderLine2>::get(), 0, BOTTOM_BORDER | CONVERT_TWIPS },
         { SC_UNONAME_CELLBACK, ATTR_BACKGROUND,    
cppu::UnoType<sal_Int32>::get(),            0, MID_BACK_COLOR },
+        { SC_UNONAME_CELL_BACKGROUND_COMPLEX_COLOR, ATTR_BACKGROUND, 
cppu::UnoType<css::util::XComplexColor>::get(), 0, MID_BACKGROUND_COMPLEX_COLOR 
},
         { SC_UNONAME_CELLPRO,  ATTR_PROTECTION,    
cppu::UnoType<util::CellProtection>::get(), 0, 0 },
         { SC_UNONAME_CELLSTYL, 
SC_WID_UNO_CELLSTYL,cppu::UnoType<OUString>::get(),        0, 0 },
         { SC_UNONAME_CCOLOR,   ATTR_FONT_COLOR,    
cppu::UnoType<sal_Int32>::get(),            0, 0 },
+        { SC_UNONAME_CHAR_COMPLEX_COLOR,   ATTR_FONT_COLOR, 
cppu::UnoType<css::util::XComplexColor>::get(), 0, MID_BACKGROUND_COMPLEX_COLOR 
},
         { SC_UNONAME_COUTL,    ATTR_FONT_CONTOUR,  cppu::UnoType<bool>::get(), 
                 0, 0 },
         { SC_UNONAME_CCROSS,   
ATTR_FONT_CROSSEDOUT,cppu::UnoType<bool>::get(),                 0, 
MID_CROSSED_OUT },
         { SC_UNONAME_CEMPHAS,  
ATTR_FONT_EMPHASISMARK,cppu::UnoType<sal_Int16>::get(),         0, MID_EMPHASIS 
},
diff --git a/sc/source/ui/unoobj/styleuno.cxx b/sc/source/ui/unoobj/styleuno.cxx
index 681a97f09e3c..3ef06022c743 100644
--- a/sc/source/ui/unoobj/styleuno.cxx
+++ b/sc/source/ui/unoobj/styleuno.cxx
@@ -110,8 +110,10 @@ static const SfxItemPropertySet* lcl_GetCellStyleSet()
         {SC_UNONAME_BOTTBORDER,ATTR_BORDER,       
::cppu::UnoType<table::BorderLine>::get(),        0, BOTTOM_BORDER | 
CONVERT_TWIPS },
         {SC_UNONAME_BOTTBORDER2,ATTR_BORDER,       
::cppu::UnoType<table::BorderLine2>::get(),        0, BOTTOM_BORDER | 
CONVERT_TWIPS },
         {SC_UNONAME_CELLBACK, ATTR_BACKGROUND,    
::cppu::UnoType<sal_Int32>::get(),            0, MID_BACK_COLOR },
+        {SC_UNONAME_CELL_BACKGROUND_COMPLEX_COLOR, ATTR_BACKGROUND, 
cppu::UnoType<css::util::XComplexColor>::get(), 0, MID_BACKGROUND_COMPLEX_COLOR 
},
         {SC_UNONAME_CELLPRO,  ATTR_PROTECTION,    
::cppu::UnoType<util::CellProtection>::get(), 0, 0 },
         {SC_UNONAME_CCOLOR,   ATTR_FONT_COLOR,    
::cppu::UnoType<sal_Int32>::get(),            0, 0 },
+        {SC_UNONAME_CHAR_COMPLEX_COLOR,   ATTR_FONT_COLOR, 
cppu::UnoType<css::util::XComplexColor>::get(), 0, MID_BACKGROUND_COMPLEX_COLOR 
},
         {SC_UNONAME_COUTL,    ATTR_FONT_CONTOUR,  cppu::UnoType<bool>::get(),  
          0, 0 },
         {SC_UNONAME_CCROSS,   ATTR_FONT_CROSSEDOUT,cppu::UnoType<bool>::get(), 
          0, MID_CROSSED_OUT },
         {SC_UNONAME_CEMPHAS,  
ATTR_FONT_EMPHASISMARK,cppu::UnoType<sal_Int16>::get(),         0, MID_EMPHASIS 
},
diff --git a/test/Library_subsequenttest.mk b/test/Library_subsequenttest.mk
index 7323f7312d93..91f4a1d8e86b 100644
--- a/test/Library_subsequenttest.mk
+++ b/test/Library_subsequenttest.mk
@@ -34,6 +34,7 @@ $(eval $(call gb_Library_use_libraries,subsequenttest,\
        utl \
        unotest \
        vcl \
+       docmodel \
 ))
 
 $(eval $(call gb_Library_use_externals,subsequenttest,\
diff --git a/test/source/beans/xpropertyset.cxx 
b/test/source/beans/xpropertyset.cxx
index 00c3378106d9..038b1e5733b6 100644
--- a/test/source/beans/xpropertyset.cxx
+++ b/test/source/beans/xpropertyset.cxx
@@ -17,12 +17,14 @@
 #include <com/sun/star/beans/XVetoableChangeListener.hpp>
 #include <com/sun/star/lang/EventObject.hpp>
 #include <com/sun/star/util/DateTime.hpp>
+#include <com/sun/star/util/XComplexColor.hpp>
 
 #include <com/sun/star/uno/Any.hxx>
 #include <com/sun/star/uno/Reference.hxx>
 #include <com/sun/star/uno/Type.h>
 
 #include <cppuhelper/implbase.hxx>
+#include <docmodel/uno/UnoComplexColor.hxx>
 #include <rtl/ref.hxx>
 
 #include <cppunit/TestAssert.h>
@@ -242,6 +244,13 @@ bool XPropertySet::isPropertyValueChangeable(const 
OUString& rName)
             aDT.Year += 1;
             xPropSet->setPropertyValue(rName, Any(aDT));
         }
+        else if (type == 
cppu::UnoType<uno::Reference<util::XComplexColor>>::get())
+        {
+            auto xComplexColor = 
any.get<uno::Reference<util::XComplexColor>>();
+            auto aComplexColor = 
model::color::getFromXComplexColor(xComplexColor);
+            xPropSet->setPropertyValue(rName,
+                                       
Any(model::color::createXComplexColor(aComplexColor)));
+        }
         else
         {
             std::cout << "Unknown type:\n"

Reply via email to