summaryrefslogtreecommitdiff
path: root/include
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 /include
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 'include')
-rw-r--r--include/drawinglayer/primitive2d/controlprimitive2d.hxx14
1 files changed, 8 insertions, 6 deletions
diff --git a/include/drawinglayer/primitive2d/controlprimitive2d.hxx b/include/drawinglayer/primitive2d/controlprimitive2d.hxx
index e3d5a5c0948d..e33c26886cd9 100644
--- a/include/drawinglayer/primitive2d/controlprimitive2d.hxx
+++ b/include/drawinglayer/primitive2d/controlprimitive2d.hxx
@@ -55,6 +55,9 @@ private:
/// the last used scaling, used from getDecomposition for buffering
basegfx::B2DVector maLastViewScaling;
+ /// yet another special snowflake way to generate PDF Alt text
+ OUString m_AltText;
+
/** used from getXControl() to create a local awt::XControl which is remembered in mxXControl
and from thereon always used and returned by getXControl()
*/
@@ -71,17 +74,14 @@ private:
const geometry::ViewInformation2D& rViewInformation) const override;
public:
- /// constructor
- ControlPrimitive2D(basegfx::B2DHomMatrix aTransform,
- css::uno::Reference<css::awt::XControlModel> xControlModel);
-
- /** constructor with an additional XControl as parameter to allow to hand it over at incarnation time
+ /** constructor with an optional XControl as parameter to allow to hand it over at incarnation time
if it exists. This will avoid to create a 2nd one on demand in createXControl()
and thus double the XControls.
*/
ControlPrimitive2D(basegfx::B2DHomMatrix aTransform,
css::uno::Reference<css::awt::XControlModel> xControlModel,
- css::uno::Reference<css::awt::XControl> xXControl);
+ css::uno::Reference<css::awt::XControl> xXControl,
+ ::std::u16string_view rTitle, ::std::u16string_view rDescription);
/// data read access
const basegfx::B2DHomMatrix& getTransform() const { return maTransform; }
@@ -96,6 +96,8 @@ public:
*/
const css::uno::Reference<css::awt::XControl>& getXControl() const;
+ OUString const& GetAltText() const { return m_AltText; }
+
/// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const override;