summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2018-03-20 17:48:58 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2018-03-20 19:07:28 +0100
commite2076f48aef4aff9a90ae8581d3bde7c26c69ef1 (patch)
tree39c9e63ac2158a2534d849551410cb32688a8701 /sw
parentf74d9ba2190426b974ca3d56da58919ac233a5d3 (diff)
sw XHTML export: write only CSS markup for table background
At least in the ReqIF case the bgcolor attribute is not only redundant but is also invalid. Change-Id: I9b5f00a4885d0671668b6bab986c4aee00f3597b Reviewed-on: https://gerrit.libreoffice.org/51657 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/htmlexport/htmlexport.cxx3
-rw-r--r--sw/source/filter/html/htmltabw.cxx4
2 files changed, 6 insertions, 1 deletions
diff --git a/sw/qa/extras/htmlexport/htmlexport.cxx b/sw/qa/extras/htmlexport/htmlexport.cxx
index 6a7b5e7774e4..44d4c11d5728 100644
--- a/sw/qa/extras/htmlexport/htmlexport.cxx
+++ b/sw/qa/extras/htmlexport/htmlexport.cxx
@@ -471,6 +471,9 @@ DECLARE_HTMLEXPORT_TEST(testReqIfTable, "reqif-table.xhtml")
// This failed, there were 2 style attributes, so as a best effort the
// parser took the value of the first.
CPPUNIT_ASSERT(aStyle.indexOf("border") != -1);
+
+ // The attribute was present, which is not valid in reqif-xhtml.
+ assertXPathNoAttribute(pDoc, "/html/body/div/table/tr/th", "bgcolor");
}
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/filter/html/htmltabw.cxx b/sw/source/filter/html/htmltabw.cxx
index ba95d41dbf15..60a913e1ac7a 100644
--- a/sw/source/filter/html/htmltabw.cxx
+++ b/sw/source/filter/html/htmltabw.cxx
@@ -414,7 +414,9 @@ void SwHTMLWrtTable::OutTableCell( SwHTMLWriter& rWrt,
if( pBrushItem )
{
// output background
- rWrt.OutBackground( pBrushItem, false );
+ if (!rWrt.mbReqIF)
+ // Avoid non-CSS version in the ReqIF case.
+ rWrt.OutBackground( pBrushItem, false );
if( rWrt.m_bCfgOutStyles )
OutCSS1_TableBGStyleOpt( rWrt, *pBrushItem, /*bClose=*/false );