diff options
author | Michael Stahl <michael.stahl@allotropia.de> | 2022-10-19 16:38:02 +0200 |
---|---|---|
committer | Michael Stahl <michael.stahl@allotropia.de> | 2022-10-21 17:37:15 +0200 |
commit | 72b69b422d33308809070e98a6ea8daad93e16d2 (patch) | |
tree | c441e1566f513de66730b4ab363238d36207703c /sw | |
parent | 1cccfb05d1aaea33aa370b6f4f080cae95611cd0 (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>
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 5a37468f0d72..2179cfbb96e3 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -4289,12 +4289,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 f193aa354cb4..769c3a6b06f1 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; |