From 18321eb3f447c9e6519e1691673677fc8a2c8117 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 24 May 2022 16:23:38 +0200 Subject: elide some OUString allocation Change-Id: Idcb296980ea498373a0fb4f8c0c584eef2c5c9f7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134922 Tested-by: Jenkins Reviewed-by: Noel Grandin --- package/source/xstor/owriteablestream.cxx | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'package') diff --git a/package/source/xstor/owriteablestream.cxx b/package/source/xstor/owriteablestream.cxx index fee3ec5059b7..c9d012a61cff 100644 --- a/package/source/xstor/owriteablestream.cxx +++ b/package/source/xstor/owriteablestream.cxx @@ -1034,20 +1034,23 @@ uno::Sequence< beans::PropertyValue > OWriteStream_Impl::ReadPackageStreamProper // The "Compressed" property must be set after "MediaType" property, // since the setting of the last one can change the value of the first one - + static constexpr OUStringLiteral sMediaType = u"MediaType"; + static constexpr OUStringLiteral sCompressed = u"Compressed"; + static constexpr OUStringLiteral sSize = u"Size"; + static constexpr OUStringLiteral sEncrypted = u"Encrypted"; if ( m_nStorageType == embed::StorageFormats::OFOPXML || m_nStorageType == embed::StorageFormats::PACKAGE ) { - aResultRange[0].Name = "MediaType"; - aResultRange[1].Name = "Compressed"; - aResultRange[2].Name = "Size"; + aResultRange[0].Name = sMediaType; + aResultRange[1].Name = sCompressed; + aResultRange[2].Name = sSize; if ( m_nStorageType == embed::StorageFormats::PACKAGE ) - aResultRange[3].Name = "Encrypted"; + aResultRange[3].Name = sEncrypted; } else { - aResultRange[0].Name = "Compressed"; - aResultRange[1].Name = "Size"; + aResultRange[0].Name = sCompressed; + aResultRange[1].Name = sSize; } // TODO: may be also raw stream should be marked -- cgit