summaryrefslogtreecommitdiff
path: root/sw/source/filter/html/htmltabw.cxx
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2018-03-20 12:19:27 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2018-03-20 13:11:12 +0100
commitc0149b1c028450411d36457593f4af3406541b00 (patch)
treecccd0d793c39d97777ada95e91b31a0b8daa3a65 /sw/source/filter/html/htmltabw.cxx
parent4b785097f1c49ead50e6a2085befcd37c800207b (diff)
sw XHTML export: fix duplicated style attribute for table border/background
By making sure only border starts the style attribute, neither of them closes it, and then closing it manually after both finished. It seems that HtmlTestTools::parseHtml() is flexible enough that it can take a HTML fragment that has multiple root elements, so no need to wrap the fragment in some <html><body>...</body><html> template for test purposes. Change-Id: I32622b17da0fc8ac02a045b3569e34a41419927d Reviewed-on: https://gerrit.libreoffice.org/51631 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.cxx11
1 files changed, 8 insertions, 3 deletions
diff --git a/sw/source/filter/html/htmltabw.cxx b/sw/source/filter/html/htmltabw.cxx
index f856af17eac4..ba95d41dbf15 100644
--- a/sw/source/filter/html/htmltabw.cxx
+++ b/sw/source/filter/html/htmltabw.cxx
@@ -410,16 +410,21 @@ void SwHTMLWrtTable::OutTableCell( SwHTMLWriter& rWrt,
if( !pBrushItem )
pBrushItem = pCell->GetBackground();
+ // Start writing the style attribute.
if( pBrushItem )
{
// output background
rWrt.OutBackground( pBrushItem, false );
if( rWrt.m_bCfgOutStyles )
- OutCSS1_TableBGStyleOpt( rWrt, *pBrushItem );
+ OutCSS1_TableBGStyleOpt( rWrt, *pBrushItem, /*bClose=*/false );
}
- rWrt.OutCSS1_TableCellBorderHack(*pBox->GetFrameFormat());
+ rWrt.OutCSS1_TableCellBorderHack(*pBox->GetFrameFormat(), /*bClose=*/false);
+
+ // Now is the time to end the style attribute.
+ if (!rWrt.m_bFirstCSS1Property)
+ rWrt.Strm().WriteChar('\"');
sal_uInt32 nNumFormat = 0;
double nValue = 0.0;
@@ -523,7 +528,7 @@ void SwHTMLWrtTable::OutTableCells( SwHTMLWriter& rWrt,
rWrt.m_bTextAttr = false;
rWrt.m_bOutOpts = true;
if( rWrt.m_bCfgOutStyles )
- OutCSS1_TableBGStyleOpt( rWrt, *pBrushItem );
+ OutCSS1_TableBGStyleOpt( rWrt, *pBrushItem, /*bClose=*/true );
}
if( text::VertOrientation::TOP==eRowVertOri || text::VertOrientation::BOTTOM==eRowVertOri )