diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2022-03-12 18:52:17 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2022-03-12 19:44:26 +0100 |
commit | de81df1f3f9b7660db450c638925f90adf9c026b (patch) | |
tree | cf72e7a09a39e9a910c85dc0d3e88fd10c4d03b4 /sax | |
parent | 128d3b454467e34538903b2eab45e866f976b314 (diff) |
Introduce FastAttributeList::add(NS) taking std::u16string_view
... and simplify some places removing explicit conversions from
OUString to OString.
Change-Id: I4cdf9f3ee3101b3d00a0bbba53a983ed3bebce4f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131445
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sax')
-rw-r--r-- | sax/source/tools/fastattribs.cxx | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sax/source/tools/fastattribs.cxx b/sax/source/tools/fastattribs.cxx index 9bf4a3f4ae6e..1af7821cba24 100644 --- a/sax/source/tools/fastattribs.cxx +++ b/sax/source/tools/fastattribs.cxx @@ -126,12 +126,24 @@ void FastAttributeList::add( sal_Int32 nToken, const OString& rValue ) add( nToken, rValue.getStr(), rValue.getLength() ); } +void FastAttributeList::add(sal_Int32 nToken, std::u16string_view sValue) +{ + add(nToken, OUStringToOString(sValue, RTL_TEXTENCODING_UTF8)); +} + void FastAttributeList::addNS( sal_Int32 nNamespaceToken, sal_Int32 nToken, const OString& rValue ) { sal_Int32 nCombinedToken = (nNamespaceToken << 16) | nToken; add( nCombinedToken, rValue ); } +void FastAttributeList::addNS(sal_Int32 nNamespaceToken, sal_Int32 nToken, + std::u16string_view sValue) +{ + sal_Int32 nCombinedToken = (nNamespaceToken << 16) | nToken; + add(nCombinedToken, sValue); +} + void FastAttributeList::addUnknown( const OUString& rNamespaceURL, const OString& rName, const OString& value ) { maUnknownAttributes.emplace_back( rNamespaceURL, rName, value ); |