docmodel/source/uno/UnoComplexColor.cxx    |    8 +++++++-
 include/docmodel/uno/UnoComplexColor.hxx   |    1 +
 offapi/com/sun/star/util/XComplexColor.idl |    6 ++++++
 3 files changed, 14 insertions(+), 1 deletion(-)

New commits:
commit a967935a7606c6354bc53bfc91c15ae137e185c5
Author:     Tomaž Vajngerl <[email protected]>
AuthorDate: Sun Dec 14 12:00:27 2025 +0900
Commit:     Tomaž Vajngerl <[email protected]>
CommitDate: Tue Dec 16 07:00:08 2025 +0100

    add representation string to XComplexColor
    
    Mainly useful for debugging and to see the content with develop.
    tools. For now it just outputs the JSON string, but this might
    change to something more concise.
    
    Change-Id: I5641d20f292495f5474755ab9c3b651f67aa6f6e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195617
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <[email protected]>

diff --git a/docmodel/source/uno/UnoComplexColor.cxx 
b/docmodel/source/uno/UnoComplexColor.cxx
index f45988ec5c13..c5533009a7e0 100644
--- a/docmodel/source/uno/UnoComplexColor.cxx
+++ b/docmodel/source/uno/UnoComplexColor.cxx
@@ -9,6 +9,7 @@
  */
 
 #include <docmodel/uno/UnoComplexColor.hxx>
+#include <docmodel/color/ComplexColorJSON.hxx>
 
 using namespace css;
 
@@ -16,9 +17,14 @@ sal_Int32 UnoComplexColor::getType() { return 
sal_Int32(maColor.getType()); }
 
 sal_Int32 UnoComplexColor::getThemeColorType() { return 
sal_Int32(maColor.getThemeColorType()); }
 
+OUString UnoComplexColor::getRepresentation()
+{
+    return OStringToOUString(model::color::convertToJSON(maColor), 
RTL_TEXTENCODING_UTF8);
+}
+
 util::Color UnoComplexColor::resolveColor(uno::Reference<util::XTheme> const& 
/*xTheme*/)
 {
-    return util::Color(maColor.getRGBColor());
+    return util::Color(maColor.getFinalColor());
 }
 
 namespace model::color
diff --git a/include/docmodel/uno/UnoComplexColor.hxx 
b/include/docmodel/uno/UnoComplexColor.hxx
index 4c584b2ab7c4..500c1c125a3f 100644
--- a/include/docmodel/uno/UnoComplexColor.hxx
+++ b/include/docmodel/uno/UnoComplexColor.hxx
@@ -35,6 +35,7 @@ public:
     // XComplexColor
     sal_Int32 SAL_CALL getType() override;
     sal_Int32 SAL_CALL getThemeColorType() override;
+    OUString SAL_CALL getRepresentation() override;
     css::util::Color SAL_CALL
     resolveColor(css::uno::Reference<css::util::XTheme> const& xTheme) 
override;
 };
diff --git a/offapi/com/sun/star/util/XComplexColor.idl 
b/offapi/com/sun/star/util/XComplexColor.idl
index c2f10e92b124..83c5b5b1f081 100644
--- a/offapi/com/sun/star/util/XComplexColor.idl
+++ b/offapi/com/sun/star/util/XComplexColor.idl
@@ -25,6 +25,12 @@ interface XComplexColor
 
     /** resolve the color */
     Color resolveColor([in] com::sun::star::util::XTheme xTheme);
+
+    /** String representation of the complex color.
+
+        @since LibreOffice 26.2
+    */
+    string getRepresentation();
 };
 
 }; }; }; };

Reply via email to