summaryrefslogtreecommitdiff
path: root/embeddedobj
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2024-03-02 08:34:23 +0100
committerMike Kaganski <mike.kaganski@collabora.com>2024-03-02 11:17:57 +0100
commit70874f70e40f1b86fcff587ab20f69e21e9c437e (patch)
tree241cda507ae4fbe8b1c889da337c2a2ecb25af5c /embeddedobj
parentd8079e980e3e5947df9430089444a5f31e0c5de6 (diff)
Simplify a bit
Change-Id: Id9895a3b6e8c09df12c9f9c3c83e1432aa5fff71 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164203 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'embeddedobj')
-rw-r--r--embeddedobj/source/commonembedding/persistence.cxx22
1 files changed, 8 insertions, 14 deletions
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 );