diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2023-05-29 14:47:20 +0300 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2023-06-04 16:34:08 +0200 |
commit | 40790eddcdbc5e2cf5b897618a5dab091dfa7762 (patch) | |
tree | a07af72c76425bfa3dd8c24f2d9b45597ea97c23 /sw | |
parent | 39c6ff57c73a708713ddae2237e6a9a057b498a3 (diff) |
ReqIF: 'ol' elements must have no 'type' attribute
Change-Id: I62098bac9dc3751f7b939cbf94f1561b4539a294
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152368
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
(cherry picked from commit 949d1ee783f58504fdf7cb6b6a164384ae82533f)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152387
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/htmlexport/data/listsWithNumFormat.fodt | 74 | ||||
-rw-r--r-- | sw/qa/extras/htmlexport/htmlexport.cxx | 17 | ||||
-rw-r--r-- | sw/source/filter/html/htmlnumwriter.cxx | 5 |
3 files changed, 95 insertions, 1 deletions
diff --git a/sw/qa/extras/htmlexport/data/listsWithNumFormat.fodt b/sw/qa/extras/htmlexport/data/listsWithNumFormat.fodt new file mode 100644 index 000000000000..c9a8225662a9 --- /dev/null +++ b/sw/qa/extras/htmlexport/data/listsWithNumFormat.fodt @@ -0,0 +1,74 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<office:document xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" office:version="1.3" office:mimetype="application/vnd.oasis.opendocument.text"> + <office:automatic-styles> + <text:list-style style:name="A_upper"> + <text:list-level-style-number text:level="1" style:num-suffix="." style:num-format="A"/> + </text:list-style> + <text:list-style style:name="a_lower"> + <text:list-level-style-number text:level="1" style:num-suffix="." style:num-format="a"/> + </text:list-style> + <text:list-style style:name="I_upper"> + <text:list-level-style-number text:level="1" style:num-suffix="." style:num-format="I"/> + </text:list-style> + <text:list-style style:name="i_lower"> + <text:list-level-style-number text:level="1" style:num-suffix="." style:num-format="i"/> + </text:list-style> + </office:automatic-styles> + <office:body> + <office:text> + <text:p>List A</text:p> + <text:list text:style-name="A_upper"> + <text:list-item> + <text:p>First</text:p> + </text:list-item> + <text:list-item> + <text:p>Second</text:p> + </text:list-item> + <text:list-item> + <text:p>Third</text:p> + </text:list-item> + </text:list> + <text:p/> + <text:p>List a</text:p> + <text:list text:style-name="a_lower"> + <text:list-item> + <text:p>First</text:p> + </text:list-item> + <text:list-item> + <text:p>Second</text:p> + </text:list-item> + <text:list-item> + <text:p>Third</text:p> + </text:list-item> + </text:list> + <text:p/> + <text:p>List I</text:p> + <text:list text:style-name="I_upper"> + <text:list-item> + <text:p>First</text:p> + </text:list-item> + <text:list-item> + <text:p>Second</text:p> + </text:list-item> + <text:list-item> + <text:p>Third</text:p> + </text:list-item> + </text:list> + <text:p/> + <text:p>List i</text:p> + <text:list text:style-name="i_lower"> + <text:list-item> + <text:p>First</text:p> + </text:list-item> + <text:list-item> + <text:p>Second</text:p> + </text:list-item> + <text:list-item> + <text:p>Third</text:p> + </text:list-item> + </text:list> + <text:p/> + </office:text> + </office:body> +</office:document>
\ No newline at end of file diff --git a/sw/qa/extras/htmlexport/htmlexport.cxx b/sw/qa/extras/htmlexport/htmlexport.cxx index c2d218a37023..ace894a15a97 100644 --- a/sw/qa/extras/htmlexport/htmlexport.cxx +++ b/sw/qa/extras/htmlexport/htmlexport.cxx @@ -2594,6 +2594,23 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testReqIF_RightAlignedTable) assertXPathNoAttribute(pDoc, "/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:div", "align"); } +CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testReqIF_ListsWithNumFormat) +{ + createSwDoc("listsWithNumFormat.fodt"); + ExportToReqif(); + + SvMemoryStream aStream; + WrapReqifFromTempFile(aStream); + xmlDocUniquePtr pDoc = parseXmlStream(&aStream); + CPPUNIT_ASSERT(pDoc); + + // No 'type' attribute must be present in 'ol' + assertXPathNoAttribute(pDoc, "/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:ol[1]", "type"); + assertXPathNoAttribute(pDoc, "/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:ol[2]", "type"); + assertXPathNoAttribute(pDoc, "/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:ol[3]", "type"); + assertXPathNoAttribute(pDoc, "/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:ol[4]", "type"); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/filter/html/htmlnumwriter.cxx b/sw/source/filter/html/htmlnumwriter.cxx index 2bb4f5d96457..707a68bed11a 100644 --- a/sw/source/filter/html/htmlnumwriter.cxx +++ b/sw/source/filter/html/htmlnumwriter.cxx @@ -224,8 +224,10 @@ Writer& OutHTML_NumberBulletListStart( SwHTMLWriter& rWrt, // determine the type by the format char cType = 0; - switch( eType ) + if (!rWrt.mbReqIF) // No 'type' attribute in ReqIF { + switch (eType) + { case SVX_NUM_CHARS_UPPER_LETTER: case SVX_NUM_CHARS_UPPER_LETTER_N: cType = 'A'; @@ -240,6 +242,7 @@ Writer& OutHTML_NumberBulletListStart( SwHTMLWriter& rWrt, case SVX_NUM_ROMAN_LOWER: cType = 'i'; break; + } } if( cType ) { |