From 53b7204be722f8dca37bc059b9f253eafa8e0aea Mon Sep 17 00:00:00 2001 From: Fridrich Štrba Date: Mon, 22 Jul 2013 05:01:16 +0200 Subject: Reader for a:sysClr --- src/lib/VSDXTheme.cpp | 21 +++++++++++++++++++++ src/lib/VSDXTheme.h | 1 + src/lib/tokens.txt | 1 + 3 files changed, 23 insertions(+) diff --git a/src/lib/VSDXTheme.cpp b/src/lib/VSDXTheme.cpp index a3f1ba8..126d16f 100644 --- a/src/lib/VSDXTheme.cpp +++ b/src/lib/VSDXTheme.cpp @@ -88,5 +88,26 @@ boost::optional libvisio::VSDXTheme::readSrgbClr(xmlTextReader return retVal; } +boost::optional libvisio::VSDXTheme::readSysClr(xmlTextReaderPtr reader) +{ + boost::optional retVal; + if (XML_A_SYSCLR == VSDXMLTokenMap::getTokenId(xmlTextReaderConstName(reader))) + { + xmlChar *lastClr = xmlTextReaderGetAttribute(reader, BAD_CAST("lastClr")); + if (lastClr) + { + try + { + retVal = xmlStringToColour(lastClr); + } + catch (const XmlParserException &) + { + } + xmlFree(lastClr); + } + } + return retVal; +} + /* vim:set shiftwidth=2 softtabstop=2 expandtab: */ diff --git a/src/lib/VSDXTheme.h b/src/lib/VSDXTheme.h index 908f318..30ac216 100644 --- a/src/lib/VSDXTheme.h +++ b/src/lib/VSDXTheme.h @@ -51,6 +51,7 @@ private: VSDXTheme &operator=(const VSDXTheme &); boost::optional readSrgbClr(xmlTextReaderPtr reader); + boost::optional readSysClr(xmlTextReaderPtr reader); }; } // namespace libvisio diff --git a/src/lib/tokens.txt b/src/lib/tokens.txt index ead1950..7c4a966 100644 --- a/src/lib/tokens.txt +++ b/src/lib/tokens.txt @@ -46,6 +46,7 @@ a:schemeClr a:shade a:solidFill a:srgbClr +a:sysClr a:theme a:themeElements a:tint -- cgit v1.2.3