[REVIEW][3-5] fdo#47670 Writer HTML table border export regression
Michael Stahl
mstahl at redhat.com
Mon Apr 30 12:45:26 PDT 2012
to continue our regularly scheduled border regression fixes, here's
another one in the Writer HTML filter.
this change was done in d18feffd49f4481626417daac7984b2a7e70c3bf,
replacing the write of BORDER and BORDERCOLOR on TABLE element with a
function call that writes CSS properties on individual cells:
> @@ -433,6 +433,11 @@ void SwHTMLWrtTable::OutTableCell( SwHTMLWriter& rWrt,
> OutCSS1_TableBGStyleOpt( rWrt, *pBrushItem );
> }
>
> + ((sOut += ' ') += OOO_STRING_SVTOOLS_HTML_style ) += "=\"";
> + rWrt.Strm() << sOut.GetBuffer( );
> + OutCSS1_SvxBox( rWrt, pBox->GetFrmFmt()->GetBox() );
> + sOut = '"';
> +
> sal_uInt32 nNumFmt = 0;
> double nValue = 0.0;
> sal_Bool bNumFmt = sal_False, bValue = sal_False;
> @@ -701,19 +706,6 @@ void SwHTMLWrtTable::Write( SwHTMLWriter& rWrt, sal_Int16 eAlign,
> // Anderenfalls enthaelt nBorder naemlich nur die Breite der Umrandung,
> // die genutzt wird, wenn gar kein sheet::Border angegeben ist.
> sal_Bool bHasAnyBorders = nFrameMask || bColsHaveBorder || bRowsHaveBorder;
> - if( bCollectBorderWidth || nBorder==0 || bHasAnyBorders )
> - (((sOut += ' ' ) += OOO_STRING_SVTOOLS_HTML_O_border ) += '=')
> - += ByteString::CreateFromInt32( rWrt.ToPixel( nBorder ) );
> -
> - // BORDERCOLOR ausgeben
> -
> - if( (sal_uInt32)-1 != nBorderColor && rWrt.bCfgOutStyles && bHasAnyBorders )
> - {
> - ((sOut += ' ' ) += OOO_STRING_SVTOOLS_HTML_O_bordercolor ) += '=';
> - rWrt.Strm() << sOut.GetBuffer();
> - HTMLOutFuncs::Out_Color( rWrt.Strm(), nBorderColor, rWrt.eDestEnc );
> - sOut.Erase();
> - }
>
> // CELLPADDING ausgeben: Stammt aus Layout oder ist berechnet
> (((sOut += ' ' ) += OOO_STRING_SVTOOLS_HTML_O_cellpadding ) += '=')
i don't know why that was done or whether it is a good idea (Cedric?),
but it wasn't done properly (presumably because the strange hieroglyphs
used to document this dependency were not deciphered), and there are
still attributes written on TABLE that only make sense together with
BORDER, leading to Mozilla (but not WebKit) not rendering some of the
borders.
this commit removes the code that writes these attributes:
http://cgit.freedesktop.org/libreoffice/core/commit/?id=e1424390d45deb75a75a167e7eba36c012f32d74
(by the way, i've experimented with removing the CELLPADDING and
CELLSPACING attributes here as well but the result looks awful in Mozilla)
More information about the LibreOffice
mailing list