diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2023-07-30 08:52:44 +0200 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2023-08-02 21:22:43 +0200 |
commit | c8d8bf4282cbd04abacfa69ba2cc0fa4300e35e1 (patch) | |
tree | 270fcf114ac38a4d1b374b6837fa4cc6c9c5d649 /include/xmloff | |
parent | 2d96d69322ac18f53668b75397c8587f94cd043b (diff) |
sc: theme color support for sparklines + ODF & OOXML import/export
This changes Sparkline colors to use complex colors instead and
adds Sparkline theme color import and export support for ODF and
OOXML.
Change-Id: I58edd525d50f95199bd4fe7825afb51aaa7fc091
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155113
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'include/xmloff')
-rw-r--r-- | include/xmloff/XMLComplexColorContext.hxx | 45 | ||||
-rw-r--r-- | include/xmloff/XMLComplexColorExport.hxx | 11 | ||||
-rw-r--r-- | include/xmloff/xmltoken.hxx | 14 |
3 files changed, 62 insertions, 8 deletions
diff --git a/include/xmloff/XMLComplexColorContext.hxx b/include/xmloff/XMLComplexColorContext.hxx index cbb785994169..5654cc204206 100644 --- a/include/xmloff/XMLComplexColorContext.hxx +++ b/include/xmloff/XMLComplexColorContext.hxx @@ -10,25 +10,60 @@ #pragma once #include <xmloff/dllapi.h> + #include <memory> #include <xmloff/XMLElementPropertyContext.hxx> -#include <docmodel/uno/UnoComplexColor.hxx> +#include <xmloff/xmlictxt.hxx> +#include <docmodel/color/ComplexColor.hxx> -class XMLOFF_DLLPUBLIC XMLComplexColorContext final : public XMLElementPropertyContext +class XMLOFF_DLLPUBLIC XMLComplexColorImport { +private: + model::ComplexColor& mrComplexColor; + +public: + XMLComplexColorImport(model::ComplexColor& rComplexColor); + void fillAttributes(const css::uno::Reference<css::xml::sax::XFastAttributeList>& xAttrList); + bool + handleTransformContext(sal_Int32 nElement, + const css::uno::Reference<css::xml::sax::XFastAttributeList>& xAttrList); +}; + +class XMLOFF_DLLPUBLIC XMLPropertyComplexColorContext final : public XMLElementPropertyContext +{ +private: model::ComplexColor maComplexColor; sal_Int32 mnRootElement; + XMLComplexColorImport maComplexColorImport; + public: - XMLComplexColorContext(SvXMLImport& rImport, sal_Int32 nElement, - const css::uno::Reference<css::xml::sax::XFastAttributeList>& xAttrList, - const XMLPropertyState& rProp, std::vector<XMLPropertyState>& rProps); + XMLPropertyComplexColorContext( + SvXMLImport& rImport, sal_Int32 nElement, + const css::uno::Reference<css::xml::sax::XFastAttributeList>& xAttrList, + const XMLPropertyState& rProp, std::vector<XMLPropertyState>& rProps); css::uno::Reference<css::xml::sax::XFastContextHandler> SAL_CALL createFastChildContext( sal_Int32 nElement, const css::uno::Reference<css::xml::sax::XFastAttributeList>& AttrList) override; void SAL_CALL endFastElement(sal_Int32 nElement) override; + + model::ComplexColor getComplexColor() { return maComplexColor; } +}; + +class XMLOFF_DLLPUBLIC XMLComplexColorContext final : public SvXMLImportContext +{ +private: + XMLComplexColorImport maComplexColorImport; + +public: + XMLComplexColorContext(SvXMLImport& rImport, model::ComplexColor& rComplexColor, + const css::uno::Reference<css::xml::sax::XFastAttributeList>& xAttrList); + + css::uno::Reference<css::xml::sax::XFastContextHandler> SAL_CALL createFastChildContext( + sal_Int32 nElement, + const css::uno::Reference<css::xml::sax::XFastAttributeList>& AttrList) override; }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/xmloff/XMLComplexColorExport.hxx b/include/xmloff/XMLComplexColorExport.hxx index 28911737ff89..51425f52ab55 100644 --- a/include/xmloff/XMLComplexColorExport.hxx +++ b/include/xmloff/XMLComplexColorExport.hxx @@ -11,20 +11,31 @@ #include <xmloff/dllapi.h> #include <sal/types.h> #include <rtl/ustring.hxx> +#include <xmloff/xmltoken.hxx> namespace com::sun::star::uno { class Any; } +namespace model +{ +class ComplexColor; +} + class SvXMLExport; class XMLOFF_DLLPUBLIC XMLComplexColorExport { SvXMLExport& mrExport; + void doExport(model::ComplexColor const& rComplexColor, sal_uInt16 nPrefix, + const OUString& rLocalName); + public: XMLComplexColorExport(SvXMLExport& rExport); + void exportComplexColor(model::ComplexColor const& rComplexColor, sal_uInt16 nPrefix, + xmloff::token::XMLTokenEnum nToken); void exportXML(const css::uno::Any& rAny, sal_uInt16 nPrefix, const OUString& rLocalName); }; diff --git a/include/xmloff/xmltoken.hxx b/include/xmloff/xmltoken.hxx index 5c929137cad6..1806178b12d6 100644 --- a/include/xmloff/xmltoken.hxx +++ b/include/xmloff/xmltoken.hxx @@ -1800,10 +1800,18 @@ namespace xmloff::token { XML_SOURCE_RANGE_ADDRESS, XML_SOURCE_SERVICE, XML_SPACE_BEFORE, - XML_SPARKLINE_GROUPS, - XML_SPARKLINE_GROUP, - XML_SPARKLINES, XML_SPARKLINE, + XML_SPARKLINES, + XML_SPARKLINE_AXIS_COMPLEX_COLOR, + XML_SPARKLINE_FIRST_COMPLEX_COLOR, + XML_SPARKLINE_GROUP, + XML_SPARKLINE_GROUPS, + XML_SPARKLINE_HIGH_COMPLEX_COLOR, + XML_SPARKLINE_LAST_COMPLEX_COLOR, + XML_SPARKLINE_LOW_COMPLEX_COLOR, + XML_SPARKLINE_MARKERS_COMPLEX_COLOR, + XML_SPARKLINE_NEGATIVE_COMPLEX_COLOR, + XML_SPARKLINE_SERIES_COMPLEX_COLOR, XML_SPAN, XML_SPECULAR, XML_SPECULAR_COLOR, |