From 70874f70e40f1b86fcff587ab20f69e21e9c437e Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Sat, 2 Mar 2024 08:34:23 +0100 Subject: [PATCH] Simplify a bit Change-Id: Id9895a3b6e8c09df12c9f9c3c83e1432aa5fff71 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164203 Tested-by: Jenkins Reviewed-by: Mike Kaganski --- .../source/commonembedding/persistence.cxx | 22 +++++++------------ 1 file 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& rProps, std::u16string_view rName ) +beans::PropertyValue getStringPropertyValue(const uno::Sequence& rProps, + const OUString& rName) { OUString aStr; @@ -780,7 +781,7 @@ OUString getStringPropertyValue( const uno::Sequence& 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 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 );