29#include <osl/diagnose.h>
43 const OUString& rQName );
45 virtual void StartElement(
const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList )
override;
49 virtual void Characters(
const OUString& rChars )
override;
59 const OUString& rQName ) :
66 const Reference< XAttributeList >& rAttrList )
68 sal_Int16 nAttrCount = rAttrList.is() ? rAttrList->getLength() : 0;
69 for( sal_Int16
i=0;
i < nAttrCount;
i++ )
71 const OUString& rAttrName = rAttrList->getNameByIndex(
i );
99 const OUString& rQName ) :
101 m_aElemQName( rQName ),
102 m_nValueTypeAttr( -1 ),
115 const OUString& rLocalName,
116 const OUString& rQName,
117 const Reference< XAttributeList >& )
145 const Reference< XAttributeList >& rAttrList )
150 OSL_ENSURE( pActions,
"go no actions" );
157 sal_Int16 nAttrCount = rAttrList.is() ? rAttrList->getLength() : 0;
158 for( sal_Int16
i=0;
i < nAttrCount;
i++ )
160 const OUString& rAttrName = rAttrList->getNameByIndex(
i );
165 XMLTransformerActions::key_type aKey( nPrefix, aLocalName );
166 XMLTransformerActions::const_iterator aIter =
167 pActions->find( aKey );
168 if( aIter != pActions->end() )
170 const OUString& rAttrValue = rAttrList->getValueByIndex(
i );
171 switch( (*aIter).second.m_nActionType )
176 aValueType = rAttrValue;
180 OUString aNewAttrQName(
182 (*aIter).second.GetQNamePrefixFromParam1(),
184 (*aIter).second.GetQNameTokenFromParam1()) ) );
185 pMutableAttrList->RenameAttributeByIndex(
i, aNewAttrQName );
196 pMutableAttrList->RemoveAttributeByIndex(
i );
201 OSL_ENSURE(
false,
"unknown action" );
207 if( !aValueType.isEmpty() )
OUString GetQNameByKey(sal_uInt16 nKey, const OUString &rLocalName, bool bCache=true) const
sal_uInt16 GetKeyByAttrName(const OUString &rAttrName, OUString *pPrefix, OUString *pLocalName, OUString *pNamespace) const
::xmloff::token::XMLTokenEnum m_eValueTypeToken
css::uno::Reference< css::xml::sax::XAttributeList > m_xAttrList
virtual rtl::Reference< XMLTransformerContext > CreateChildContext(sal_uInt16 nPrefix, const OUString &rLocalName, const OUString &rQName, const css::uno::Reference< css::xml::sax::XAttributeList > &xAttrList) override
virtual void StartElement(const css::uno::Reference< css::xml::sax::XAttributeList > &xAttrList) override
sal_Int16 m_nValueTypeAttr
::rtl::Reference< XMLFormPropValueTContext_Impl > m_xValueContext
virtual void EndElement() override
virtual ~XMLFormPropOOoTransformerContext() override
::xmloff::token::XMLTokenEnum m_eValueToken
XMLFormPropOOoTransformerContext(XMLTransformerBase &rTransformer, const OUString &rQName)
const OUString & GetTextContent() const
virtual void Characters(const OUString &rChars) override
virtual bool IsPersistent() const override
XMLFormPropValueTContext_Impl(XMLTransformerBase &rTransformer, const OUString &rQName)
virtual void StartElement(const css::uno::Reference< css::xml::sax::XAttributeList > &xAttrList) override
virtual void EndElement() override
XMLTransformerBase & GetTransformer()
Handling of tokens in XML:
bool IsXMLToken(std::u16string_view rString, enum XMLTokenEnum eToken)
compare eToken to the string
const OUString & GetXMLToken(enum XMLTokenEnum eToken)
return the OUString representation for eToken
constexpr sal_uInt16 XML_NAMESPACE_FORM
constexpr sal_uInt16 XML_NAMESPACE_OFFICE