summaryrefslogtreecommitdiff
path: root/vcl/qt5
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2022-08-22 12:10:17 +0200
committerMichael Weghorn <m.weghorn@posteo.de>2022-08-22 14:42:49 +0200
commit2523b5451507c53bb3a10350e016651db82eb1d1 (patch)
treef489a18b6ab494fd3cd3f8d110451b3760f410a6 /vcl/qt5
parent17ec3096fc20439bed33ed28c627296d8f80f3b9 (diff)
qt a11y: Don't set invalid Qt relations
When no matching relation type is found when when trying to match LO's `AccessibleRelationType` to a corresponding Qt equivalent, don't set an invalid value, but skip this relation. Previously, when navigating to a Writer paragraph with the qt6 VCL plugin and Orca enabled, this would show up on stderr: warn:vcl.qt:220606:220606:vcl/qt6/../qt5/QtAccessibleWidget.cxx:218: Unmatched relation: 1 warn:vcl.qt:220606:220606:vcl/qt6/../qt5/QtAccessibleWidget.cxx:218: Unmatched relation: 2 Cannot return AT-SPI relation for: QFlags() Cannot return AT-SPI relation for: QFlags() This addresses the warnings emitted by the Qt library (lines 3 and 4). The first two warnings are from LO and remain for now, as long as Qt does not implement an equivalent for `AccessibleRelationType::CONTENT_FLOWS_FROM` and `AccessibleRelationType::CONTENT_FLOWS_TO`. Change-Id: If2cb5394b27d23926e4d4093ba8ab477997a16ad Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138671 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'vcl/qt5')
-rw-r--r--vcl/qt5/QtAccessibleWidget.cxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/vcl/qt5/QtAccessibleWidget.cxx b/vcl/qt5/QtAccessibleWidget.cxx
index e9106f32785a..6bef5de36473 100644
--- a/vcl/qt5/QtAccessibleWidget.cxx
+++ b/vcl/qt5/QtAccessibleWidget.cxx
@@ -242,6 +242,10 @@ void lcl_appendRelation(QVector<QPair<QAccessibleInterface*, QAccessible::Relati
AccessibleRelation aRelation)
{
QAccessible::Relation aQRelation = lcl_matchUnoRelation(aRelation.RelationType);
+ // skip in case there's no matching Qt relation
+ if (!(aQRelation & QAccessible::AllRelations))
+ return;
+
sal_uInt32 nTargetCount = aRelation.TargetSet.getLength();
for (sal_uInt32 i = 0; i < nTargetCount; i++)