diff options
-rw-r--r-- | src/lib/VSDXTheme.cpp | 22 | ||||
-rw-r--r-- | src/lib/VSDXTheme.h | 3 |
2 files changed, 25 insertions, 0 deletions
diff --git a/src/lib/VSDXTheme.cpp b/src/lib/VSDXTheme.cpp index 2f7b46d..a3f1ba8 100644 --- a/src/lib/VSDXTheme.cpp +++ b/src/lib/VSDXTheme.cpp @@ -29,6 +29,7 @@ #include "VSDXTheme.h" #include "VSDXMLTokenMap.h" +#include "libvisio_utils.h" libvisio::VSDXTheme::VSDXTheme() { @@ -66,5 +67,26 @@ bool libvisio::VSDXTheme::parse(WPXInputStream *input) return true; } +boost::optional<libvisio::Colour> libvisio::VSDXTheme::readSrgbClr(xmlTextReaderPtr reader) +{ + boost::optional<libvisio::Colour> retVal; + if (XML_A_SRGBCLR == VSDXMLTokenMap::getTokenId(xmlTextReaderConstName(reader))) + { + xmlChar *val = xmlTextReaderGetAttribute(reader, BAD_CAST("val")); + if (val) + { + try + { + retVal = xmlStringToColour(val); + } + catch (const XmlParserException &) + { + } + xmlFree(val); + } + } + return retVal; +} + /* vim:set shiftwidth=2 softtabstop=2 expandtab: */ diff --git a/src/lib/VSDXTheme.h b/src/lib/VSDXTheme.h index cb4b485..908f318 100644 --- a/src/lib/VSDXTheme.h +++ b/src/lib/VSDXTheme.h @@ -30,6 +30,7 @@ #ifndef __VSDXTHEME_H__ #define __VSDXTHEME_H__ +#include <boost/optional.hpp> #include <libwpd-stream/libwpd-stream.h> #include "VSDXMLHelper.h" @@ -48,6 +49,8 @@ public: private: VSDXTheme(const VSDXTheme &); VSDXTheme &operator=(const VSDXTheme &); + + boost::optional<Colour> readSrgbClr(xmlTextReaderPtr reader); }; } // namespace libvisio |