summaryrefslogtreecommitdiff
path: root/xmlreader/source/xmlreader.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'xmlreader/source/xmlreader.cxx')
-rw-r--r--xmlreader/source/xmlreader.cxx14
1 files changed, 14 insertions, 0 deletions
diff --git a/xmlreader/source/xmlreader.cxx b/xmlreader/source/xmlreader.cxx
index 13e278091f86..3e1d24e24530 100644
--- a/xmlreader/source/xmlreader.cxx
+++ b/xmlreader/source/xmlreader.cxx
@@ -54,6 +54,18 @@ bool isSpace(char c) {
}
+XmlReader::XmlReader(char const *sStr, size_t nLength)
+ : fileUrl_("stream")
+ , fileHandle_(0)
+{
+ namespaceIris_.push_back(Span("http://www.w3.org/XML/1998/namespace"));
+ namespaces_.push_back(NamespaceData(Span("xml"), NAMESPACE_XML));
+ pos_ = sStr;
+ end_ = pos_ + nLength;
+ state_ = STATE_CONTENT;
+ firstAttribute_ = true;
+}
+
XmlReader::XmlReader(OUString const & fileUrl)
SAL_THROW((
css::container::NoSuchElementException, css::uno::RuntimeException)):
@@ -99,6 +111,8 @@ XmlReader::XmlReader(OUString const & fileUrl)
}
XmlReader::~XmlReader() {
+ if (!fileHandle_)
+ return;
oslFileError e = osl_unmapMappedFile(fileHandle_, fileAddress_, fileSize_);
if (e != osl_File_E_None) {
SAL_WARN(