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 9c933a9221639ade1814b2ee7b01dd927af7157e
Author:     Mike Kaganski <mike.kagan...@collabora.com>
AuthorDate: Tue Apr 11 21:24:58 2023 +0300
Commit:     Mike Kaganski <mike.kagan...@collabora.com>
CommitDate: Tue Apr 11 21:14:27 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>

diff --git a/sw/qa/extras/htmlexport/htmlexport.cxx 
b/sw/qa/extras/htmlexport/htmlexport.cxx
index 4cfa9000ddc3..de65983ac2ab 100644
--- a/sw/qa/extras/htmlexport/htmlexport.cxx
+++ b/sw/qa/extras/htmlexport/htmlexport.cxx
@@ -2484,8 +2484,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 7ca9b0172cfc..385869c737af 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 af007bec645c..b636e0f6b14a 100644
--- a/sw/source/filter/html/htmltabw.cxx
+++ b/sw/source/filter/html/htmltabw.cxx
@@ -1048,17 +1048,9 @@ SwHTMLWriter& OutHTML_SwTableNode( SwHTMLWriter& rWrt, 
SwTableNode & rNode,
         }
     }
 
-    if( !pFlyFrameFormat && nNewDefListLvl != rWrt.m_nDefListLvl )
+    if( !pFlyFrameFormat && !rWrt.mbReqIF && nNewDefListLvl != 
rWrt.m_nDefListLvl )
         rWrt.OutAndSetDefList( nNewDefListLvl );
 
-    if( nNewDefListLvl )
-    {
-        if( rWrt.m_bLFPossible )
-            rWrt.OutNewLine();
-        HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), 
Concat2View(rWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_dd) );
-        rWrt.IncIndentLevel();
-    }
-
     // eFlyHoriOri and eTabHoriOri now only contain the values of
     // LEFT/CENTER and RIGHT!
     if( eFlyHoriOri!=text::HoriOrientation::NONE )
@@ -1183,15 +1175,6 @@ SwHTMLWriter& OutHTML_SwTableNode( SwHTMLWriter& rWrt, 
SwTableNode & rNode,
     // move Pam behind the table
     rWrt.m_pCurrentPam->GetPoint()->Assign( *rNode.EndOfSectionNode() );
 
-    if (nNewDefListLvl)
-    {
-        rWrt.DecIndentLevel();
-        if (rWrt.m_bLFPossible)
-            rWrt.OutNewLine();
-        // close the dd element
-        HTMLOutFuncs::Out_AsciiTag(rWrt.Strm(), 
Concat2View(rWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_dd), false);
-    }
-
     if( bPreserveForm )
     {
         rWrt.m_bPreserveForm = false;
diff --git a/sw/source/filter/html/wrthtml.hxx 
b/sw/source/filter/html/wrthtml.hxx
index 16ec843dc279..43012ccfefc4 100644
--- a/sw/source/filter/html/wrthtml.hxx
+++ b/sw/source/filter/html/wrthtml.hxx
@@ -473,6 +473,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