diff options
author | Michael Stahl <mst@openoffice.org> | 2010-03-09 13:27:16 +0100 |
---|---|---|
committer | Michael Stahl <mst@openoffice.org> | 2010-03-09 13:27:16 +0100 |
commit | a3383b6d9aef96303f55377be3dd1286485ec2ac (patch) | |
tree | 4bf6fcab93c401d08c995327819401564efdae99 /unoxml | |
parent | 5a83ca3d0b707f970295b9b1c38cb48c6a5bdc47 (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().
Diffstat (limited to 'unoxml')
-rw-r--r-- | unoxml/source/rdf/librdf_repository.cxx | 13 |
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( |