You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by hd...@apache.org on 2012/01/12 09:16:51 UTC

svn commit: r1230438 - in /incubator/ooo/trunk/main/unoxml: Library_unordf.mk source/rdf/librdf_repository.cxx

Author: hdu
Date: Thu Jan 12 08:16:51 2012
New Revision: 1230438

URL: http://svn.apache.org/viewvc?rev=1230438&view=rev
Log:
use custom ExtEnt loader for RDF import

Modified:
    incubator/ooo/trunk/main/unoxml/Library_unordf.mk
    incubator/ooo/trunk/main/unoxml/source/rdf/librdf_repository.cxx

Modified: incubator/ooo/trunk/main/unoxml/Library_unordf.mk
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/unoxml/Library_unordf.mk?rev=1230438&r1=1230437&r2=1230438&view=diff
==============================================================================
--- incubator/ooo/trunk/main/unoxml/Library_unordf.mk (original)
+++ incubator/ooo/trunk/main/unoxml/Library_unordf.mk Thu Jan 12 08:16:51 2012
@@ -40,6 +40,7 @@ $(eval $(call gb_Library_add_linked_libs
 	sal \
 	stl \
 	rdf \
+	xml2 \
 	xslt \
     $(gb_STDLIBS) \
 ))

Modified: incubator/ooo/trunk/main/unoxml/source/rdf/librdf_repository.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/unoxml/source/rdf/librdf_repository.cxx?rev=1230438&r1=1230437&r2=1230438&view=diff
==============================================================================
--- incubator/ooo/trunk/main/unoxml/source/rdf/librdf_repository.cxx (original)
+++ incubator/ooo/trunk/main/unoxml/source/rdf/librdf_repository.cxx Thu Jan 12 08:16:51 2012
@@ -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_Fo
     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::Ille
             "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::Ille
             "librdf_Repository::importGraph: "
             "librdf_model_context_add_statements failed"), *this);
     }
+
+    xmlSetExternalEntityLoader( oldExtEntityLoader);
     return getGraph(i_xGraphName);
 }