diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-08-26 18:31:39 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-08-26 18:47:17 +0200 |
commit | 35e954149d976e0e69a9f8b382fc67f5abc5eaa7 (patch) | |
tree | f767ac8c7e093c6f4e3bb5e336e0224b4720889e | |
parent | d71aff6c47d1fc40d425a4d7fc4e718c7de5acdc (diff) |
sw HTML export: don't crash on embedded object without native data
Change-Id: I26fa823b987b2edfbb1be054a5f4d03bbe95a308
-rw-r--r-- | include/sal/log-areas.dox | 1 | ||||
-rw-r--r-- | sw/source/filter/html/htmlplug.cxx | 5 |
2 files changed, 4 insertions, 2 deletions
diff --git a/include/sal/log-areas.dox b/include/sal/log-areas.dox index b5bac8a5d807..33a7999e6203 100644 --- a/include/sal/log-areas.dox +++ b/include/sal/log-areas.dox @@ -425,6 +425,7 @@ certain functionality. @li @c sw.uno - Writer UNO interfaces @li @c sw.ww8 - .doc/.docx export filter, .doc import filter (not writerfilter) @li @c sw.ww8.level2 - further info for sw.ww8 +@li @c sw.html - Writer HTML import/export @section writerfilter diff --git a/sw/source/filter/html/htmlplug.cxx b/sw/source/filter/html/htmlplug.cxx index 1881b1779366..8fdc499f848b 100644 --- a/sw/source/filter/html/htmlplug.cxx +++ b/sw/source/filter/html/htmlplug.cxx @@ -1268,14 +1268,15 @@ Writer& OutHTML_FrmFmtOLENodeGrf( Writer& rWrt, const SwFrmFmt& rFrmFmt, uno::Reference<text::XTextContent> xTextContent = SwXTextEmbeddedObject::CreateXTextEmbeddedObject(*rHTMLWrt.pDoc, const_cast<SwFrmFmt*>(&rFrmFmt)); uno::Reference<document::XEmbeddedObjectSupplier2> xEmbeddedObjectSupplier(xTextContent, uno::UNO_QUERY); uno::Reference<frame::XStorable> xStorable(xEmbeddedObjectSupplier->getEmbeddedObject(), uno::UNO_QUERY); + SAL_WARN_IF(!xStorable.is(), "sw.html", "OutHTML_FrmFmtOLENodeGrf: no embedded object"); // Figure out what is the filter name of the embedded object. uno::Reference<lang::XServiceInfo> xServiceInfo(xStorable, uno::UNO_QUERY); OUString aFilter; - if (xServiceInfo->supportsService("com.sun.star.sheet.SpreadsheetDocument")) + if (xServiceInfo.is() && xServiceInfo->supportsService("com.sun.star.sheet.SpreadsheetDocument")) aFilter = "HTML (StarCalc)"; - if (!aFilter.isEmpty()) + if (xStorable.is() && !aFilter.isEmpty()) { SvMemoryStream aStream; uno::Reference<io::XOutputStream> xOutputStream(new utl::OStreamWrapper(aStream)); |