summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorLászló Németh <laszlo.nemeth@collabora.com>2015-04-14 22:09:13 +0200
committerLászló Németh <laszlo.nemeth@collabora.com>2015-04-15 11:04:04 +0200
commit8e4f458df490dcce9451b91974bdea52b1fef522 (patch)
treee7eb1809f0ca065770069d9db5f3d72e472ae7c2 /sw
parenteadbad607a481cc27d841ecfa07e7fd06ef7f741 (diff)
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
Diffstat (limited to 'sw')
-rw-r--r--sw/source/filter/html/htmlplug.cxx31
1 files changed, 19 insertions, 12 deletions
diff --git a/sw/source/filter/html/htmlplug.cxx b/sw/source/filter/html/htmlplug.cxx
index 96670fbf770b..213b6b08a445 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;