summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2023-04-09 13:30:58 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2023-04-09 18:16:31 +0200
commitbcf9c4dc32eccd33234511ccf3c2281bee3b0e60 (patch)
tree6921872d5b9a2469beb57e21954ad5e6aacd0cc2 /xmloff
parent7b3c45b710adcd6723167741e677695a265c5e98 (diff)
elide temporary OString in TokenMap::TokenMap
Change-Id: I6c5ae545d559f408a1ffd5f0132ab0c9a52de4dc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150166 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/core/fasttokenhandler.cxx10
1 files changed, 6 insertions, 4 deletions
diff --git a/xmloff/source/core/fasttokenhandler.cxx b/xmloff/source/core/fasttokenhandler.cxx
index 9efdf8f15d5e..5a9c9e6dcdda 100644
--- a/xmloff/source/core/fasttokenhandler.cxx
+++ b/xmloff/source/core/fasttokenhandler.cxx
@@ -55,10 +55,12 @@ TokenMap::TokenMap() :
int i = 0;
for( auto& rTokenName : maTokenNamesUtf8 )
{
- OString aUtf8Token( *ppcTokenName );
- rTokenName = uno::Sequence< sal_Int8 >( reinterpret_cast< const sal_Int8* >(
- aUtf8Token.getStr() ), aUtf8Token.getLength() );
- maTokenNames[i++] = OUString( aUtf8Token.getStr(), aUtf8Token.getLength(), RTL_TEXTENCODING_UTF8 );
+ const char* pStr = *ppcTokenName;
+ int nStrLen = strlen(pStr);
+ rTokenName = uno::Sequence< sal_Int8 >(
+ reinterpret_cast< const sal_Int8* >( pStr ), nStrLen );
+ maTokenNames[i++] = OUString( pStr,
+ nStrLen, RTL_TEXTENCODING_UTF8 );
++ppcTokenName;
}
}