diff options
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/tscp.docx | bin | 4758 -> 4878 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport5.cxx | 13 | ||||
-rw-r--r-- | sw/qa/extras/ww8export/data/tscp.doc | bin | 23040 -> 10240 bytes | |||
-rw-r--r-- | sw/qa/extras/ww8export/ww8export.cxx | 13 | ||||
-rw-r--r-- | sw/source/core/doc/rdfhelper.cxx | 3 | ||||
-rw-r--r-- | sw/source/filter/basflt/fltshell.cxx | 15 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtww8.cxx | 2 | ||||
-rw-r--r-- | writerfilter/source/dmapper/SmartTagHandler.cxx | 18 |
9 files changed, 34 insertions, 32 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tscp.docx b/sw/qa/extras/ooxmlexport/data/tscp.docx Binary files differindex 3cda72de572e..bbb32b178bd9 100644 --- a/sw/qa/extras/ooxmlexport/data/tscp.docx +++ b/sw/qa/extras/ooxmlexport/data/tscp.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx index 65203a6437b7..0507fcca7693 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx @@ -90,10 +90,10 @@ DECLARE_OOXMLEXPORT_TEST(testFDO76248, "FDO76248.docx") DECLARE_OOXMLEXPORT_TEST(testTscp, "tscp.docx") { uno::Reference<uno::XComponentContext> xComponentContext(comphelper::getProcessComponentContext()); - uno::Reference<rdf::XURI> xType = rdf::URI::create(xComponentContext, "urn:tscp:names:baf:1.1"); + uno::Reference<rdf::XURI> xType = rdf::URI::create(xComponentContext, "urn:bails"); uno::Reference<rdf::XDocumentMetadataAccess> xDocumentMetadataAccess(mxComponent, uno::UNO_QUERY); uno::Sequence< uno::Reference<rdf::XURI> > aGraphNames = xDocumentMetadataAccess->getMetadataGraphsWithType(xType); - // This failed, no graphs had the urn:tscp:names:baf:1.1 type. + // This failed, no graphs had the urn:bails type. CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), aGraphNames.getLength()); uno::Reference<rdf::XURI> xGraphName = aGraphNames[0]; uno::Reference<rdf::XNamedGraph> xGraph = xDocumentMetadataAccess->getRDFRepository()->getGraph(xGraphName); @@ -105,10 +105,11 @@ DECLARE_OOXMLEXPORT_TEST(testTscp, "tscp.docx") // 3 RDF statements on the second paragraph. xParagraph.set(getParagraph(2), uno::UNO_QUERY); - std::map<OUString, OUString> aExpectedStatements = { - {"urn:tscp:names:baf:1.1#BusinessAuthorization", "urn:example:tscp:1"}, - {"urn:tscp:names:baf:1.1#BusinessAuthorizationCategory", "urn:example:tscp:1:confidential"}, - {"urn:tscp:names:baf:1.1#BusinessAuthorizationDate", "2015-11-27T11:45:00"} + std::map<OUString, OUString> aExpectedStatements = + { + {"urn:bails:ExportControl:BusinessAuthorization:Identifier", "urn:example:tscp:1"}, + {"urn:bails:ExportControl:BusinessAuthorizationCategory:Identifier", "urn:example:tscp:1:confidential"}, + {"urn:bails:ExportControl:Authorization:StartValidity", "2015-11-27"} }; std::map<OUString, OUString> aActualStatements; xStatements = xGraph->getStatements(xParagraph, uno::Reference<rdf::XURI>(), uno::Reference<rdf::XURI>()); diff --git a/sw/qa/extras/ww8export/data/tscp.doc b/sw/qa/extras/ww8export/data/tscp.doc Binary files differindex 7b710fcab770..9830b288c1a4 100644 --- a/sw/qa/extras/ww8export/data/tscp.doc +++ b/sw/qa/extras/ww8export/data/tscp.doc diff --git a/sw/qa/extras/ww8export/ww8export.cxx b/sw/qa/extras/ww8export/ww8export.cxx index de107665d665..39c3fc80e8ea 100644 --- a/sw/qa/extras/ww8export/ww8export.cxx +++ b/sw/qa/extras/ww8export/ww8export.cxx @@ -103,10 +103,10 @@ DECLARE_WW8EXPORT_TEST(testN325936, "n325936.doc") DECLARE_WW8EXPORT_TEST(testTscp, "tscp.doc") { uno::Reference<uno::XComponentContext> xComponentContext(comphelper::getProcessComponentContext()); - uno::Reference<rdf::XURI> xType = rdf::URI::create(xComponentContext, "urn:tscp:names:baf:1.1"); + uno::Reference<rdf::XURI> xType = rdf::URI::create(xComponentContext, "urn:bails"); uno::Reference<rdf::XDocumentMetadataAccess> xDocumentMetadataAccess(mxComponent, uno::UNO_QUERY); uno::Sequence< uno::Reference<rdf::XURI> > aGraphNames = xDocumentMetadataAccess->getMetadataGraphsWithType(xType); - // This failed, no graphs had the urn:tscp:names:baf:1.1 type. + // This failed, no graphs had the urn:bails type. CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), aGraphNames.getLength()); uno::Reference<rdf::XURI> xGraphName = aGraphNames[0]; uno::Reference<rdf::XNamedGraph> xGraph = xDocumentMetadataAccess->getRDFRepository()->getGraph(xGraphName); @@ -118,10 +118,11 @@ DECLARE_WW8EXPORT_TEST(testTscp, "tscp.doc") // 3 RDF statements on the second paragraph. xParagraph.set(getParagraph(2), uno::UNO_QUERY); - std::map<OUString, OUString> aExpectedStatements = { - {"urn:tscp:names:baf:1.1#BusinessAuthorization", "urn:example:tscp:1"}, - {"urn:tscp:names:baf:1.1#BusinessAuthorizationCategory", "urn:example:tscp:1:confidential"}, - {"urn:tscp:names:baf:1.1#BusinessAuthorizationDate", "2015-11-27T11:45:00"} + std::map<OUString, OUString> aExpectedStatements = + { + {"urn:bails:ExportControl:BusinessAuthorization:Identifier", "urn:example:tscp:1"}, + {"urn:bails:ExportControl:BusinessAuthorizationCategory:Identifier", "urn:example:tscp:1:confidential"}, + {"urn:bails:ExportControl:Authorization:StartValidity", "2015-11-27"} }; std::map<OUString, OUString> aActualStatements; xStatements = xGraph->getStatements(xParagraph, uno::Reference<rdf::XURI>(), uno::Reference<rdf::XURI>()); diff --git a/sw/source/core/doc/rdfhelper.cxx b/sw/source/core/doc/rdfhelper.cxx index 83605ed4858a..7f9381329ae4 100644 --- a/sw/source/core/doc/rdfhelper.cxx +++ b/sw/source/core/doc/rdfhelper.cxx @@ -9,6 +9,7 @@ #include <rdfhelper.hxx> +#include <com/sun/star/rdf/Literal.hpp> #include <com/sun/star/rdf/Statement.hpp> #include <com/sun/star/rdf/URI.hpp> #include <com/sun/star/rdf/XDocumentMetadataAccess.hpp> @@ -68,7 +69,7 @@ void SwRDFHelper::addTextNodeStatement(const OUString& rType, const OUString& rP uno::Reference<rdf::XNamedGraph> xGraph = xDocumentMetadataAccess->getRDFRepository()->getGraph(xGraphName); uno::Reference<rdf::XResource> xSubject(SwXParagraph::CreateXParagraph(*rTextNode.GetDoc(), &rTextNode), uno::UNO_QUERY); uno::Reference<rdf::XURI> xKey = rdf::URI::create(xComponentContext, rKey); - uno::Reference<rdf::XURI> xValue = rdf::URI::create(xComponentContext, rValue); + uno::Reference<rdf::XLiteral> xValue = rdf::Literal::create(xComponentContext, rValue); xGraph->addStatement(xSubject, xKey, xValue); } diff --git a/sw/source/filter/basflt/fltshell.cxx b/sw/source/filter/basflt/fltshell.cxx index c80eab7701d0..de1e97cd4763 100644 --- a/sw/source/filter/basflt/fltshell.cxx +++ b/sw/source/filter/basflt/fltshell.cxx @@ -81,11 +81,14 @@ static SwContentNode* GetContentNode(SwDoc* pDoc, SwNodeIndex& rIdx, bool bNext) return pCNd; } -static OUString lcl_getTypePath(const OUString& rType) +static OUString lcl_getTypePath(OUString& rType) { OUString aRet; - if (rType == "urn:tscp:names:baf:1.1") - aRet = "tscp/baf.rdf"; + if (rType.startsWith("urn:bails")) + { + rType = "urn:bails"; + aRet = "tscp/bails.rdf"; + } return aRet; } @@ -634,11 +637,7 @@ void SwFltControlStack::SetAttrInDoc(const SwPosition& rTmpPos, for (const std::pair<OUString, OUString>& rAttribute : pMark->GetAttributes()) { - sal_Int32 nIndex = rAttribute.first.indexOf('#'); - if (nIndex == -1) - continue; - - OUString aTypeNS = rAttribute.first.copy(0, nIndex); + OUString aTypeNS = rAttribute.first; OUString aMetadataFilePath = lcl_getTypePath(aTypeNS); if (aMetadataFilePath.isEmpty()) continue; diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 2b9fdedc9ba5..6b4cadee2331 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -1038,7 +1038,7 @@ void DocxAttributeOutput::EndParagraphProperties(const SfxItemSet& rParagraphMar // RDF metadata for this text node. SwTextNode* pTextNode = m_rExport.m_pCurPam->GetNode().GetTextNode(); - std::map<OUString, OUString> aStatements = SwRDFHelper::getTextNodeStatements("urn:tscp:names:baf:1.1", *pTextNode); + std::map<OUString, OUString> aStatements = SwRDFHelper::getTextNodeStatements("urn:bails", *pTextNode); if (!aStatements.empty()) { m_pSerializer->startElementNS(XML_w, XML_smartTag, diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index ae956e04be3b..6503a6886ae0 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -1501,7 +1501,7 @@ void WW8Export::AppendAnnotationMarks(const SwTextNode& rNode, sal_Int32 nAktPos void WW8Export::AppendSmartTags(const SwTextNode& rTextNode) { - std::map<OUString, OUString> aStatements = SwRDFHelper::getTextNodeStatements("urn:tscp:names:baf:1.1", rTextNode); + std::map<OUString, OUString> aStatements = SwRDFHelper::getTextNodeStatements("urn:bails", rTextNode); if (!aStatements.empty()) { WW8_CP nCP = Fc2Cp(Strm().Tell()); diff --git a/writerfilter/source/dmapper/SmartTagHandler.cxx b/writerfilter/source/dmapper/SmartTagHandler.cxx index dc9f094e4917..27f4e393db7d 100644 --- a/writerfilter/source/dmapper/SmartTagHandler.cxx +++ b/writerfilter/source/dmapper/SmartTagHandler.cxx @@ -9,17 +9,21 @@ #include <SmartTagHandler.hxx> +#include <com/sun/star/rdf/Literal.hpp> #include <com/sun/star/rdf/URI.hpp> #include <ooxml/resourceids.hxx> namespace { -OUString lcl_getTypePath(const OUString& rType) +OUString lcl_getTypePath(OUString& rType) { OUString aRet; - if (rType == "urn:tscp:names:baf:1.1") - aRet = "tscp/baf.rdf"; + if (rType.startsWith("urn:bails")) + { + rType = "urn:bails"; + aRet = "tscp/bails.rdf"; + } return aRet; } } @@ -91,11 +95,7 @@ void SmartTagHandler::handle(const uno::Reference<text::XTextRange>& xParagraph) for (const std::pair<OUString, OUString>& rAttribute : m_aAttributes) { - sal_Int32 nIndex = rAttribute.first.indexOf('#'); - if (nIndex == -1) - continue; - - OUString aTypeNS = rAttribute.first.copy(0, nIndex); + OUString aTypeNS = rAttribute.first; OUString aMetadataFilePath = lcl_getTypePath(aTypeNS); if (aMetadataFilePath.isEmpty()) continue; @@ -112,7 +112,7 @@ void SmartTagHandler::handle(const uno::Reference<text::XTextRange>& xParagraph) } uno::Reference<rdf::XNamedGraph> xGraph = m_xDocumentMetadataAccess->getRDFRepository()->getGraph(xGraphName); uno::Reference<rdf::XURI> xKey = rdf::URI::create(m_xComponentContext, rAttribute.first); - uno::Reference<rdf::XURI> xValue = rdf::URI::create(m_xComponentContext, rAttribute.second); + uno::Reference<rdf::XLiteral> xValue = rdf::Literal::create(m_xComponentContext, rAttribute.second); xGraph->addStatement(xSubject, xKey, xValue); } |