diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2018-08-30 15:08:36 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2018-08-30 18:45:42 +0200 |
commit | 81fac013cb365d711ad78a566ee1b5b13480b013 (patch) | |
tree | cb672aeea2df173b1661a0e446e8bbf8241d9538 /sw | |
parent | 5d997c029e53c31a3651a08f5012645097cec48f (diff) |
sw XHTML export: xml:lang is not relevant for ReqIF
I suppose if language is set, that happens in the wrapping ReqIF
document, not in the XHTML fragments.
Change-Id: I970c3810b7f02bbafc37dd85e095b254cc651330
Reviewed-on: https://gerrit.libreoffice.org/59810
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/htmlexport/data/reqif-no-lang.odt | bin | 0 -> 8340 bytes | |||
-rw-r--r-- | sw/qa/extras/htmlexport/htmlexport.cxx | 11 | ||||
-rw-r--r-- | sw/source/filter/html/wrthtml.cxx | 3 |
3 files changed, 13 insertions, 1 deletions
diff --git a/sw/qa/extras/htmlexport/data/reqif-no-lang.odt b/sw/qa/extras/htmlexport/data/reqif-no-lang.odt Binary files differnew file mode 100644 index 000000000000..c831921a42a4 --- /dev/null +++ b/sw/qa/extras/htmlexport/data/reqif-no-lang.odt diff --git a/sw/qa/extras/htmlexport/htmlexport.cxx b/sw/qa/extras/htmlexport/htmlexport.cxx index c83170752496..861054868ec1 100644 --- a/sw/qa/extras/htmlexport/htmlexport.cxx +++ b/sw/qa/extras/htmlexport/htmlexport.cxx @@ -646,6 +646,17 @@ DECLARE_HTMLEXPORT_TEST(testOleNodataReqIf, "reqif-ole-nodata.odt") CPPUNIT_ASSERT(!aSource.isEmpty()); } +DECLARE_HTMLEXPORT_TEST(testNoLangReqIf, "reqif-no-lang.odt") +{ + SvMemoryStream aStream; + wrapFragment(aStream); + xmlDocPtr pDoc = parseXmlStream(&aStream); + CPPUNIT_ASSERT(pDoc); + + // Make sure that xml:lang is not written in ReqIF mode. + assertXPathNoAttribute(pDoc, "/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:h1", "lang"); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/filter/html/wrthtml.cxx b/sw/source/filter/html/wrthtml.cxx index 2f8dde26a3bd..53b57fc4ce33 100644 --- a/sw/source/filter/html/wrthtml.cxx +++ b/sw/source/filter/html/wrthtml.cxx @@ -1339,7 +1339,8 @@ sal_uInt16 SwHTMLWriter::GetLangWhichIdFromScript( sal_uInt16 nScript ) void SwHTMLWriter::OutLanguage( LanguageType nLang ) { - if( LANGUAGE_DONTKNOW != nLang ) + // ReqIF mode: consumers would ignore language anyway. + if (LANGUAGE_DONTKNOW != nLang && !mbReqIF) { OStringBuffer sOut; sOut.append(' '); |