28#include <osl/diagnose.h>
35 std::u16string_view rValue )
42 sal_Int32 nLen = rValue.size();
45 while(
nPos < nLen &&
' ' == rValue[
nPos] )
48 if(
nPos < nLen &&
'-' == rValue[
nPos] )
55 bool bOverflow =
false;
57 '0' <= rValue[
nPos] &&
61 nVal += (rValue[
nPos] -
'0');
62 bOverflow |= (nVal > (bNeg ? 2147483648UL : 2147483647UL));
67 while(
nPos < nLen &&
' ' == rValue[
nPos] )
75 else if( nVal > (bNeg ? 32768UL : 32767UL) )
86 const OUString& rQName,
100 const Reference< XAttributeList >& rAttrList )
105 OSL_ENSURE( pActions,
"go no actions" );
109 Reference< XAttributeList > xAttrList( pMutableAttrList );
111 sal_Int16 nValueTypeAttr = -1;
113 bool bIsVoid =
false;
114 sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
115 for( sal_Int16
i=0;
i < nAttrCount;
i++ )
117 const OUString& rAttrName = xAttrList->getNameByIndex(
i );
122 XMLTransformerActions::key_type aKey( nPrefix, aLocalName );
123 XMLTransformerActions::const_iterator aIter =
124 pActions->find( aKey );
125 if( aIter != pActions->end() )
127 const OUString& rAttrValue = xAttrList->getValueByIndex(
i );
128 switch( (*aIter).second.m_nActionType )
139 pMutableAttrList->SetValueByIndex(
i,
145 OUString aNewAttrQName(
147 (*aIter).second.GetQNamePrefixFromParam1(),
149 (*aIter).second.GetQNameTokenFromParam1()) ) );
150 pMutableAttrList->RenameAttributeByIndex(
i, aNewAttrQName );
156 pMutableAttrList->RemoveAttributeByIndex(
i );
161 OSL_ENSURE(
false,
"unknown action" );
168 OUString aNewAttrQName(
172 pMutableAttrList->AddAttribute( aNewAttrQName,
176 if( nValueTypeAttr != -1 )
177 pMutableAttrList->SetValueByIndex( nValueTypeAttr,
186 xAttrList = pMutableAttrList;
189 OUString aNewAttrQName(
192 pMutableAttrList->AddAttribute( aNewAttrQName,
196 OUString aValueElemQName(
@ OASIS_FORM_PROP_ACTIONS
sal_uInt16 GetKeyByAttrName(const OUString &rAttrName, OUString *pPrefix, OUString *pLocalName, OUString *pNamespace) const
XMLFormPropOASISTransformerContext(XMLTransformerBase &rTransformer, const OUString &rQName, ::xmloff::token::XMLTokenEnum eLocalName)
bool const m_bIsListValue
virtual void EndElement() override
::xmloff::token::XMLTokenEnum GetValueType(std::u16string_view rValue)
virtual void StartElement(const css::uno::Reference< css::xml::sax::XAttributeList > &xAttrList) override
virtual ~XMLFormPropOASISTransformerContext() override
virtual void EndElement() override
virtual void StartElement(const css::uno::Reference< css::xml::sax::XAttributeList > &xAttrList) override
XMLTransformerBase & GetTransformer()
Handling of tokens in XML:
XMLTokenEnum
The enumeration of all XML tokens.
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