summaryrefslogtreecommitdiff
path: root/unoxml
diff options
context:
space:
mode:
authorHerbert Dürr <hdu@apache.org>2012-01-12 07:16:51 +0000
committerHerbert Dürr <hdu@apache.org>2012-01-12 07:16:51 +0000
commit4b7c4e762a5e9c5204010de8e4e53533339ecf65 (patch)
tree00d745b14f6db997230e4bc8918cae100bebf310 /unoxml
parente18a54b3b97cea05db6cd9e8e6929819a40b305d (diff)
use custom ExtEnt loader for RDF import
Notes
Notes: merged as: dafedde5ada872bf1a9e6249d4e592fdcaf7ffcd
Diffstat (limited to 'unoxml')
-rw-r--r--unoxml/Library_unordf.mk1
-rw-r--r--unoxml/source/rdf/librdf_repository.cxx11
2 files changed, 12 insertions, 0 deletions
diff --git a/unoxml/Library_unordf.mk b/unoxml/Library_unordf.mk
index 2ca19e09f86e..d56e703cdb40 100644
--- a/unoxml/Library_unordf.mk
+++ b/unoxml/Library_unordf.mk
@@ -40,6 +40,7 @@ $(eval $(call gb_Library_add_linked_libs,unordf,\
sal \
stl \
rdf \
+ xml2 \
xslt \
$(gb_STDLIBS) \
))
diff --git a/unoxml/source/rdf/librdf_repository.cxx b/unoxml/source/rdf/librdf_repository.cxx
index 41465c342294..68759e2d4f32 100644
--- a/unoxml/source/rdf/librdf_repository.cxx
+++ b/unoxml/source/rdf/librdf_repository.cxx
@@ -36,6 +36,7 @@
#include <boost/bind.hpp>
#include <libxslt/security.h>
+#include <libxml/parser.h>
// #i114999# do not include librdf.h, it is broken in redland 1.0.11
#include <redland.h>
@@ -873,6 +874,11 @@ bool formatNeedsBaseURI(::sal_Int16 i_Format)
return true;
}
+xmlParserInputPtr myExtEntityLoader( const char* /*URL*/, const char* /*ID*/, xmlParserCtxtPtr /*context*/)
+{
+ return NULL;
+}
+
//void SAL_CALL
uno::Reference<rdf::XNamedGraph> SAL_CALL
librdf_Repository::importGraph(::sal_Int16 i_Format,
@@ -960,6 +966,9 @@ throw (uno::RuntimeException, lang::IllegalArgumentException,
"librdf_new_parser failed"), *this);
}
+ xmlExternalEntityLoader oldExtEntityLoader = xmlGetExternalEntityLoader();
+ xmlSetExternalEntityLoader( myExtEntityLoader);
+
uno::Sequence<sal_Int8> buf;
uno::Reference<io::XSeekable> xSeekable(i_xInStream, uno::UNO_QUERY);
// UGLY: if only that redland junk could read streams...
@@ -984,6 +993,8 @@ throw (uno::RuntimeException, lang::IllegalArgumentException,
"librdf_Repository::importGraph: "
"librdf_model_context_add_statements failed"), *this);
}
+
+ xmlSetExternalEntityLoader( oldExtEntityLoader);
return getGraph(i_xGraphName);
}