Kaydet (Commit) 58fc5c6a authored tarafından Miklos Vajna's avatar Miklos Vajna

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
üst df1b3092
...@@ -145,6 +145,8 @@ DECLARE_HTMLEXPORT_TEST(testSkipImageEmbedded, "skipimage-embedded.doc") ...@@ -145,6 +145,8 @@ DECLARE_HTMLEXPORT_TEST(testSkipImageEmbedded, "skipimage-embedded.doc")
assertXPath(pDoc, "//table", 1); assertXPath(pDoc, "//table", 1);
// This was 2, the HTML header was in the document two times. // This was 2, the HTML header was in the document two times.
assertXPath(pDoc, "//meta[@name='generator']", 1); 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 #endif
......
...@@ -1285,7 +1285,10 @@ Writer& OutHTML_FrmFmtOLENodeGrf( Writer& rWrt, const SwFrmFmt& rFrmFmt, ...@@ -1285,7 +1285,10 @@ Writer& OutHTML_FrmFmtOLENodeGrf( Writer& rWrt, const SwFrmFmt& rFrmFmt,
aMediaDescriptor["OutputStream"] <<= xOutputStream; aMediaDescriptor["OutputStream"] <<= xOutputStream;
xStorable->storeToURL("private:stream", aMediaDescriptor.getAsConstPropertyValueList()); xStorable->storeToURL("private:stream", aMediaDescriptor.getAsConstPropertyValueList());
OString aData(reinterpret_cast<const char*>(aStream.GetData()), aStream.GetSize()); 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()); rWrt.Strm().WriteCharPtr(aData.getStr());
HTMLOutFuncs::Out_AsciiTag(rWrt.Strm(), OOO_STRING_SVTOOLS_HTML_span, false);
} }
return rWrt; return rWrt;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment