[Libreoffice-commits] core.git: include/sal sw/source

Miklos Vajna vmiklos at collabora.co.uk
Tue Aug 26 09:47:46 PDT 2014


 include/sal/log-areas.dox          |    1 +
 sw/source/filter/html/htmlplug.cxx |    5 +++--
 2 files changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 35e954149d976e0e69a9f8b382fc67f5abc5eaa7
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Tue Aug 26 18:31:39 2014 +0200

    sw HTML export: don't crash on embedded object without native data
    
    Change-Id: I26fa823b987b2edfbb1be054a5f4d03bbe95a308

diff --git a/include/sal/log-areas.dox b/include/sal/log-areas.dox
index b5bac8a..33a7999 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
+ at 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 1881b17..8fdc499 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));


More information about the Libreoffice-commits mailing list