[Libreoffice-commits] core.git: sw/qa sw/source

Miklos Vajna vmiklos at collabora.co.uk
Tue Mar 20 18:07:51 UTC 2018


 sw/qa/extras/htmlexport/htmlexport.cxx |    3 +++
 sw/source/filter/html/htmltabw.cxx     |    4 +++-
 2 files changed, 6 insertions(+), 1 deletion(-)

New commits:
commit e2076f48aef4aff9a90ae8581d3bde7c26c69ef1
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Tue Mar 20 17:48:58 2018 +0100

    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 at collabora.co.uk>
    Tested-by: Jenkins <ci at libreoffice.org>

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 );


More information about the Libreoffice-commits mailing list