drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx | 36 ++----------- 1 file changed, 6 insertions(+), 30 deletions(-)
New commits: commit bf978a527fb0bba27cd2c83443e70ad86a63d819 Author: Katarina Behrens <katarina.behr...@cib.de> AuthorDate: Thu Jan 31 17:18:36 2019 +0100 Commit: Katarina Behrens <katarina.behr...@cib.de> CommitDate: Thu Jan 31 17:24:13 2019 +0100 Export background images provided by master page as artifacts so that screenreaders don't announce them. To make this happen, pass them as NonStructElement to PDF writer Change-Id: I94d52ee0207cd6362edabfb9b891faa7fe341543 diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx index ece83ddc8c52..5c06999ce20e 100644 --- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx +++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx @@ -2297,38 +2297,14 @@ namespace drawinglayer { // structured tag primitive const vcl::PDFWriter::StructElement& rTagElement(rStructureTagCandidate.getStructureElement()); - bool bTagUsed(vcl::PDFWriter::NonStructElement != rTagElement); + const bool bTagUsed(vcl::PDFWriter::NonStructElement != rTagElement); + const bool bIsBackground(rStructureTagCandidate.isBackground()); - //Z For now, just do not create StructureTag(s) for hidden/background - // (Graphic)Objects - see '/Artifact' comments below - if(bTagUsed && rStructureTagCandidate.isBackground()) + if(mpPDFExtOutDevData && bTagUsed) { - bTagUsed = false; - } - - if(mpPDFExtOutDevData && bTagUsed) - { - // write start tag - mpPDFExtOutDevData->BeginStructureElement(rTagElement); - - // if(rStructureTagCandidate.isBackground()) - // { - // //Z need to somehow apply '/Artifact' information... - // // - Already experimented with adding two BeginStructureElement adding - // // a 'vcl::PDFWriter::Artifact' -> not really what e.g. PAC3 expects. - // // - May also be adding someting using 'SetStructureAttribute' and - // // extending vcl::PDFWriter::StructAttribute... - // // - Simple solution for now (see above): Just do not create - // // StructureTag(s) for hidden/background (Graphic)Objects. That - // // works, shows all content in PDF renderers, but hides in - // // TaggedStructure. But: also not visible in PAC3's 'LogicalStructure' - // // View where there is a tab for 'Artifacts' - I *guess* a correctly - // // tagged '/Artifact' should appear there. - // // Unfortunately found no real example - there is https://www.w3.org/TR/WCAG20-TECHS/PDF4.html - // // which claims to have an example in - // // https://www.w3.org/WAI/WCAG20/Techniques/working-examples/PDF4/decorative-image.docx - // // but that file has no '/Artifact' entries at all... - // } + // Write start tag. For background elements use NonStructElement instead of real element type (e.g. Figure) + // to guarantee it gets exported as artifact (tagged PDF) + mpPDFExtOutDevData->BeginStructureElement(bIsBackground ? vcl::PDFWriter::NonStructElement : rTagElement); } // process children normally _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits