12#include <com/sun/star/rdf/Literal.hpp>
13#include <com/sun/star/rdf/URI.hpp>
14#include <com/sun/star/rdf/XDocumentMetadataAccess.hpp>
15#include <com/sun/star/text/XTextDocument.hpp>
16#include <com/sun/star/text/XTextRange.hpp>
18#include <ooxml/resourceids.hxx>
24OUString lcl_getTypePath(OUString& rType)
27 if (rType.startsWith(
"urn:bails"))
30 aRet =
"tscp/bails.rdf";
44 , m_xDocumentMetadataAccess(xTextDocument,
uno::UNO_QUERY)
54 case NS_ooxml::LN_CT_Attr_name:
57 case NS_ooxml::LN_CT_Attr_val:
62 SAL_WARN(
"writerfilter",
"SmartTagHandler::lcl_attribute: unhandled attribute "
71 switch (rSprm.
getId())
73 case NS_ooxml::LN_CT_SmartTagPr_attr:
77 pProperties->resolve(*
this);
94 for (
const std::pair<OUString, OUString>& rAttribute :
m_aAttributes)
96 OUString aTypeNS = rAttribute.first;
97 OUString aMetadataFilePath = lcl_getTypePath(aTypeNS);
98 if (aMetadataFilePath.isEmpty())
105 if (aGraphNames.hasElements())
106 xGraphName = aGraphNames[0];
117 xGraph->addStatement(xSubject, xKey, xValue);
An SPRM: Section, Paragraph and Run Modifier.
virtual sal_uInt32 getId() const =0
Returns id of the SPRM.
virtual writerfilter::Reference< Properties >::Pointer_t getProps()=0
Returns reference to properties contained in the SPRM.
virtual OUString getString() const =0
Returns string representation of the value.
void lcl_sprm(Sprm &rSprm) override
SmartTagHandler(css::uno::Reference< css::uno::XComponentContext > xComponentContext, const css::uno::Reference< css::text::XTextDocument > &xTextDocument)
void setElement(const OUString &rElement)
std::vector< std::pair< OUString, OUString > > m_aAttributes
~SmartTagHandler() override
void setURI(const OUString &rURI)
css::uno::Reference< css::uno::XComponentContext > m_xComponentContext
void lcl_attribute(Id nId, Value &rValue) override
void handle(const css::uno::Reference< css::text::XTextRange > &xParagraph)
Set m_aAttributes as RDF statements on xParagraph.
css::uno::Reference< css::rdf::XDocumentMetadataAccess > m_xDocumentMetadataAccess
Reference< XComponentContext > const m_xComponentContext
#define SAL_WARN(area, stream)