[Libreoffice-commits] core.git: sw/qa sw/source
Miklos Vajna
vmiklos at collabora.co.uk
Tue Aug 26 01:24:02 PDT 2014
sw/qa/extras/htmlexport/htmlexport.cxx | 2 ++
sw/source/filter/html/htmlplug.cxx | 3 +++
2 files changed, 5 insertions(+)
New commits:
commit 58fc5c6a5153b68470f7de8229b76dca04267ab7
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Tue Aug 26 10:02:09 2014 +0200
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
diff --git a/sw/qa/extras/htmlexport/htmlexport.cxx b/sw/qa/extras/htmlexport/htmlexport.cxx
index 2d4f6fb..fd800ab 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 3705a07..1881b17 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;
More information about the Libreoffice-commits
mailing list