From 0c16f59fe7a3aed7cc055a81facbbc1fb35998d7 Mon Sep 17 00:00:00 2001 From: Fridrich Štrba Date: Fri, 17 Jan 2014 13:22:24 +0100 Subject: All invocation of xmlReaderForStream use the same options (cherry picked from commit e68f8f29ec365cc07edf6f1b1dc15c7f75f40051) Conflicts: src/lib/ABWXMLHelper.cpp src/lib/ABWXMLHelper.h src/lib/AbiDocument.cpp Change-Id: I6f61c92db22114e3592cd5d24516bcd879422566 --- src/lib/ABWParser.cpp | 2 +- src/lib/ABWXMLHelper.cpp | 5 +++-- src/lib/ABWXMLHelper.h | 5 +---- src/lib/AbiDocument.cpp | 2 +- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/lib/ABWParser.cpp b/src/lib/ABWParser.cpp index 6fd3b8a..737d4e3 100644 --- a/src/lib/ABWParser.cpp +++ b/src/lib/ABWParser.cpp @@ -120,7 +120,7 @@ bool libabw::ABWParser::processXmlDocument(librevenge::RVNGInputStream *input) if (!input) return false; - xmlTextReaderPtr reader = xmlReaderForStream(input, 0, 0, XML_PARSE_NOBLANKS|XML_PARSE_NOENT|XML_PARSE_NONET|XML_PARSE_RECOVER); + xmlTextReaderPtr reader = xmlReaderForStream(input); if (!reader) return false; int ret = xmlTextReaderRead(reader); diff --git a/src/lib/ABWXMLHelper.cpp b/src/lib/ABWXMLHelper.cpp index d1dbcf2..84d59e1 100644 --- a/src/lib/ABWXMLHelper.cpp +++ b/src/lib/ABWXMLHelper.cpp @@ -73,9 +73,10 @@ extern "C" { // xmlTextReader helper function -xmlTextReaderPtr libabw::xmlReaderForStream(librevenge::RVNGInputStream *input, const char *URL, const char *encoding, int options) +xmlTextReaderPtr libabw::xmlReaderForStream(librevenge::RVNGInputStream *input) { - xmlTextReaderPtr reader = xmlReaderForIO(abwxmlInputReadFunc, abwxmlInputCloseFunc, (void *)input, URL, encoding, options); + xmlTextReaderPtr reader = xmlReaderForIO(abwxmlInputReadFunc, abwxmlInputCloseFunc, (void *)input, 0, 0, + XML_PARSE_NOBLANKS|XML_PARSE_NOENT|XML_PARSE_NONET|XML_PARSE_RECOVER); xmlTextReaderSetErrorHandler(reader, abwxmlReaderErrorFunc, 0); return reader; } diff --git a/src/lib/ABWXMLHelper.h b/src/lib/ABWXMLHelper.h index f0d7b9a..3febdb8 100644 --- a/src/lib/ABWXMLHelper.h +++ b/src/lib/ABWXMLHelper.h @@ -19,10 +19,7 @@ namespace libabw // create an xmlTextReader pointer from a librevenge::RVNGInputStream pointer // needs to be freed using xmlTextReaderFree function. -xmlTextReaderPtr xmlReaderForStream(librevenge::RVNGInputStream *input, - const char *URL, - const char *encoding, - int options); +xmlTextReaderPtr xmlReaderForStream(librevenge::RVNGInputStream *input); } // namespace libabw diff --git a/src/lib/AbiDocument.cpp b/src/lib/AbiDocument.cpp index 15b2155..7dddd85 100644 --- a/src/lib/AbiDocument.cpp +++ b/src/lib/AbiDocument.cpp @@ -45,7 +45,7 @@ ABWAPI bool libabw::AbiDocument::isFileFormatSupported(librevenge::RVNGInputStre try { stream.seek(0, librevenge::RVNG_SEEK_SET); - reader = libabw::xmlReaderForStream(&stream, 0, 0, XML_PARSE_NOBLANKS|XML_PARSE_NOENT|XML_PARSE_NONET|XML_PARSE_RECOVER); + reader = libabw::xmlReaderForStream(&stream); if (!reader) return false; int ret = xmlTextReaderRead(reader); -- cgit v1.2.3