sw/source/core/text/itrpaint.cxx       |    9 +++++++--
 vcl/qa/cppunit/pdfexport/pdfexport.cxx |    9 ++-------
 2 files changed, 9 insertions(+), 9 deletions(-)

New commits:
commit 5dfae9e00f245da78613224ed8e0dbd8b6633192
Author:     Michael Stahl <michael.st...@allotropia.de>
AuthorDate: Wed Oct 25 12:03:53 2023 +0200
Commit:     Michael Stahl <michael.st...@allotropia.de>
CommitDate: Wed Oct 25 13:37:10 2023 +0200

    tdf#157703 sw: PDF/UA export: export heading labels as text
    
    Been advised that a Lbl element is not much use in practice.
    
    Change-Id: I4ea339d7b48a7ee8ae40f94a9fc71f3e409c07ad
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158421
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>

diff --git a/sw/source/core/text/itrpaint.cxx b/sw/source/core/text/itrpaint.cxx
index 31bd418e94e2..4f0d412f2597 100644
--- a/sw/source/core/text/itrpaint.cxx
+++ b/sw/source/core/text/itrpaint.cxx
@@ -412,6 +412,7 @@ void SwTextPainter::DrawTextLine( const SwRect &rPaint, 
SwSaveClip &rClip,
         if ((pPor->InNumberGrp() // also footnote label
                 // weird special case, bullet with soft hyphen
              || (pPor->InHyphGrp() && pNext && pNext->InNumberGrp()))
+            && 
!GetInfo().GetTextFrame()->GetTextNodeForParaProps()->IsOutline()
             && !roTaggedLabel) // note: CalcPaintOfst may skip some portions
         {
             assert(isPDFTaggingEnabled);
@@ -435,14 +436,18 @@ void SwTextPainter::DrawTextLine( const SwRect &rPaint, 
SwSaveClip &rClip,
             // note: numbering portion may be split if it has multiple scripts
             && !static_cast<SwNumberPortion const*>(pPor)->HasFollow()) // so 
wait for the last one
         {
-            assert(roTaggedLabel);
-            roTaggedLabel.reset(); // close Lbl
             if 
(!GetInfo().GetTextFrame()->GetTextNodeForParaProps()->IsOutline())
             {
+                assert(roTaggedLabel);
+                roTaggedLabel.reset(); // close Lbl
                 assert(!roTaggedParagraph);
                 Frame_Info aFrameInfo(*m_pFrame, false); // open LBody
                 roTaggedParagraph.emplace(nullptr, &aFrameInfo, nullptr, 
*pOut);
             }
+            else
+            {
+                assert(!roTaggedLabel);
+            }
         }
 
         // reset underline font
diff --git a/vcl/qa/cppunit/pdfexport/pdfexport.cxx 
b/vcl/qa/cppunit/pdfexport/pdfexport.cxx
index 70da866889aa..10881186be42 100644
--- a/vcl/qa/cppunit/pdfexport/pdfexport.cxx
+++ b/vcl/qa/cppunit/pdfexport/pdfexport.cxx
@@ -3954,13 +3954,8 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf157703)
     CPPUNIT_ASSERT(pKidsD0);
     auto pKidsD0v = pKidsD0->GetElements();
     auto pRefKidD00 = 
dynamic_cast<vcl::filter::PDFReferenceElement*>(pKidsD0v[0]);
-    CPPUNIT_ASSERT(pRefKidD00);
-    auto pObjectD00 = pRefKidD00->LookupObject();
-    CPPUNIT_ASSERT(pObjectD00);
-    auto pTypeD00 = 
dynamic_cast<vcl::filter::PDFNameElement*>(pObjectD00->Lookup("Type"));
-    CPPUNIT_ASSERT_EQUAL(OString("StructElem"), pTypeD00->GetValue());
-    auto pSD00 = 
dynamic_cast<vcl::filter::PDFNameElement*>(pObjectD00->Lookup("S"));
-    CPPUNIT_ASSERT_EQUAL(OString("Lbl"), pSD00->GetValue());
+    // MCID for label
+    CPPUNIT_ASSERT(!pRefKidD00);
 
     // MCID for text
     auto pRefKidD01 = 
dynamic_cast<vcl::filter::PDFReferenceElement*>(pKidsD0v[1]);

Reply via email to