diff options
author | Ivan Stefanenko <ivan.stefanenko@collabora.com> | 2020-11-07 22:14:00 +0300 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-11-09 07:02:53 +0100 |
commit | 59301a4ab8ffc1bb8d5516825627a9a371c640f0 (patch) | |
tree | a5291fdafe22ac7f30926874b9391f833ed76b90 /sw/source/core/access | |
parent | aec1c7eafd41aeb9740cb9088fb080bc1f2565ad (diff) |
tdf#138052 Added a check for fontworks.
Fontworks should be warned about coz they reprezent a stylized text,
which is hard to recognize for digital readers.
Check is added to checkObject() function as fontwork is an object.
Change-Id: I2ed5a5784dfe96bbf05ec7cf4c09dc97e1fb29d5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105436
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/core/access')
-rw-r--r-- | sw/source/core/access/AccessibilityCheck.cxx | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/sw/source/core/access/AccessibilityCheck.cxx b/sw/source/core/access/AccessibilityCheck.cxx index 3f97837d97d0..b2299ca36c59 100644 --- a/sw/source/core/access/AccessibilityCheck.cxx +++ b/sw/source/core/access/AccessibilityCheck.cxx @@ -35,6 +35,8 @@ #include <svx/swframetypes.hxx> #include <fmtanchr.hxx> #include <dcontact.hxx> +#include <svx/svdoashp.hxx> +#include <svx/sdasitm.hxx> namespace sw { @@ -876,6 +878,17 @@ void AccessibilityCheck::checkObject(SdrObject* pObject) if (!pObject) return; + // Check for fontworks. + if (SdrObjCustomShape* pCustomShape = dynamic_cast<SdrObjCustomShape*>(pObject)) + { + const SdrCustomShapeGeometryItem& rGeometryItem + = pCustomShape->GetMergedItem(SDRATTR_CUSTOMSHAPE_GEOMETRY); + + if (const uno::Any* pAny = rGeometryItem.GetPropertyValueByName("Type")) + if (pAny->get<OUString>().startsWith("fontwork-")) + lclAddIssue(m_aIssueCollection, SwResId(STR_FONTWORKS)); + } + // Checking if there is floating Writer text draw object and if so, throwing a warning. // (Floating objects with text create problems with reading order) if (pObject->HasText() |