diff options
author | Mohammed Abdul Azeem <azeemmysore@gmail.com> | 2017-06-29 13:49:18 +0530 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2017-06-29 17:50:12 +0200 |
commit | b3b6ce3febbf3073dd9e16d908137e41ab473dca (patch) | |
tree | bb1bd13c01468ab103e0427a9c51ad8b1b6b60c8 /sax/source | |
parent | 8a828ee75d4f5d0fd2abcd7d74130e57e5c3bd71 (diff) |
Added find function to FastAttributeList:
It returns a FastAttributeIter, which can be used to
obtain value in different formats directly. Also, avoids
one unnecessary iteration.
Change-Id: Ic28e0177100738bbd71a3a89634cae9f1f7ee996
Reviewed-on: https://gerrit.libreoffice.org/39380
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'sax/source')
-rw-r--r-- | sax/source/tools/fastattribs.cxx | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sax/source/tools/fastattribs.cxx b/sax/source/tools/fastattribs.cxx index 985293ff0caf..564f71d27b81 100644 --- a/sax/source/tools/fastattribs.cxx +++ b/sax/source/tools/fastattribs.cxx @@ -230,6 +230,14 @@ Sequence< FastAttribute > FastAttributeList::getFastAttributes( ) return aSeq; } +const FastAttributeList::FastAttributeIter FastAttributeList::find( sal_Int32 nToken ) const +{ + for (size_t i = 0; i < maAttributeTokens.size(); ++i) + if( maAttributeTokens[i] == nToken ) + return FastAttributeIter(*this, i); + return end(); +} + sal_Int32 FastTokenHandlerBase::getTokenFromChars( const css::uno::Reference< css::xml::sax::XFastTokenHandler > &xTokenHandler, FastTokenHandlerBase *pTokenHandler, |