sw/qa/extras/htmlexport/htmlexport.cxx |    3 ++-
 sw/source/filter/html/htmlatr.cxx      |    2 ++
 sw/source/filter/html/htmltabw.cxx     |   19 +------------------
 sw/source/filter/html/wrthtml.hxx      |    1 +
 4 files changed, 6 insertions(+), 19 deletions(-)

New commits:
commit 4e89ff82d24277737653214a311702cd7c006d09
Author:     Mike Kaganski <mike.kagan...@collabora.com>
AuthorDate: Tue Apr 11 21:24:58 2023 +0300
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Mon Apr 17 16:25:15 2023 +0200

    tdf#154761: each dl needs a dd to actually indent
    
    Change-Id: Iaa75048b33ab82250d205cbf821e57425754ef5e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150244
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>
    Signed-off-by: Xisco Fauli <xiscofa...@libreoffice.org>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150491

diff --git a/sw/qa/extras/htmlexport/htmlexport.cxx 
b/sw/qa/extras/htmlexport/htmlexport.cxx
index 8ed189b44bb0..6834434bf3da 100644
--- a/sw/qa/extras/htmlexport/htmlexport.cxx
+++ b/sw/qa/extras/htmlexport/htmlexport.cxx
@@ -2407,8 +2407,9 @@ CPPUNIT_TEST_FIXTURE(HtmlExportTest, testTdf153923)
     // Without the fix in place, this would fail
     CPPUNIT_ASSERT(pDoc);
 
+    assertXPath(pDoc, "/html/body//dl", 3);
     // The 'dd' tag was not closed
-    assertXPath(pDoc, "/html/body//dd");
+    assertXPath(pDoc, "/html/body//dd", 3);
 }
 
 CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testTdf153923_ReqIF)
diff --git a/sw/source/filter/html/htmlatr.cxx 
b/sw/source/filter/html/htmlatr.cxx
index 1bf0a45e82e3..822718763e4d 100644
--- a/sw/source/filter/html/htmlatr.cxx
+++ b/sw/source/filter/html/htmlatr.cxx
@@ -136,6 +136,7 @@ void SwHTMLWriter::OutAndSetDefList( sal_uInt16 nNewLvl )
             if( m_bLFPossible )
                 OutNewLine();
             HTMLOutFuncs::Out_AsciiTag( Strm(), Concat2View(GetNamespace() + 
OOO_STRING_SVTOOLS_HTML_deflist) );
+            HTMLOutFuncs::Out_AsciiTag( Strm(), Concat2View(GetNamespace() + 
OOO_STRING_SVTOOLS_HTML_dd) );
             IncIndentLevel();
             m_bLFPossible = true;
         }
@@ -147,6 +148,7 @@ void SwHTMLWriter::OutAndSetDefList( sal_uInt16 nNewLvl )
             DecIndentLevel();
             if( m_bLFPossible )
                 OutNewLine();
+            HTMLOutFuncs::Out_AsciiTag( Strm(), Concat2View(GetNamespace() + 
OOO_STRING_SVTOOLS_HTML_dd), false );
             HTMLOutFuncs::Out_AsciiTag( Strm(), Concat2View(GetNamespace() + 
OOO_STRING_SVTOOLS_HTML_deflist), false );
             m_bLFPossible = true;
         }
diff --git a/sw/source/filter/html/htmltabw.cxx 
b/sw/source/filter/html/htmltabw.cxx
index 8c86f70c97ff..ab611724474d 100644
--- a/sw/source/filter/html/htmltabw.cxx
+++ b/sw/source/filter/html/htmltabw.cxx
@@ -1050,17 +1050,9 @@ Writer& OutHTML_SwTableNode( Writer& rWrt, SwTableNode & 
rNode,
         }
     }
 
-    if( !pFlyFrameFormat && nNewDefListLvl != rHTMLWrt.m_nDefListLvl )
+    if( !pFlyFrameFormat && !rHTMLWrt.mbReqIF && nNewDefListLvl != 
rHTMLWrt.m_nDefListLvl )
         rHTMLWrt.OutAndSetDefList( nNewDefListLvl );
 
-    if( nNewDefListLvl )
-    {
-        if( rHTMLWrt.m_bLFPossible )
-            rHTMLWrt.OutNewLine();
-        HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), 
Concat2View(rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_dd) );
-        rHTMLWrt.IncIndentLevel();
-    }
-
     // eFlyHoriOri and eTabHoriOri now only contain the values of
     // LEFT/CENTER and RIGHT!
     if( eFlyHoriOri!=text::HoriOrientation::NONE )
@@ -1185,15 +1177,6 @@ Writer& OutHTML_SwTableNode( Writer& rWrt, SwTableNode & 
rNode,
     // move Pam behind the table
     rHTMLWrt.m_pCurrentPam->GetPoint()->Assign( *rNode.EndOfSectionNode() );
 
-    if (nNewDefListLvl)
-    {
-        rHTMLWrt.DecIndentLevel();
-        if (rHTMLWrt.m_bLFPossible)
-            rHTMLWrt.OutNewLine();
-        // close the dd element
-        HTMLOutFuncs::Out_AsciiTag(rWrt.Strm(), 
Concat2View(rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_dd), false);
-    }
-
     if( bPreserveForm )
     {
         rHTMLWrt.m_bPreserveForm = false;
diff --git a/sw/source/filter/html/wrthtml.hxx 
b/sw/source/filter/html/wrthtml.hxx
index b62aab60af6e..c083d688acb4 100644
--- a/sw/source/filter/html/wrthtml.hxx
+++ b/sw/source/filter/html/wrthtml.hxx
@@ -472,6 +472,7 @@ public:
 
     void OutBasic(const SwHTMLWriter& rHTMLWrt);
 
+    // Used to indent inner blocks using dl/dd tags
     void OutAndSetDefList( sal_uInt16 nNewLvl );
 
     void OutStyleSheet( const SwPageDesc& rPageDesc );

Reply via email to