diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-05-10 14:09:04 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-05-11 09:24:42 +0200 |
commit | 3322e500f48794d3569c27f73cc5f3bafb5f2397 (patch) | |
tree | 3dc405729d94e9f27020a695b9e55e6efd91657a /sfx2 | |
parent | 078e65cac18fec8729ed8087233caa1655a02d02 (diff) |
avoid some OUString construction on some hot paths
Change-Id: I098b017d22b7a4502998a0901ddcfca08a57ee43
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134115
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/doc/docfile.cxx | 6 | ||||
-rw-r--r-- | sfx2/source/doc/sfxbasemodel.cxx | 27 |
2 files changed, 22 insertions, 11 deletions
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx index 131fbf30a4c4..aae5a8710bb8 100644 --- a/sfx2/source/doc/docfile.cxx +++ b/sfx2/source/doc/docfile.cxx @@ -3447,9 +3447,11 @@ SfxMedium::SfxMedium( const uno::Sequence<beans::PropertyValue>& aArgs ) : void SfxMedium::SetArgs(const uno::Sequence<beans::PropertyValue>& rArgs) { + static constexpr OUStringLiteral sStream(u"Stream"); + static constexpr OUStringLiteral sInputStream(u"InputStream"); comphelper::SequenceAsHashMap aArgsMap(rArgs); - aArgsMap.erase("Stream"); - aArgsMap.erase("InputStream"); + aArgsMap.erase(sStream); + aArgsMap.erase(sInputStream); pImpl->m_aArgs = aArgsMap.getAsConstPropertyValueList(); } diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index 062329033264..c0f677ad5da6 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -879,15 +879,24 @@ sal_Bool SAL_CALL SfxBaseModel::attachResource( const OUString& pObjectShell->SetMacroCallsSeenWhileLoading(); } - aArgs.remove( "WinExtent" ); - aArgs.remove( "BreakMacroSignature" ); - aArgs.remove( "MacroEventRead" ); - aArgs.remove( "Stream" ); - aArgs.remove( "InputStream" ); - aArgs.remove( "URL" ); - aArgs.remove( "Frame" ); - aArgs.remove( "Password" ); - aArgs.remove( "EncryptionData" ); + static constexpr OUStringLiteral sWinExtent = u"WinExtent"; + static constexpr OUStringLiteral sBreakMacroSignature = u"BreakMacroSignature"; + static constexpr OUStringLiteral sMacroEventRead = u"MacroEventRead"; + static constexpr OUStringLiteral sStream = u"Stream"; + static constexpr OUStringLiteral sInputStream = u"InputStream"; + static constexpr OUStringLiteral sURL = u"URL"; + static constexpr OUStringLiteral sFrame = u"Frame"; + static constexpr OUStringLiteral sPassword = u"Password"; + static constexpr OUStringLiteral sEncryptionData = u"EncryptionData"; + aArgs.remove( sWinExtent ); + aArgs.remove( sBreakMacroSignature ); + aArgs.remove( sMacroEventRead ); + aArgs.remove( sStream ); + aArgs.remove( sInputStream ); + aArgs.remove( sURL ); + aArgs.remove( sFrame ); + aArgs.remove( sPassword ); + aArgs.remove( sEncryptionData ); // TODO/LATER: all the parameters that are accepted by ItemSet of the DocShell must be removed here |