sax: FastAttributeList - add attribute in a specific namespace

This change is inspired by startElementNS & singleElementNS which
have namespace as first parameter to define the namespace of an
element. Some attributes of a element can be in different namespace
but until now FastAttributeList "add" method did not have a namespace
parameter. This commit adds "addNS" which accepts namespace as a
first parameter.

Change-Id: Iebf8b5e890c17f00a56923efc3506580eed070a9
This commit is contained in:
Tomaž Vajngerl
2014-03-05 18:46:37 +01:00
parent 7452e530c0
commit 693f1dee0b
2 changed files with 7 additions and 0 deletions

View File

@@ -80,6 +80,7 @@ public:
void clear();
void add( sal_Int32 nToken, const sal_Char* pValue, size_t nValueLength = 0 );
void add( sal_Int32 nToken, const OString& rValue );
void addNS( sal_Int32 nNamespaceToken, sal_Int32 nToken, const OString& rValue );
void addUnknown( const OUString& rNamespaceURL, const OString& rName, const sal_Char* pValue );
void addUnknown( const OString& rName, const sal_Char* pValue );

View File

@@ -97,6 +97,12 @@ void FastAttributeList::add( sal_Int32 nToken, const OString& rValue )
add( nToken, rValue.getStr(), rValue.getLength() );
}
void FastAttributeList::addNS( sal_Int32 nNamespaceToken, sal_Int32 nToken, const OString& rValue )
{
sal_Int32 nCombinedToken = (nNamespaceToken << 16) | nToken;
add( nCombinedToken, rValue );
}
void FastAttributeList::addUnknown( const OUString& rNamespaceURL, const OString& rName, const sal_Char* pValue )
{
maUnknownAttributes.push_back( UnknownAttribute( rNamespaceURL, rName, pValue ) );