summaryrefslogtreecommitdiff
path: root/drawinglayer/source/processor2d/vclmetafileprocessor2d.hxx
diff options
context:
space:
mode:
authorMichael Stahl <michael.stahl@allotropia.de>2022-11-23 19:08:14 +0100
committerMichael Stahl <michael.stahl@allotropia.de>2022-11-25 11:47:13 +0100
commit78681cd0829dcb6a73690e1a63ae3808d297677a (patch)
tree68970b16e2a384a4ab263da94e9289cdb33fa048 /drawinglayer/source/processor2d/vclmetafileprocessor2d.hxx
parent5f249506ff2eddeaac47d521509bf1dde0b58d01 (diff)
tdf#57423 drawinglayer: PDF/UA export: more Alt texts for SdrObjects
Currently /Alt texts are generated from ObjectInfoPrimitive2D, but this is only evaluated in VclMetafileProcessor2D::processGraphicPrimitive2D() so while it's created for every SdrObject, it's ignored in most cases. There doesn't appear to be a reason why this is done in processGraphicPrimitive2D() and not a more generic location, the special conditions that are checked there don't have anything to do with Alt texts, they effectively guard some optimisation done to bitmaps in PageSyncData::PlaySyncPageAct(). There is another issue in that not every SdrObject gets a StructureTagPrimitive2D, and even if there is a StructureTagPrimitive2D it may be ignored if it's in the background. The Alt text must only be produced if there is a structure element for the same SdrObject, else it would end up on some unrelated structure element. Fix all this by moving processing to a new function which checks that there is a current StructureTagPrimitive2D for a SdrObject in effect. The only problem with this is that previously Writer images produced Alt text, and now they don't - but Writer needs some fixing anyway. Change-Id: I2a362e8a9cd93e5bc817c6eed546c46b46e14980 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143189 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'drawinglayer/source/processor2d/vclmetafileprocessor2d.hxx')
-rw-r--r--drawinglayer/source/processor2d/vclmetafileprocessor2d.hxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.hxx b/drawinglayer/source/processor2d/vclmetafileprocessor2d.hxx
index 0393039f4455..730b7aac11f2 100644
--- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.hxx
+++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.hxx
@@ -63,6 +63,7 @@ class PolyPolygonColorPrimitive2D;
class MaskPrimitive2D;
class UnifiedTransparencePrimitive2D;
class TransparencePrimitive2D;
+class ObjectInfoPrimitive2D;
class StructureTagPrimitive2D;
}
@@ -142,6 +143,8 @@ private:
const primitive2d::UnifiedTransparencePrimitive2D& rUniTransparenceCandidate);
void processTransparencePrimitive2D(
const primitive2d::TransparencePrimitive2D& rTransparenceCandidate);
+ void
+ processObjectInfoPrimitive2D(const primitive2d::ObjectInfoPrimitive2D& rObjectInfoPrimitive2D);
void processStructureTagPrimitive2D(
const primitive2d::StructureTagPrimitive2D& rStructureTagCandidate);
@@ -191,6 +194,8 @@ private:
std::stack<vcl::PDFWriter::StructElement> maListElements;
+ primitive2d::StructureTagPrimitive2D const* mpCurrentStructureTag = nullptr;
+
protected:
/* the local processor for BasePrimitive2D-Implementation based primitives,
called from the common process()-implementation