[Libreoffice-commits] libvisio.git: src/lib

Fridrich Å trba fridrich.strba at bluewin.ch
Sun Jul 21 14:26:59 PDT 2013


 src/lib/VSDXTheme.cpp |   22 ++++++++++++++++++++++
 src/lib/VSDXTheme.h   |    3 +++
 2 files changed, 25 insertions(+)

New commits:
commit fa150e4eca78bad7a9430cf906cc7078beaf039a
Author: Fridrich Å trba <fridrich.strba at bluewin.ch>
Date:   Sun Jul 21 23:26:14 2013 +0200

    reader function for a:srgbClr

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


More information about the Libreoffice-commits mailing list