filter/source/config/cache/filterfactory.cxx |    3 ++-
 include/svx/shapepropertynotifier.hxx        |    4 ++--
 package/source/xstor/owriteablestream.cxx    |   17 ++++++++++-------
 svx/source/unodraw/unoshape.cxx              |    3 ++-
 4 files changed, 16 insertions(+), 11 deletions(-)

New commits:
commit 18321eb3f447c9e6519e1691673677fc8a2c8117
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Tue May 24 16:23:38 2022 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Wed May 25 19:00:44 2022 +0200

    elide some OUString allocation
    
    Change-Id: Idcb296980ea498373a0fb4f8c0c584eef2c5c9f7
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134922
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/filter/source/config/cache/filterfactory.cxx 
b/filter/source/config/cache/filterfactory.cxx
index e16ac3a2678d..e083614c04a8 100644
--- a/filter/source/config/cache/filterfactory.cxx
+++ b/filter/source/config/cache/filterfactory.cxx
@@ -55,8 +55,9 @@ FilterCache& GetTheFilterCache()
 FilterFactory::FilterFactory(const css::uno::Reference< 
css::uno::XComponentContext >& rxContext)
     : m_xContext(rxContext)
 {
+    static const css::uno::Sequence<OUString> sServiceNames { 
"com.sun.star.document.FilterFactory" };
     BaseContainer::init("com.sun.star.comp.filter.config.FilterFactory"   ,
-                         { "com.sun.star.document.FilterFactory" },
+                         sServiceNames,
                         FilterCache::E_FILTER                         );
 }
 
diff --git a/include/svx/shapepropertynotifier.hxx 
b/include/svx/shapepropertynotifier.hxx
index a14fd1e597a3..bcc6c357f05a 100644
--- a/include/svx/shapepropertynotifier.hxx
+++ b/include/svx/shapepropertynotifier.hxx
@@ -64,9 +64,9 @@ namespace svx
     class SVXCORE_DLLPUBLIC PropertyValueProvider
     {
     public:
-        PropertyValueProvider( ::cppu::OWeakObject& _rContext, const char* 
_pAsciiPropertyName )
+        PropertyValueProvider( ::cppu::OWeakObject& _rContext, OUString 
_aPropertyName )
             :m_rContext( _rContext )
-            ,m_sPropertyName( OUString::createFromAscii( _pAsciiPropertyName ) 
)
+            ,m_sPropertyName( std::move( _aPropertyName ) )
         {
         }
         virtual ~PropertyValueProvider();
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
diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx
index d68732208a2d..1f7db69b180d 100644
--- a/svx/source/unodraw/unoshape.cxx
+++ b/svx/source/unodraw/unoshape.cxx
@@ -159,8 +159,9 @@ protected:
 class ShapeSizeProvider : public PropertyValueProvider
 {
 public:
+    static constexpr OUStringLiteral sSize = u"Size";
     explicit ShapeSizeProvider( SvxShape& _shape )
-        :PropertyValueProvider( _shape, "Size" )
+        :PropertyValueProvider( _shape, sSize )
     {
     }
 

Reply via email to