summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFridrich Štrba <fridrich.strba@bluewin.ch>2013-07-22 05:01:16 +0200
committerFridrich Štrba <fridrich.strba@bluewin.ch>2013-07-22 05:01:16 +0200
commit53b7204be722f8dca37bc059b9f253eafa8e0aea (patch)
treed96b930f0c093c9c81d8686cdaa2a0985904c666
parentfa150e4eca78bad7a9430cf906cc7078beaf039a (diff)
Reader for a:sysClr
-rw-r--r--src/lib/VSDXTheme.cpp21
-rw-r--r--src/lib/VSDXTheme.h1
-rw-r--r--src/lib/tokens.txt1
3 files changed, 23 insertions, 0 deletions
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::Colour> libvisio::VSDXTheme::readSrgbClr(xmlTextReader
return retVal;
}
+boost::optional<libvisio::Colour> libvisio::VSDXTheme::readSysClr(xmlTextReaderPtr reader)
+{
+ boost::optional<libvisio::Colour> 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<Colour> readSrgbClr(xmlTextReaderPtr reader);
+ boost::optional<Colour> 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