summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/htmlexport/htmlexport.cxx3
-rw-r--r--sw/source/filter/html/htmlatr.cxx13
2 files changed, 15 insertions, 1 deletions
diff --git a/sw/qa/extras/htmlexport/htmlexport.cxx b/sw/qa/extras/htmlexport/htmlexport.cxx
index f659eba0b1c8..bafe6798c8c4 100644
--- a/sw/qa/extras/htmlexport/htmlexport.cxx
+++ b/sw/qa/extras/htmlexport/htmlexport.cxx
@@ -489,6 +489,9 @@ DECLARE_HTMLEXPORT_TEST(testReqIfList, "reqif-list.xhtml")
// This failed, the 'style' attribute was written, even if the input did
// not had one.
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(-1), aStream.indexOf(" style=\""));
+
+ // This failed <li> was only opened, not closed.
+ CPPUNIT_ASSERT(aStream.indexOf("</reqif-xhtml:li>") != -1);
}
DECLARE_HTMLEXPORT_ROUNDTRIP_TEST(testReqIfOle2, "reqif-ole2.xhtml")
diff --git a/sw/source/filter/html/htmlatr.cxx b/sw/source/filter/html/htmlatr.cxx
index 1f3dc216c0e4..779b93aa7af0 100644
--- a/sw/source/filter/html/htmlatr.cxx
+++ b/sw/source/filter/html/htmlatr.cxx
@@ -207,6 +207,7 @@ struct SwHTMLTextCollOutputInfo
bool bParaPossible; // a </P> may be output additionally
bool bOutPara; // a </P> is supposed to be output
bool bOutDiv; // write a </DIV>
+ bool bOutLi = false; // write a </li>
SwHTMLTextCollOutputInfo() :
bInNumBulList( false ),
@@ -757,7 +758,13 @@ void OutHTML_SwFormat( Writer& rWrt, const SwFormat& rFormat,
html.start(OOO_STRING_SVTOOLS_HTML_li);
if( USHRT_MAX != nNumStart )
html.attribute(OOO_STRING_SVTOOLS_HTML_O_value, OString::number(nNumStart));
- html.endAttribute();
+ if (rHWrt.mbXHTML)
+ {
+ rWrt.Strm().WriteCharPtr(">");
+ rInfo.bOutLi = true;
+ }
+ else
+ html.endAttribute();
}
if( rHWrt.m_nDefListLvl > 0 && !bForceDL )
@@ -1008,6 +1015,10 @@ void OutHTML_SwFormatOff( Writer& rWrt, const SwHTMLTextCollOutputInfo& rInfo )
rHWrt.m_bLFPossible = true;
}
+ if (rInfo.bOutLi)
+ HTMLOutFuncs::Out_AsciiTag(rWrt.Strm(), rHWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_li,
+ false);
+
// if necessary, close a bulleted or numbered list
if( rInfo.bInNumBulList )
{