summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mst@openoffice.org>2010-03-09 13:27:16 +0100
committerMichael Stahl <mst@openoffice.org>2010-03-09 13:27:16 +0100
commita3383b6d9aef96303f55377be3dd1286485ec2ac (patch)
tree4bf6fcab93c401d08c995327819401564efdae99
parent5a83ca3d0b707f970295b9b1c38cb48c6a5bdc47 (diff)
odfmetadata4: #i108911#: patch by cmc: remove third redland patch:
redland: remove redland-1.0.8.patch.storage_hashes_list_duplicates. unordf: work around by checking for duplicate in addStatementGraph().
-rw-r--r--unoxml/source/rdf/librdf_repository.cxx13
1 files changed, 13 insertions, 0 deletions
diff --git a/unoxml/source/rdf/librdf_repository.cxx b/unoxml/source/rdf/librdf_repository.cxx
index b8ac60a390cb..b42d02f8f26a 100644
--- a/unoxml/source/rdf/librdf_repository.cxx
+++ b/unoxml/source/rdf/librdf_repository.cxx
@@ -1810,6 +1810,19 @@ void SAL_CALL librdf_Repository::addStatementGraph(
i_xSubject, i_xPredicate, i_xObject),
safe_librdf_free_statement);
OSL_ENSURE(pStatement, "mkStatement failed");
+
+ // Test for duplicate statement
+ // librdf_model_add_statement disallows duplicates while
+ // librdf_model_context_add_statement allows duplicates
+ {
+ const boost::shared_ptr<librdf_stream> pStream(
+ librdf_model_find_statements_in_context(m_pModel.get(),
+ pStatement.get(), pContext.get()),
+ safe_librdf_free_stream);
+ if (pStream && !librdf_stream_end(pStream.get()))
+ return;
+ }
+
if (librdf_model_context_add_statement(m_pModel.get(),
pContext.get(), pStatement.get())) {
throw rdf::RepositoryException(::rtl::OUString::createFromAscii(