summaryrefslogtreecommitdiff
path: root/sw/source/filter/html/htmltabw.cxx
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2018-04-18 18:56:05 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2018-04-18 20:13:44 +0200
commitb263c92250834993f954ed9535f67225d330861c (patch)
treef5479edba3b4827c5b1ddc2ad317dea20c3f75f3 /sw/source/filter/html/htmltabw.cxx
parent8a1a9899e05b0ebbc3ff43f2db242724c8feb18f (diff)
sw XHTML export: close <col> for tables
By switching to HtmlWriter instead of manually constructing HTML elements / attributes. Also fix a validity problem for ReqIF (transitional XHTML still allows that, so not depending on mbXHTML here). Change-Id: I4f3fef781fdbb4c72824701ad6d380cece8e6f81 Reviewed-on: https://gerrit.libreoffice.org/53120 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'sw/source/filter/html/htmltabw.cxx')
-rw-r--r--sw/source/filter/html/htmltabw.cxx17
1 files changed, 9 insertions, 8 deletions
diff --git a/sw/source/filter/html/htmltabw.cxx b/sw/source/filter/html/htmltabw.cxx
index 0b73f5687afe..28a2d416075a 100644
--- a/sw/source/filter/html/htmltabw.cxx
+++ b/sw/source/filter/html/htmltabw.cxx
@@ -340,6 +340,10 @@ void SwHTMLWrtTable::OutTableCell( SwHTMLWriter& rWrt,
nWidth = GetAbsWidth( nCol, nColSpan );
}
+ if (rWrt.mbReqIF)
+ // ReqIF implies strict XHTML: no width for <td>.
+ bOutWidth = false;
+
long nHeight = pCell->GetHeight() > 0
? GetAbsHeight( pCell->GetHeight(), nRow, nRowSpan )
: 0;
@@ -734,8 +738,8 @@ void SwHTMLWrtTable::Write( SwHTMLWriter& rWrt, sal_Int16 eAlign,
const SwWriteTableCol *pColumn = m_aCols[nCol];
- OStringBuffer sOutStr;
- sOutStr.append('<').append(rWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_col);
+ HtmlWriter html(rWrt.Strm(), rWrt.maNamespace);
+ html.start(OOO_STRING_SVTOOLS_HTML_col);
sal_uInt32 nWidth;
bool bRel;
@@ -750,14 +754,11 @@ void SwHTMLWrtTable::Write( SwHTMLWriter& rWrt, sal_Int16 eAlign,
nWidth = bRel ? GetRelWidth(nCol,1) : GetAbsWidth(nCol,1);
}
- sOutStr.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_width).
- append("=\"");
if( bRel )
- sOutStr.append(static_cast<sal_Int32>(nWidth)).append('*');
+ html.attribute(OOO_STRING_SVTOOLS_HTML_O_width, OString::number(nWidth) + "*");
else
- sOutStr.append(static_cast<sal_Int32>(SwHTMLWriter::ToPixel(nWidth,false)));
- sOutStr.append("\">");
- rWrt.Strm().WriteCharPtr( sOutStr.makeStringAndClear().getStr() );
+ html.attribute(OOO_STRING_SVTOOLS_HTML_O_width, OString::number(SwHTMLWriter::ToPixel(nWidth,false)));
+ html.end();
if( bColGroups && pColumn->bRightBorder && nCol<nCols-1 )
{