diff options
author | Michael Stahl <michael.stahl@allotropia.de> | 2022-10-19 16:38:02 +0200 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2022-10-24 21:03:50 +0200 |
commit | f91da6e6063e0494559a015a0ec6ea38fcb30baa (patch) | |
tree | c973b2c3119a925cfb52505aca5182d91eca0ca4 /sw | |
parent | cde779398e0924e77d630cbe3fbb71c0439939f7 (diff) |
tdf#139736 sw: PDF/UA export: flys in header/footer are Artifacts
* flys anchored in header/footer cannot simply be ignored, they need to
get NonStructElement tag which is translated to "/Artifact"
* borders of flys need to get "/Artifact" tag as well; this is also the
case if they're anchored in the body as veraPDF complains
Change-Id: Id69f0d80c59c3ade295da46c4413a5f0e8d96d54
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141534
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
(cherry picked from commit 72b69b422d33308809070e98a6ea8daad93e16d2)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141734
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/layout/paintfrm.cxx | 15 | ||||
-rw-r--r-- | sw/source/core/text/EnhancedPDFExportHelper.cxx | 8 |
2 files changed, 15 insertions, 8 deletions
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index d470b1ae030f..7cae991210d7 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -4287,12 +4287,15 @@ void SwFlyFrame::PaintSwFrame(vcl::RenderContext& rRenderContext, SwRect const& Validate(); - // first paint lines added by fly frame paint - // and then unlock other lines. - gProp.pSLines->PaintLines( &rRenderContext, gProp ); - gProp.pSLines->LockLines( false ); - // have to paint frame borders added in heaven layer here... - ProcessPrimitives(gProp.pBLines->GetBorderLines_Clear()); + { + SwTaggedPDFHelper tag(nullptr, nullptr, nullptr, *pShell->GetOut()); + // first paint lines added by fly frame paint + // and then unlock other lines. + gProp.pSLines->PaintLines( &rRenderContext, gProp ); + gProp.pSLines->LockLines( false ); + // have to paint frame borders added in heaven layer here... + ProcessPrimitives(gProp.pBLines->GetBorderLines_Clear()); + } PaintDecorators(); diff --git a/sw/source/core/text/EnhancedPDFExportHelper.cxx b/sw/source/core/text/EnhancedPDFExportHelper.cxx index 30c1db446868..ccec950bb954 100644 --- a/sw/source/core/text/EnhancedPDFExportHelper.cxx +++ b/sw/source/core/text/EnhancedPDFExportHelper.cxx @@ -969,7 +969,7 @@ void SwTaggedPDFHelper::BeginBlockStructureElements() // Lowers of NonStructureElements should not be considered: - if ( lcl_IsInNonStructEnv( *pFrame ) ) + if (lcl_IsInNonStructEnv(*pFrame) && !pFrame->IsFlyFrame()) return; // Check if we have to reopen an existing structure element. @@ -1258,7 +1258,11 @@ void SwTaggedPDFHelper::BeginBlockStructureElements() // fly in content or fly at page { const SwFlyFrame* pFly = static_cast<const SwFlyFrame*>(pFrame); - if ( pFly->Lower() && pFly->Lower()->IsNoTextFrame() ) + if (pFly->GetAnchorFrame()->FindFooterOrHeader() != nullptr) + { + nPDFType = vcl::PDFWriter::NonStructElement; + } + else if (pFly->Lower() && pFly->Lower()->IsNoTextFrame()) { bool bFormula = false; |