embeddedobj/source/commonembedding/persistence.cxx |   22 +++++++--------------
 1 file changed, 8 insertions(+), 14 deletions(-)

New commits:
commit 70874f70e40f1b86fcff587ab20f69e21e9c437e
Author:     Mike Kaganski <mike.kagan...@collabora.com>
AuthorDate: Sat Mar 2 08:34:23 2024 +0100
Commit:     Mike Kaganski <mike.kagan...@collabora.com>
CommitDate: Sat Mar 2 11:17:57 2024 +0100

    Simplify a bit
    
    Change-Id: Id9895a3b6e8c09df12c9f9c3c83e1432aa5fff71
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164203
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>

diff --git a/embeddedobj/source/commonembedding/persistence.cxx 
b/embeddedobj/source/commonembedding/persistence.cxx
index 97964aff7878..80fc047b1016 100644
--- a/embeddedobj/source/commonembedding/persistence.cxx
+++ b/embeddedobj/source/commonembedding/persistence.cxx
@@ -767,7 +767,8 @@ void OCommonEmbeddedObject::SwitchDocToStorage_Impl( const 
uno::Reference< docum
 
 namespace {
 
-OUString getStringPropertyValue( const uno::Sequence<beans::PropertyValue>& 
rProps, std::u16string_view rName )
+beans::PropertyValue getStringPropertyValue(const 
uno::Sequence<beans::PropertyValue>& rProps,
+                                            const OUString& rName)
 {
     OUString aStr;
 
@@ -780,7 +781,7 @@ OUString getStringPropertyValue( const 
uno::Sequence<beans::PropertyValue>& rPro
         }
     }
 
-    return aStr;
+    return comphelper::makePropertyValue(rName, aStr);
 }
 
 }
@@ -819,19 +820,12 @@ void OCommonEmbeddedObject::StoreDocToStorage_Impl(
         if ( aFilterName.isEmpty() )
             throw io::IOException(); // TODO:
 
-        static constexpr OUString sFilterName = u"FilterName"_ustr;
-        static constexpr OUString sHierarchicalDocumentName = 
u"HierarchicalDocumentName"_ustr;
-        static constexpr OUString sDocumentBaseURL = u"DocumentBaseURL"_ustr;
-        static constexpr OUString sSourceShellID = u"SourceShellID"_ustr;
-        static constexpr OUString sDestinationShellID = 
u"DestinationShellID"_ustr;
         uno::Sequence<beans::PropertyValue> aArgs{
-            comphelper::makePropertyValue(sFilterName, aFilterName),
-            comphelper::makePropertyValue(sHierarchicalDocumentName, 
aHierarchName),
-            comphelper::makePropertyValue(sDocumentBaseURL, aBaseURL),
-            comphelper::makePropertyValue(sSourceShellID,
-                                          getStringPropertyValue(rObjArgs, 
sSourceShellID)),
-            comphelper::makePropertyValue(
-                sDestinationShellID, getStringPropertyValue(rObjArgs, 
sDestinationShellID))
+            comphelper::makePropertyValue(u"FilterName"_ustr, aFilterName),
+            comphelper::makePropertyValue(u"HierarchicalDocumentName"_ustr, 
aHierarchName),
+            comphelper::makePropertyValue(u"DocumentBaseURL"_ustr, aBaseURL),
+            getStringPropertyValue(rObjArgs, u"SourceShellID"_ustr),
+            getStringPropertyValue(rObjArgs, u"DestinationShellID"_ustr),
         };
 
         xDoc->storeToStorage( xStorage, aArgs );

Reply via email to