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

Miklos Vajna vmiklos at collabora.co.uk
Tue Mar 13 08:09:54 UTC 2018


 sw/qa/extras/htmlexport/data/reqif-p.xhtml |    1 +
 sw/qa/extras/htmlexport/htmlexport.cxx     |    3 +++
 sw/source/filter/html/css1atr.cxx          |    4 ++--
 sw/source/filter/html/htmlatr.cxx          |    2 +-
 4 files changed, 7 insertions(+), 3 deletions(-)

New commits:
commit 3a4b0b4a86258f56e699c324fb2282c49319f92f
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Mon Mar 12 17:54:34 2018 +0100

    sw XHTML export: avoid <u> for underline in ReqIF mode
    
    The spec insists on the CSS equivalent (while <b> and <i> is OK).
    
    Change-Id: Ied3ebc896403ab85f544b0071e841e35eafdeb64
    Reviewed-on: https://gerrit.libreoffice.org/51158
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
    Tested-by: Jenkins <ci at libreoffice.org>

diff --git a/sw/qa/extras/htmlexport/data/reqif-p.xhtml b/sw/qa/extras/htmlexport/data/reqif-p.xhtml
index 3db2325467a2..e5484ee79483 100644
--- a/sw/qa/extras/htmlexport/data/reqif-p.xhtml
+++ b/sw/qa/extras/htmlexport/data/reqif-p.xhtml
@@ -1,3 +1,4 @@
 <reqif-xhtml:p>aaa<reqif-xhtml:br/>bbb</reqif-xhtml:p>
 <reqif-xhtml:table><reqif-xhtml:tr><reqif-xhtml:td>in table</reqif-xhtml:tr></reqif-xhtml:tr></reqif-xhtml:table>
 <reqif-xhtml:a href="http://libreoffice.org/">http://libreoffice.org</reqif-xhtml:a>
+<reqif-xhtml:span style="text-decoration: underline">u</reqif-xhtml:span>
diff --git a/sw/qa/extras/htmlexport/htmlexport.cxx b/sw/qa/extras/htmlexport/htmlexport.cxx
index 289fcb2a26d7..b2a4348d3890 100644
--- a/sw/qa/extras/htmlexport/htmlexport.cxx
+++ b/sw/qa/extras/htmlexport/htmlexport.cxx
@@ -354,6 +354,9 @@ DECLARE_HTMLEXPORT_TEST(testReqIfParagraph, "reqif-p.xhtml")
 
     // This was "<a", was not found.
     CPPUNIT_ASSERT(aStream.indexOf("<reqif-xhtml:a") != -1);
+
+    // This was "<u>" instead of CSS.
+    CPPUNIT_ASSERT(aStream.indexOf("<reqif-xhtml:span style=\"text-decoration: underline\"") != -1);
 }
 
 DECLARE_HTMLEXPORT_ROUNDTRIP_TEST(testReqIfOleData, "reqif-ole-data.xhtml")
diff --git a/sw/source/filter/html/css1atr.cxx b/sw/source/filter/html/css1atr.cxx
index d70b5c622ac7..7ab0cf7b3f59 100644
--- a/sw/source/filter/html/css1atr.cxx
+++ b/sw/source/filter/html/css1atr.cxx
@@ -283,7 +283,7 @@ void SwHTMLWriter::OutCSS1_Property( const sal_Char *pProp,
         case CSS1_OUTMODE_SPAN_TAG1_ON:
             if( m_bTagOn )
             {
-                sOut.append("<" OOO_STRING_SVTOOLS_HTML_span
+                sOut.append("<" + GetNamespace() + OOO_STRING_SVTOOLS_HTML_span
                             " " OOO_STRING_SVTOOLS_HTML_O_style "=\"");
             }
             else
@@ -2243,7 +2243,7 @@ static Writer& OutCSS1_SvxTextLn_SvxCrOut_SvxBlink( Writer& rWrt,
             {
                 // this also works in HTML does not need to be written as
                 // a STYLE-Options, and must not be written as Hint
-                OSL_ENSURE( !rHTMLWrt.IsCSS1Source(CSS1_OUTMODE_HINT),
+                OSL_ENSURE( !rHTMLWrt.IsCSS1Source(CSS1_OUTMODE_HINT) || rHTMLWrt.mbReqIF,
                         "write underline as Hint?" );
                 pUStr = sCSS1_PV_underline;
             }
diff --git a/sw/source/filter/html/htmlatr.cxx b/sw/source/filter/html/htmlatr.cxx
index ac323a5ebc75..835fb25d6a99 100644
--- a/sw/source/filter/html/htmlatr.cxx
+++ b/sw/source/filter/html/htmlatr.cxx
@@ -2808,7 +2808,7 @@ static Writer& OutHTML_SwUnderline( Writer& rWrt, const SfxPoolItem& rHt )
         return rWrt;
 
     const FontLineStyle eUnder = static_cast<const SvxUnderlineItem&>(rHt).GetLineStyle();
-    if( LINESTYLE_NONE != eUnder )
+    if( LINESTYLE_NONE != eUnder && !rHTMLWrt.mbReqIF )
     {
         HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_underline, rHTMLWrt.m_bTagOn );
     }


More information about the Libreoffice-commits mailing list