summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorMichael Stahl <michael.stahl@allotropia.de>2023-03-24 18:45:53 +0100
committerCaolán McNamara <caolanm@redhat.com>2023-03-28 12:28:41 +0000
commitdc9d083ce0b290e0203f060ac96fbffa40cbdefc (patch)
tree0d41f23bcc98a1b96f91229ac92d9d23c5a90860 /svx
parent8d2bf27c3f683e313fea37f8399b4b0be0d16df8 (diff)
tdf#152234 drawinglayer,svx: PDF/UA export: add Alt text to form controls
Specification: ISO 14289-1:2014, Clause: 7.18.1, Test number: 3 A form field whose hidden flag is not set and whose rectangle is not outside the crop-box shall have a TU key present or all its Widget annotations shall have alternative descriptions (in the form of an Alt entry in the enclosing structure elements) Form controls are weird because they have an SdrObject with the usual name/title/description plus a property "HelpText" on the control itself which is already exported as "/TU" on the /Annot unless it's empty. Exporting the SdrObject properties via ObjectInfoPrimitive2D doesn't work as tragically that is only created for form controls when painting to the screen while PDF export takes a detour that needs special handling. Change-Id: Id96f7dd13f190ab439c099cd1f4acb70c1c9fdc9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149554 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> (cherry picked from commit 002a6fee2fbd07c3f0cd1f1ddba39c691130727e) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149602 Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/sdr/contact/viewcontactofunocontrol.cxx5
-rw-r--r--svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx4
2 files changed, 7 insertions, 2 deletions
diff --git a/svx/source/sdr/contact/viewcontactofunocontrol.cxx b/svx/source/sdr/contact/viewcontactofunocontrol.cxx
index f99b24372ba7..cc14ae06ad5e 100644
--- a/svx/source/sdr/contact/viewcontactofunocontrol.cxx
+++ b/svx/source/sdr/contact/viewcontactofunocontrol.cxx
@@ -111,7 +111,10 @@ namespace sdr::contact {
const drawinglayer::primitive2d::Primitive2DReference xRetval(
new drawinglayer::primitive2d::ControlPrimitive2D(
aTransform,
- xControlModel));
+ xControlModel,
+ nullptr,
+ GetSdrObject().GetTitle(),
+ GetSdrObject().GetDescription()));
rVisitor.visit(xRetval);
}
diff --git a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx
index 46d2dc9980e2..1808a337a697 100644
--- a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx
@@ -1563,7 +1563,9 @@ namespace sdr::contact {
// create a primitive and hand over the existing xControl. This will
// allow the primitive to not need to create another one on demand.
rContainer.push_back( new ::drawinglayer::primitive2d::ControlPrimitive2D(
- m_aTransformation, xControlModel, rControl.getControl() ) );
+ m_aTransformation, xControlModel, rControl.getControl(),
+ m_pVOCImpl->getViewContact().GetSdrObject().GetTitle(),
+ m_pVOCImpl->getViewContact().GetSdrObject().GetDescription()) );
}
sal_uInt32 LazyControlCreationPrimitive2D::getPrimitive2DID() const