xmloff/source/core/xmlexp.cxx |   19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

New commits:
commit 39acaf84f9b23442e1333db7d213100c6997ffe6
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Thu May 12 20:24:04 2022 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Sat May 14 08:40:00 2022 +0200

    elide temporary OUString in SvXMLExport::initialize
    
    Change-Id: Ibf1b99042ccae1fcf5fb21ab7e60bb30a9ad74f2
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134275
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx
index 7c2291156852..f8e72d6fb3f3 100644
--- a/xmloff/source/core/xmlexp.cxx
+++ b/xmloff/source/core/xmlexp.cxx
@@ -699,27 +699,26 @@ void SAL_CALL SvXMLExport::initialize( const 
uno::Sequence< uno::Any >& aArgumen
 
     uno::Reference< beans::XPropertySetInfo > xPropertySetInfo =
         mxExportInfo->getPropertySetInfo();
-    OUString sPropName(
-            "BaseURI"  );
-    if( xPropertySetInfo->hasPropertyByName(sPropName) )
+    static constexpr OUStringLiteral sBaseURI = u"BaseURI";
+    if( xPropertySetInfo->hasPropertyByName(sBaseURI) )
     {
-        uno::Any aAny = mxExportInfo->getPropertyValue(sPropName);
+        uno::Any aAny = mxExportInfo->getPropertyValue(sBaseURI);
         aAny >>= msOrigFileName;
         mpImpl->msPackageURI = msOrigFileName;
         mpImpl->SetSchemeOf( msOrigFileName );
     }
     OUString sRelPath;
-    sPropName = "StreamRelPath";
-    if( xPropertySetInfo->hasPropertyByName(sPropName) )
+    static constexpr OUStringLiteral sStreamRelPath = u"StreamRelPath";
+    if( xPropertySetInfo->hasPropertyByName(sStreamRelPath) )
     {
-        uno::Any aAny = mxExportInfo->getPropertyValue(sPropName);
+        uno::Any aAny = mxExportInfo->getPropertyValue(sStreamRelPath);
         aAny >>= sRelPath;
     }
     OUString sName;
-    sPropName = "StreamName";
-    if( xPropertySetInfo->hasPropertyByName(sPropName) )
+    static constexpr OUStringLiteral sStreamName = u"StreamName";
+    if( xPropertySetInfo->hasPropertyByName(sStreamName) )
     {
-        uno::Any aAny = mxExportInfo->getPropertyValue(sPropName);
+        uno::Any aAny = mxExportInfo->getPropertyValue(sStreamName);
         aAny >>= sName;
     }
     if( !msOrigFileName.isEmpty() && !sName.isEmpty() )

Reply via email to