diff options
author | Katarina Behrens <Katarina.Behrens@cib.de> | 2019-03-06 17:22:21 +0100 |
---|---|---|
committer | Katarina Behrens <Katarina.Behrens@cib.de> | 2019-03-21 13:20:46 +0100 |
commit | a0fd6c4d1ea6d40573ad91922bf4e37992e87143 (patch) | |
tree | 88bbcb7b7b769fe61739f56a11f3a7bc61bdcf1c /drawinglayer/source/processor2d | |
parent | c312dfb523f29acf40c2ccf74af30cce19be6697 (diff) |
Limit tagging of background objects to images
i.e. don't tag custom shapes and other than bitmap background fills
Change-Id: I1d42012420f59e1e7b62affb8aca5a8c85688423
Reviewed-on: https://gerrit.libreoffice.org/69258
Tested-by: Jenkins
Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
Diffstat (limited to 'drawinglayer/source/processor2d')
-rw-r--r-- | drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx index 1c3e73fc85b3..40eec9fc4245 100644 --- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx +++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx @@ -2213,20 +2213,31 @@ namespace drawinglayer { // structured tag primitive const vcl::PDFWriter::StructElement& rTagElement(rStructureTagCandidate.getStructureElement()); - const bool bTagUsed(vcl::PDFWriter::NonStructElement != rTagElement); - const bool bIsBackground(rStructureTagCandidate.isBackground()); + bool bTagUsed((vcl::PDFWriter::NonStructElement != rTagElement)); if(mpPDFExtOutDevData && bTagUsed) { - // 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); + // foreground object: tag as regular structure element + if (!rStructureTagCandidate.isBackground()) + { + mpPDFExtOutDevData->BeginStructureElement(rTagElement); + } + // background object + else + { + // background image: tag as artifact + if (rStructureTagCandidate.isImage()) + mpPDFExtOutDevData->BeginStructureElement(vcl::PDFWriter::NonStructElement); + // any other background object: do not tag + else + bTagUsed = false; + } } // process children normally process(rStructureTagCandidate.getChildren()); - if(mpPDFExtOutDevData && bTagUsed) + if(mpPDFExtOutDevData && bTagUsed) { // write end tag mpPDFExtOutDevData->EndStructureElement(); |