sw/source/filter/html/htmlplug.cxx |   31 +++++++++++++++++++------------
 1 file changed, 19 insertions(+), 12 deletions(-)

New commits:
commit 8e4f458df490dcce9451b91974bdea52b1fef522
Author: László Németh <laszlo.nem...@collabora.com>
Date:   Tue Apr 14 22:09:13 2015 +0200

    Uncaught exception at HTML export of embedded objects
    
    Using SkipImages FilterOptions with HTML export, LibreOffice
    tries to export the content of the embedded objects, too, but
    it seems, we get only exceptions for a simple test document, too.
    
    Change-Id: I756ca79b183c0ee2f2be712df799a97612f9475b

diff --git a/sw/source/filter/html/htmlplug.cxx 
b/sw/source/filter/html/htmlplug.cxx
index 96670fb..213b6b0 100644
--- a/sw/source/filter/html/htmlplug.cxx
+++ b/sw/source/filter/html/htmlplug.cxx
@@ -1283,18 +1283,25 @@ Writer& OutHTML_FrmFmtOLENodeGrf( Writer& rWrt, const 
SwFrmFmt& rFrmFmt,
 
         if (xStorable.is() && !aFilter.isEmpty())
         {
-            SvMemoryStream aStream;
-            uno::Reference<io::XOutputStream> xOutputStream(new 
utl::OStreamWrapper(aStream));
-            utl::MediaDescriptor aMediaDescriptor;
-            aMediaDescriptor["FilterName"] <<= aFilter;
-            aMediaDescriptor["FilterOptions"] <<= OUString("SkipHeaderFooter");
-            aMediaDescriptor["OutputStream"] <<= xOutputStream;
-            xStorable->storeToURL("private:stream", 
aMediaDescriptor.getAsConstPropertyValueList());
-            OString aData(static_cast<const char*>(aStream.GetData()), 
aStream.GetSize());
-            // Wrap output in a <span> tag to avoid 'HTML parser error: 
Unexpected end tag: p'
-            HTMLOutFuncs::Out_AsciiTag(rWrt.Strm(), 
OOO_STRING_SVTOOLS_HTML_span);
-            rWrt.Strm().WriteCharPtr(aData.getStr());
-            HTMLOutFuncs::Out_AsciiTag(rWrt.Strm(), 
OOO_STRING_SVTOOLS_HTML_span, false);
+            try
+            {
+                // FIXME: exception for the simplest test document, too
+                SvMemoryStream aStream;
+                uno::Reference<io::XOutputStream> xOutputStream(new 
utl::OStreamWrapper(aStream));
+                utl::MediaDescriptor aMediaDescriptor;
+                aMediaDescriptor["FilterName"] <<= aFilter;
+                aMediaDescriptor["FilterOptions"] <<= 
OUString("SkipHeaderFooter");
+                aMediaDescriptor["OutputStream"] <<= xOutputStream;
+                xStorable->storeToURL("private:stream", 
aMediaDescriptor.getAsConstPropertyValueList());
+                OString aData(static_cast<const char*>(aStream.GetData()), 
aStream.GetSize());
+                // Wrap output in a <span> tag to avoid 'HTML parser error: 
Unexpected end tag: p'
+                HTMLOutFuncs::Out_AsciiTag(rWrt.Strm(), 
OOO_STRING_SVTOOLS_HTML_span);
+                rWrt.Strm().WriteCharPtr(aData.getStr());
+                HTMLOutFuncs::Out_AsciiTag(rWrt.Strm(), 
OOO_STRING_SVTOOLS_HTML_span, false);
+            }
+            catch ( uno::Exception& )
+            {
+            }
         }
 
         return rWrt;
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to