From bcf9c4dc32eccd33234511ccf3c2281bee3b0e60 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Sun, 9 Apr 2023 13:30:58 +0200 Subject: 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 --- xmloff/source/core/fasttokenhandler.cxx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'xmloff/source') 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; } } -- cgit