starmath/source/unomodel.cxx                      |    7 +++----
 svx/source/customshapes/EnhancedCustomShape2d.cxx |   15 ++++++++++-----
 ucbhelper/source/client/content.cxx               |    3 ++-
 3 files changed, 15 insertions(+), 10 deletions(-)

New commits:
commit 0a1bfe1e3fb298d7d7e2cfd85887d430cce59238
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Mon May 23 11:04:19 2022 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Mon May 23 15:25:42 2022 +0200

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

diff --git a/starmath/source/unomodel.cxx b/starmath/source/unomodel.cxx
index 8b0b8817f588..b61fae230441 100644
--- a/starmath/source/unomodel.cxx
+++ b/starmath/source/unomodel.cxx
@@ -389,10 +389,9 @@ sal_Bool SmModel::supportsService(const OUString& 
rServiceName)
 
 uno::Sequence< OUString > SmModel::getSupportedServiceNames()
 {
-    return uno::Sequence<OUString>{
-        "com.sun.star.document.OfficeDocument",
-        "com.sun.star.formula.FormulaProperties"
-    };
+    static constexpr OUStringLiteral service1 = 
u"com.sun.star.document.OfficeDocument";
+    static constexpr OUStringLiteral service2 = 
u"com.sun.star.formula.FormulaProperties";
+    return uno::Sequence<OUString>{ service1, service2 };
 }
 
 void SmModel::_setPropertyValues(const PropertyMapEntry** ppEntries, const 
Any* pValues)
diff --git a/svx/source/customshapes/EnhancedCustomShape2d.cxx 
b/svx/source/customshapes/EnhancedCustomShape2d.cxx
index 41cec42df4a1..87c081628993 100644
--- a/svx/source/customshapes/EnhancedCustomShape2d.cxx
+++ b/svx/source/customshapes/EnhancedCustomShape2d.cxx
@@ -541,13 +541,15 @@ bool 
EnhancedCustomShape2d::ConvertSequenceToEnhancedCustomShape2dHandle(
 void EnhancedCustomShape2d::ApplyShapeAttributes( const 
SdrCustomShapeGeometryItem& rGeometryItem )
 {
     // AdjustmentValues
-    const Any* pAny = 
const_cast<SdrCustomShapeGeometryItem&>(rGeometryItem).GetPropertyValueByName( 
"AdjustmentValues" );
+    static constexpr OUStringLiteral sAdjustmentValues( u"AdjustmentValues" );
+    const Any* pAny = 
const_cast<SdrCustomShapeGeometryItem&>(rGeometryItem).GetPropertyValueByName( 
sAdjustmentValues );
     if ( pAny )
         *pAny >>= seqAdjustmentValues;
 
 
     // Coordsize
-    const Any* pViewBox = 
const_cast<SdrCustomShapeGeometryItem&>(rGeometryItem).GetPropertyValueByName( 
"ViewBox" );
+    static constexpr OUStringLiteral sViewBox( u"ViewBox" );
+    const Any* pViewBox = 
const_cast<SdrCustomShapeGeometryItem&>(rGeometryItem).GetPropertyValueByName( 
sViewBox );
     css::awt::Rectangle aViewBox;
     if ( pViewBox && (*pViewBox >>= aViewBox ) )
     {
@@ -745,7 +747,8 @@ 
EnhancedCustomShape2d::EnhancedCustomShape2d(SdrObjCustomShape& rSdrObjCustomSha
 
     OUString sShapeType;
     const SdrCustomShapeGeometryItem& 
rGeometryItem(mrSdrObjCustomShape.GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY 
));
-    const Any* pAny = rGeometryItem.GetPropertyValueByName( "Type" );
+    static constexpr OUStringLiteral sType = u"Type";
+    const Any* pAny = rGeometryItem.GetPropertyValueByName( sType );
     if ( pAny ) {
         *pAny >>= sShapeType;
         bOOXMLShape = sShapeType.startsWith("ooxml-");
@@ -753,10 +756,12 @@ 
EnhancedCustomShape2d::EnhancedCustomShape2d(SdrObjCustomShape& rSdrObjCustomSha
     }
     eSpType = EnhancedCustomShapeTypeNames::Get( sShapeType );
 
-    pAny = rGeometryItem.GetPropertyValueByName( "MirroredX" );
+    static constexpr OUStringLiteral sMirroredX = u"MirroredX";
+    static constexpr OUStringLiteral sMirroredY = u"MirroredY";
+    pAny = rGeometryItem.GetPropertyValueByName( sMirroredX );
     if ( pAny )
         *pAny >>= bFlipH;
-    pAny = rGeometryItem.GetPropertyValueByName( "MirroredY" );
+    pAny = rGeometryItem.GetPropertyValueByName( sMirroredY );
     if ( pAny )
         *pAny >>= bFlipV;
 
diff --git a/ucbhelper/source/client/content.cxx 
b/ucbhelper/source/client/content.cxx
index 948c4848c6f4..7f3268c41754 100644
--- a/ucbhelper/source/client/content.cxx
+++ b/ucbhelper/source/client/content.cxx
@@ -416,8 +416,9 @@ Reference< XCommandInfo > Content::getCommands()
 
 Reference< XPropertySetInfo > Content::getProperties()
 {
+    static constexpr OUStringLiteral sgetPropertySetInfo = 
u"getPropertySetInfo";
     Command aCommand;
-    aCommand.Name     = "getPropertySetInfo";
+    aCommand.Name     = sgetPropertySetInfo;
     aCommand.Handle   = -1; // n/a
     aCommand.Argument = Any();
 

Reply via email to