summaryrefslogtreecommitdiff
path: root/oox/source
diff options
context:
space:
mode:
authorAshod Nakashian <ashod.nakashian@collabora.co.uk>2018-02-06 17:46:28 -0500
committerAndras Timar <andras.timar@collabora.com>2018-03-25 19:58:01 +0200
commite823a7a75fdd6bb58b894b58c27e71139e55b11c (patch)
treebe28549d00ec840e28425527952e24200891b543 /oox/source
parent999771edb5cd4d22c9a4d94d9475913b8ae18dcb (diff)
oox: move putPropertiesToDocumentGrabBag to XmlFilterBase
Reviewed-on: https://gerrit.libreoffice.org/49235 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Ashod Nakashian <ashnakash@gmail.com> (cherry picked from commit e26a95360e60e0c17e70e72f36fb988bb664ddb5) Change-Id: Ic3cbabc420c7856682b889528043563622997c14
Diffstat (limited to 'oox/source')
-rw-r--r--oox/source/core/xmlfilterbase.cxx30
1 files changed, 30 insertions, 0 deletions
diff --git a/oox/source/core/xmlfilterbase.cxx b/oox/source/core/xmlfilterbase.cxx
index c4e3d670d9c2..202c91ed1c4a 100644
--- a/oox/source/core/xmlfilterbase.cxx
+++ b/oox/source/core/xmlfilterbase.cxx
@@ -234,6 +234,36 @@ void XmlFilterBase::checkDocumentProperties(const Reference<XDocumentProperties>
mbMSO2007 = true;
}
+void XmlFilterBase::putPropertiesToDocumentGrabBag(const css::uno::Reference<css::lang::XComponent>& xDstDoc,
+ const comphelper::SequenceAsHashMap& rProperties)
+{
+ try
+ {
+ uno::Reference<beans::XPropertySet> xDocProps(xDstDoc, uno::UNO_QUERY);
+ if (xDocProps.is())
+ {
+ uno::Reference<beans::XPropertySetInfo> xPropsInfo = xDocProps->getPropertySetInfo();
+
+ static const OUString aGrabBagPropName = "InteropGrabBag";
+ if (xPropsInfo.is() && xPropsInfo->hasPropertyByName(aGrabBagPropName))
+ {
+ // get existing grab bag
+ comphelper::SequenceAsHashMap aGrabBag(xDocProps->getPropertyValue(aGrabBagPropName));
+
+ // put the new items
+ aGrabBag.update(rProperties);
+
+ // put it back to the document
+ xDocProps->setPropertyValue(aGrabBagPropName, uno::Any(aGrabBag.getAsConstPropertyValueList()));
+ }
+ }
+ }
+ catch (const uno::Exception&)
+ {
+ SAL_WARN("oox","Failed to save documents grab bag");
+ }
+}
+
void XmlFilterBase::importDocumentProperties()
{
MediaDescriptor aMediaDesc( getMediaDescriptor() );