summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <michael.stahl@allotropia.de>2023-11-01 20:31:44 +0100
committerThorsten Behrens <thorsten.behrens@allotropia.de>2023-11-11 18:06:58 +0100
commit6898f3ad90f2128de78726e689318bc3565b644a (patch)
tree990099d886311ec78a111b0c70550e2641b39027
parentf24ad883b15a8112d7dfeb4de14afaf67da30a47 (diff)
tdf#156565 sw: PDF/UA export: split Link SE at line break
There must be one Link SE per Link Annotation, so ensure that a new one is created for a new line. (regression from commit 4c5283a3a11008a06a995c49ed777734dc1f6066) Change-Id: I2585d9e22a435d7716f48fec89a78149c129f71d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158775 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> (cherry picked from commit a71da3b7a80ca32b595a8ca0ea3da650b0af376c) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158799 Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
-rw-r--r--sw/inc/EnhancedPDFExportHelper.hxx1
-rw-r--r--sw/source/core/text/EnhancedPDFExportHelper.cxx14
-rw-r--r--sw/source/core/text/itrpaint.cxx2
3 files changed, 17 insertions, 0 deletions
diff --git a/sw/inc/EnhancedPDFExportHelper.hxx b/sw/inc/EnhancedPDFExportHelper.hxx
index 542138157d2f..fdfbeffe8a02 100644
--- a/sw/inc/EnhancedPDFExportHelper.hxx
+++ b/sw/inc/EnhancedPDFExportHelper.hxx
@@ -177,6 +177,7 @@ class SwTaggedPDFHelper
~SwTaggedPDFHelper();
static bool IsExportTaggedPDF( const OutputDevice& rOut );
+ static void EndCurrentLink(OutputDevice const&);
};
/*
diff --git a/sw/source/core/text/EnhancedPDFExportHelper.cxx b/sw/source/core/text/EnhancedPDFExportHelper.cxx
index ed9f9b31d674..43c20729363e 100644
--- a/sw/source/core/text/EnhancedPDFExportHelper.cxx
+++ b/sw/source/core/text/EnhancedPDFExportHelper.cxx
@@ -1651,6 +1651,20 @@ void SwTaggedPDFHelper::EndStructureElements()
CheckRestoreTag();
}
+void SwTaggedPDFHelper::EndCurrentLink(OutputDevice const& rOut)
+{
+ vcl::PDFExtOutDevData *const pPDFExtOutDevData(
+ dynamic_cast<vcl::PDFExtOutDevData *>(rOut.GetExtOutDevData()));
+ if (pPDFExtOutDevData && pPDFExtOutDevData->GetSwPDFState()->m_oCurrentLink)
+ {
+ pPDFExtOutDevData->GetSwPDFState()->m_oCurrentLink.reset();
+ pPDFExtOutDevData->EndStructureElement();
+#if OSL_DEBUG_LEVEL > 1
+ aStructStack.pop_back();
+#endif
+ }
+}
+
void SwTaggedPDFHelper::EndCurrentSpan()
{
mpPDFExtOutDevData->GetSwPDFState()->m_oCurrentSpan.reset();
diff --git a/sw/source/core/text/itrpaint.cxx b/sw/source/core/text/itrpaint.cxx
index 06c9c56b5d07..bfd15d5dfd90 100644
--- a/sw/source/core/text/itrpaint.cxx
+++ b/sw/source/core/text/itrpaint.cxx
@@ -162,6 +162,8 @@ void SwTextPainter::DrawTextLine( const SwRect &rPaint, SwSaveClip &rClip,
roTaggedParagraph.emplace(nullptr, &aFrameInfo, nullptr, *GetInfo().GetOut());
}
+ SwTaggedPDFHelper::EndCurrentLink(*GetInfo().GetOut());
+
// Optimization!
SwTwips nMaxRight = std::min<SwTwips>( rPaint.Right(), Right() );
const SwTwips nTmpLeft = GetInfo().X();