summaryrefslogtreecommitdiffstats
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-08-26 10:02:09 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-08-26 10:13:45 +0200
commit58fc5c6a5153b68470f7de8229b76dca04267ab7 (patch)
tree72bc776c78f58ccd2ef300fbf2f685aa539056ef /sw
parentfix typo: Mesage -> Message (diff)
downloadcore-58fc5c6a5153b68470f7de8229b76dca04267ab7.tar.gz
core-58fc5c6a5153b68470f7de8229b76dca04267ab7.zip
sw HTML export: avoid <table> directly inside <p>
Wrapping the embedded object output in a <span> at least makes the parser errors go away. Change-Id: I010d0257b5386a36f40103e3531737db6937ce85
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/htmlexport/htmlexport.cxx2
-rw-r--r--sw/source/filter/html/htmlplug.cxx3
2 files changed, 5 insertions, 0 deletions
diff --git a/sw/qa/extras/htmlexport/htmlexport.cxx b/sw/qa/extras/htmlexport/htmlexport.cxx
index 2d4f6fbdc824..fd800ab2096f 100644
--- a/sw/qa/extras/htmlexport/htmlexport.cxx
+++ b/sw/qa/extras/htmlexport/htmlexport.cxx
@@ -145,6 +145,8 @@ DECLARE_HTMLEXPORT_TEST(testSkipImageEmbedded, "skipimage-embedded.doc")
assertXPath(pDoc, "//table", 1);
// This was 2, the HTML header was in the document two times.
assertXPath(pDoc, "//meta[@name='generator']", 1);
+ // This was 0, <table> was directly under <p>, which caused errors in the parser.
+ assertXPath(pDoc, "//span/table", 1);
}
#endif
diff --git a/sw/source/filter/html/htmlplug.cxx b/sw/source/filter/html/htmlplug.cxx
index 3705a0785e7f..1881b1779366 100644
--- a/sw/source/filter/html/htmlplug.cxx
+++ b/sw/source/filter/html/htmlplug.cxx
@@ -1285,7 +1285,10 @@ Writer& OutHTML_FrmFmtOLENodeGrf( Writer& rWrt, const SwFrmFmt& rFrmFmt,
aMediaDescriptor["OutputStream"] <<= xOutputStream;
xStorable->storeToURL("private:stream", aMediaDescriptor.getAsConstPropertyValueList());
OString aData(reinterpret_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);
}
return rWrt;