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

Miklos Vajna vmiklos at collabora.co.uk
Mon Mar 19 20:52:05 UTC 2018


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

New commits:
commit afe4dfe1d60b81ff673f0859c8c79c19ef26356c
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Mon Mar 19 17:23:56 2018 +0100

    sw XHTML export: avoid <strike> for strikeout in ReqIF mode
    
    Similar to how <u> for underline is avoided, the spec explicitly forbids
    this.
    
    Change-Id: I314a49df496d7b02049154564884e296b9633576
    Reviewed-on: https://gerrit.libreoffice.org/51578
    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 315a4db80918..b05cdeb9d8e7 100644
--- a/sw/qa/extras/htmlexport/data/reqif-p.xhtml
+++ b/sw/qa/extras/htmlexport/data/reqif-p.xhtml
@@ -3,3 +3,4 @@
 <reqif-xhtml:a href="http://libreoffice.org/">http://libreoffice.org</reqif-xhtml:a>
 <reqif-xhtml:span style="text-decoration: underline">u</reqif-xhtml:span>
 <reqif-xhtml:strong>s</reqif-xhtml:strong>
+<reqif-xhtml:strike>s</reqif-xhtml:strike>
diff --git a/sw/qa/extras/htmlexport/htmlexport.cxx b/sw/qa/extras/htmlexport/htmlexport.cxx
index 515f7c768273..4777e8945b8a 100644
--- a/sw/qa/extras/htmlexport/htmlexport.cxx
+++ b/sw/qa/extras/htmlexport/htmlexport.cxx
@@ -360,6 +360,9 @@ DECLARE_HTMLEXPORT_TEST(testReqIfParagraph, "reqif-p.xhtml")
 
     // This was <strong>, namespace prefix was missing.
     CPPUNIT_ASSERT(aStream.indexOf("<reqif-xhtml:strong>") != -1);
+
+    // This was "<strike>" instead of CSS.
+    CPPUNIT_ASSERT(aStream.indexOf("<reqif-xhtml:span style=\"text-decoration: line-through\"") != -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 7ab0cf7b3f59..9a8acd083eac 100644
--- a/sw/source/filter/html/css1atr.cxx
+++ b/sw/source/filter/html/css1atr.cxx
@@ -2289,7 +2289,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 crossedOut as Hint?" );
                 pCOStr = sCSS1_PV_line_through;
             }
diff --git a/sw/source/filter/html/htmlatr.cxx b/sw/source/filter/html/htmlatr.cxx
index b148cf181237..76306190a831 100644
--- a/sw/source/filter/html/htmlatr.cxx
+++ b/sw/source/filter/html/htmlatr.cxx
@@ -2758,7 +2758,7 @@ static Writer& OutHTML_SwCrossedOut( Writer& rWrt, const SfxPoolItem& rHt )
 
     // Because of Netscape, we output STRIKE and not S!
     const FontStrikeout nStrike = static_cast<const SvxCrossedOutItem&>(rHt).GetStrikeout();
-    if( STRIKEOUT_NONE != nStrike )
+    if( STRIKEOUT_NONE != nStrike && !rHTMLWrt.mbReqIF )
     {
         HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_strike, rHTMLWrt.m_bTagOn );
     }


More information about the Libreoffice-commits mailing list