28#include <osl/diagnose.h>
36 const OUString& rQName,
37 bool bCreateControl ) :
41 m_bCreateControl( bCreateControl )
46 const Reference< XAttributeList >& rAttrList )
51 OSL_ENSURE( pActions,
"go no actions" );
53 Reference< XAttributeList > xAttrList( rAttrList );
60 Reference< XAttributeList > xControlAttrList( pControlMutableAttrList );
62 sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
63 for( sal_Int16
i=0;
i < nAttrCount;
i++ )
65 const OUString& rAttrName = xAttrList->getNameByIndex(
i );
70 XMLTransformerActions::key_type aKey( nPrefix, aLocalName );
71 XMLTransformerActions::const_iterator aIter =
72 pActions->find( aKey );
73 if( aIter != pActions->end() )
75 if( !pMutableAttrList )
79 xAttrList = pMutableAttrList;
81 const OUString& rAttrValue = xAttrList->getValueByIndex(
i );
82 switch( (*aIter).second.m_nActionType )
89 pMutableAttrList->RemoveAttributeByIndex(
i );
96 OUString aAttrValue( rAttrValue );
97 sal_uInt16 nValPrefix =
98 static_cast<sal_uInt16
>( (*aIter).second.m_nParam2 );
101 OUString aNewAttrQName(
103 (*aIter).second.GetQNamePrefixFromParam1(),
105 (*aIter).second.GetQNameTokenFromParam1()) ) );
110 pMutableAttrList->RemoveAttributeByIndex(
i );
116 pMutableAttrList->RenameAttributeByIndex(
i,
118 pMutableAttrList->SetValueByIndex(
i, aAttrValue );
124 OUString aAttrValue( rAttrValue );
126 static_cast< bool >((*aIter).second.m_nParam1)) )
127 pMutableAttrList->SetValueByIndex(
i, aAttrValue );
131 OSL_ENSURE(
false,
"unknown action" );
@ OASIS_FORM_CONTROL_ACTIONS
sal_uInt16 GetKeyByAttrName(const OUString &rAttrName, OUString *pPrefix, OUString *pLocalName, OUString *pNamespace) const
OUString const m_aElemQName
virtual void EndElement() override
XMLControlOASISTransformerContext(XMLTransformerBase &rTransformer, const OUString &rQName, bool bCreateControl)
bool const m_bCreateControl
virtual void StartElement(const css::uno::Reference< css::xml::sax::XAttributeList > &xAttrList) override
void AddAttribute(const OUString &sName, const OUString &sValue)
XMLTransformerBase & GetTransformer()
virtual void StartElement(const css::uno::Reference< css::xml::sax::XAttributeList > &xAttrList)
virtual void EndElement()
Handling of tokens in XML:
const OUString & GetXMLToken(enum XMLTokenEnum eToken)
return the OUString representation for eToken
constexpr sal_uInt16 XML_NAMESPACE_FORM