From ad1557f5d775739230e0e2252c293948977b42a0 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Thu, 30 Sep 2021 13:54:26 +0200 Subject: A more lightweight O[U]StringConcatenation ...compared to a full-blown O[U]String, for temporary objects holding an O[U]StringConcat result that can then be used as a std::[u16]string_view. It's instructive to see how some invocations of operator ==, operator !=, and O[U]StringBuffer::insert with an O[U]StringConcat argument required implicit materialization of an O[U]String temporary, and how that expensive operation has now been made explicit with the explicit O[U]StringConcatenation ctor. (The additional operator == and operator != overloads are necessary because the overloads taking two std::[u16]string_view parameters wouldn't even be found here with ADL. And the OUString-related ones would cause ambiguities in at least sal/qa/rtl/strings/test_oustring_stringliterals.cxx built with RTL_STRING_UNITTEST, so have simply been disabled for that special test-code case.) Change-Id: Id29799fa8da21a09ff9794cbc7cc9b366e6803b8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122890 Tested-by: Jenkins Reviewed-by: Noel Grandin Reviewed-by: Stephan Bergmann --- xmlsecurity/source/helper/documentsignaturehelper.cxx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'xmlsecurity') diff --git a/xmlsecurity/source/helper/documentsignaturehelper.cxx b/xmlsecurity/source/helper/documentsignaturehelper.cxx index e05e1ee1aac2..5852d16afd39 100644 --- a/xmlsecurity/source/helper/documentsignaturehelper.cxx +++ b/xmlsecurity/source/helper/documentsignaturehelper.cxx @@ -199,7 +199,7 @@ DocumentSignatureHelper::CreateElementList( { Reference < css::embed::XStorage > xSubStore = rxStore->openStorageElement( aSubStorageName, css::embed::ElementModes::READ ); ImplFillElementList( - aElements, xSubStore, OUString(aSubStorageName+aSep), true, mode); + aElements, xSubStore, OUStringConcatenation(aSubStorageName+aSep), true, mode); } catch(css::io::IOException& ) { @@ -211,7 +211,7 @@ DocumentSignatureHelper::CreateElementList( { Reference < css::embed::XStorage > xSubStore = rxStore->openStorageElement( aSubStorageName, css::embed::ElementModes::READ ); ImplFillElementList( - aElements, xSubStore, OUString(aSubStorageName+aSep), true, mode); + aElements, xSubStore, OUStringConcatenation(aSubStorageName+aSep), true, mode); xSubStore.clear(); // Object folders... @@ -222,7 +222,7 @@ DocumentSignatureHelper::CreateElementList( { Reference < css::embed::XStorage > xTmpSubStore = rxStore->openStorageElement( rName, css::embed::ElementModes::READ ); ImplFillElementList( - aElements, xTmpSubStore, OUString(rName+aSep), true, mode); + aElements, xTmpSubStore, OUStringConcatenation(rName+aSep), true, mode); } } } @@ -246,7 +246,7 @@ DocumentSignatureHelper::CreateElementList( { Reference < css::embed::XStorage > xSubStore = rxStore->openStorageElement( aSubStorageName, css::embed::ElementModes::READ ); ImplFillElementList( - aElements, xSubStore, OUString(aSubStorageName+aSep), true, mode); + aElements, xSubStore, OUStringConcatenation(aSubStorageName+aSep), true, mode); } catch( css::io::IOException& ) { @@ -259,7 +259,7 @@ DocumentSignatureHelper::CreateElementList( { Reference < css::embed::XStorage > xSubStore = rxStore->openStorageElement( aSubStorageName, css::embed::ElementModes::READ ); ImplFillElementList( - aElements, xSubStore, OUString(aSubStorageName+aSep), true, mode); + aElements, xSubStore, OUStringConcatenation(aSubStorageName+aSep), true, mode); } catch( css::io::IOException& ) { @@ -271,7 +271,7 @@ DocumentSignatureHelper::CreateElementList( { Reference < css::embed::XStorage > xSubStore = rxStore->openStorageElement( aSubStorageName, css::embed::ElementModes::READ ); ImplFillElementList( - aElements, xSubStore, OUString(aSubStorageName+aSep), true, mode); + aElements, xSubStore, OUStringConcatenation(aSubStorageName+aSep), true, mode); } catch( css::io::IOException& ) { @@ -310,7 +310,7 @@ void DocumentSignatureHelper::AppendContentTypes(const uno::Reference