Kaydet (Commit) da0b49f8 authored tarafından Miklos Vajna's avatar Miklos Vajna

sw: accept a const text node in SwRDFHelper::getTextNodeStatements()

It's an implementation detail that the used UNO API needs a non-cost
text node, even if only read methods are called on the wrapper object.

Change-Id: If15eaca48339f1531fd54da3422a6b7c41eb48f7
üst 5ac6e002
......@@ -23,7 +23,7 @@ class SW_DLLPUBLIC SwRDFHelper
{
public:
/// Gets all (rTextNode, key, value) statements in RDF graphs of type rType.
static std::map<OUString, OUString> getTextNodeStatements(const OUString& rType, SwTextNode& rTextNode);
static std::map<OUString, OUString> getTextNodeStatements(const OUString& rType, const SwTextNode& rTextNode);
/// Add an (rTextNode, key, value) statement in the graph of type rType -- or if it does not exist, create a graph at rPath first.
static void addTextNodeStatement(const OUString& rType, const OUString& rPath, SwTextNode& rTextNode, const OUString& rKey, const OUString& rValue);
};
......
......@@ -22,10 +22,13 @@
using namespace com::sun::star;
std::map<OUString, OUString> SwRDFHelper::getTextNodeStatements(const OUString& rType, SwTextNode& rTextNode)
std::map<OUString, OUString> SwRDFHelper::getTextNodeStatements(const OUString& rType, const SwTextNode& rNode)
{
std::map<OUString, OUString> aRet;
// We only read the node, but CreateXParagraph() needs a non-cost one.
SwTextNode& rTextNode = const_cast<SwTextNode&>(rNode);
uno::Reference<uno::XComponentContext> xComponentContext(comphelper::getProcessComponentContext());
uno::Reference<rdf::XURI> xType = rdf::URI::create(xComponentContext, rType);
uno::Reference<rdf::XDocumentMetadataAccess> xDocumentMetadataAccess(rTextNode.GetDoc()->GetDocShell()->GetBaseModel(), uno::UNO_QUERY);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment