Kaydet (Commit) f8288865 authored tarafından Ashod Nakashian's avatar Ashod Nakashian Kaydeden (comit) Caolán McNamara

oox: don't segfault when failing to open a custom fragment

Change-Id: Ie05d1feea2e930b117b3754c6e0db86bdb85bc61
Reviewed-on: https://gerrit.libreoffice.org/51681Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst f3e8d0fb
...@@ -1118,6 +1118,8 @@ void XmlFilterBase::exportCustomFragments() ...@@ -1118,6 +1118,8 @@ void XmlFilterBase::exportCustomFragments()
addRelation(customFragmentTypes[j], customFragmentTargets[j]); addRelation(customFragmentTypes[j], customFragmentTargets[j]);
const OUString aFilename = customFragmentTargets[j]; const OUString aFilename = customFragmentTargets[j];
Reference<XOutputStream> xOutStream = openOutputStream(aFilename); Reference<XOutputStream> xOutStream = openOutputStream(aFilename);
if (xOutStream.is())
{
xOutStream->writeBytes(customFragments[j]); xOutStream->writeBytes(customFragments[j]);
uno::Reference<XPropertySet> xProps(xOutStream, uno::UNO_QUERY); uno::Reference<XPropertySet> xProps(xOutStream, uno::UNO_QUERY);
if (xProps.is()) if (xProps.is())
...@@ -1127,6 +1129,7 @@ void XmlFilterBase::exportCustomFragments() ...@@ -1127,6 +1129,7 @@ void XmlFilterBase::exportCustomFragments()
xProps->setPropertyValue("MediaType", uno::makeAny(aContentType)); xProps->setPropertyValue("MediaType", uno::makeAny(aContentType));
} }
} }
}
} }
} // namespace core } // namespace core
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment