summaryrefslogtreecommitdiff
path: root/svx/source/dialog/weldeditview.cxx
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2024-07-31 13:25:45 +0200
committerMichael Weghorn <m.weghorn@posteo.de>2024-08-02 06:47:12 +0200
commit57f6105c90019f6a2070ab52335d7a4e852466ff (patch)
tree17c2f38e763eef5f606a3d9dd2fd46a6fa51bbdf /svx/source/dialog/weldeditview.cxx
parent0dd7751df292f5135be13b13e74e415b20053c67 (diff)
tdf#155447 a11y: Set accessible ID for WeldEditView
Let `WeldEditAccessible` derive from `XAccessibleContext2` and implement `XAccessibleContext2::getAccessibleId` by returning the accessible ID set in the underlying drawing area. This makes an accessible ID of "sentence" show up in Accerciser for the corresponding edit view in Writer's spell check dialog when using the qt6 VCL plugin, since that is the ID set in the .ui file (cui/uiconfig/ui/spellingdialog.ui). It's not set for gtk3 yet, which uses native GTK widgets, and where the accessible ID is not set for the drawing area yet. Change-Id: I5cf8958118c84c01ecb3545381a05b306ca53163 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171320 Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Tested-by: Jenkins
Diffstat (limited to 'svx/source/dialog/weldeditview.cxx')
-rw-r--r--svx/source/dialog/weldeditview.cxx14
1 files changed, 12 insertions, 2 deletions
diff --git a/svx/source/dialog/weldeditview.cxx b/svx/source/dialog/weldeditview.cxx
index b24b00717cb8..14767992e9c2 100644
--- a/svx/source/dialog/weldeditview.cxx
+++ b/svx/source/dialog/weldeditview.cxx
@@ -24,7 +24,7 @@
#include <com/sun/star/accessibility/AccessibleStateType.hpp>
#include <com/sun/star/accessibility/XAccessible.hpp>
#include <com/sun/star/accessibility/XAccessibleComponent.hpp>
-#include <com/sun/star/accessibility/XAccessibleContext.hpp>
+#include <com/sun/star/accessibility/XAccessibleContext2.hpp>
#include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp>
#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
@@ -503,7 +503,7 @@ public:
typedef cppu::WeakImplHelper<css::lang::XServiceInfo, css::accessibility::XAccessible,
css::accessibility::XAccessibleComponent,
- css::accessibility::XAccessibleContext,
+ css::accessibility::XAccessibleContext2,
css::accessibility::XAccessibleEventBroadcaster>
WeldEditAccessibleBaseClass;
@@ -752,6 +752,16 @@ public:
return aRet;
}
+ virtual OUString SAL_CALL getAccessibleId() override
+ {
+ SolarMutexGuard aGuard;
+
+ if (m_pController)
+ return m_pController->GetAccessibleId();
+
+ return OUString();
+ }
+
virtual OUString SAL_CALL getAccessibleName() override
{
SolarMutexGuard aGuard;