sw HTML export, XHTML mode: fix lost </li> when last list item is not numbered
commit81f90d4ab51ec7528fa2a9b14c0426a634971580
authorMiklos Vajna <vmiklos@collabora.com>
Mon, 21 Feb 2022 15:38:51 +0000 (21 16:38 +0100)
committerXisco Fauli <xiscofauli@libreoffice.org>
Tue, 22 Feb 2022 09:35:53 +0000 (22 10:35 +0100)
tree224bdb0a4c987d82f57d0dc355163cd76644d6f7
parent9e32472d623998a1beaaf69342c53d1be5d1732f
sw HTML export, XHTML mode: fix lost </li> when last list item is not numbered

This went wrong in 013a4f1f5c9ea5fb511568c53a7e76d1b365a65d (sw XHTML
export: fix handling of list labels, 2021-05-13), where we started to
assume that in case the last paragraph of a list is not numbered, then
the entire list is not numbered. This lead to loosing the </li> for an
<li> in case the list starts with a numbered paragraph, but ends with a
non-numbered one.

Fix the problem by (if necessary) looking back till the start of the
list to see if any paragraph is numbered: that ensures that the <li> and
</li> is always in sync.

This fixes the new problem and keeps the old problem fixed at the same
time.

Change-Id: I7d347b37a40dcc727c2080bf8279e33c3ad147e9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130287
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
(cherry picked from commit 8c2607ae3ce143586e623532b8ae5288277ec3ac)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130310
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
sw/qa/extras/htmlexport/htmlexport.cxx
sw/source/filter/html/htmlnumwriter.cxx