summaryrefslogtreecommitdiffstats
path: root/src/io/xsltstream.cpp
diff options
context:
space:
mode:
authorBob Jamison <ishmalius@gmail.com>2008-05-04 16:09:41 +0000
committerishmal <ishmal@users.sourceforge.net>2008-05-04 16:09:41 +0000
commit724525e5ffdf20b34596bee58113011e98dff6f6 (patch)
tree6c8faf1845dab1208ba747b03a716aefd3e7427d /src/io/xsltstream.cpp
parent* configure.ac: Have the "linker tolerates -z relro" configure test do (diff)
downloadinkscape-724525e5ffdf20b34596bee58113011e98dff6f6.tar.gz
inkscape-724525e5ffdf20b34596bee58113011e98dff6f6.zip
Remove warnings
(bzr r5599)
Diffstat (limited to 'src/io/xsltstream.cpp')
-rw-r--r--src/io/xsltstream.cpp39
1 files changed, 34 insertions, 5 deletions
diff --git a/src/io/xsltstream.cpp b/src/io/xsltstream.cpp
index 71619a51e..6f35d9cb6 100644
--- a/src/io/xsltstream.cpp
+++ b/src/io/xsltstream.cpp
@@ -2,9 +2,9 @@
* XSL Transforming input and output classes
*
* Authors:
- * Bob Jamison <rjamison@titan.com>
+ * Bob Jamison <ishmalius@gmail.com>
*
- * Copyright (C) 2004 Inkscape.org
+ * Copyright (C) 2004-2008 Inkscape.org
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
@@ -25,25 +25,54 @@ namespace IO
//#########################################################################
//# X S L T S T Y L E S H E E T
//#########################################################################
+
/**
*
- */
-XsltStyleSheet::XsltStyleSheet(InputStream &xsltSource) throw (StreamException)
+ */
+XsltStyleSheet::XsltStyleSheet(InputStream &xsltSource)
+ throw (StreamException)
+ : stylesheet(NULL)
+{
+ if (!read(xsltSource)) {
+ throw StreamException("read failed");
+ }
+}
+
+/**
+ *
+ */
+XsltStyleSheet::XsltStyleSheet()
+ : stylesheet(NULL)
+{
+}
+
+
+
+/**
+ *
+ */
+bool XsltStyleSheet::read(InputStream &xsltSource)
{
StringOutputStream outs;
pipeStream(xsltSource, outs);
std::string strBuf = outs.getString().raw();
xmlDocPtr doc = xmlParseMemory(strBuf.c_str(), strBuf.size());
stylesheet = xsltParseStylesheetDoc(doc);
+ //following not necessary. handled by xsltFreeStylesheet(stylesheet);
//xmlFreeDoc(doc);
+ if (!stylesheet)
+ return false;
+ return true;
}
+
/**
*
*/
XsltStyleSheet::~XsltStyleSheet()
{
- xsltFreeStylesheet(stylesheet);
+ if (stylesheet)
+ xsltFreeStylesheet(stylesheet);
}