diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2024-11-06 18:54:12 +0100 |
---|---|---|
committer | Michael Weghorn <m.weghorn@posteo.de> | 2024-11-07 08:50:13 +0100 |
commit | 92a36bbd4f3e9ad5d2741f55fe4ac7f03f7e2531 (patch) | |
tree | cca5a42833428cc1041100e476a3060f849ee369 /sc/source/ui/inc | |
parent | f0d8873f511a3eb951f50bc2ee2ed9b2a2cad4e4 (diff) |
[API CHANGE] a11y: Switch AccessibleRelationType to enum
Switch css::accessibility::AccessibleRelationType
from integer constants to an enum.
This provides more type safety and improves the debugging
experience, e.g. GDB now prints
com::sun::star::accessibility::AccessibleRelationType::AccessibleRelationType_CONTENT_FLOWS_TO
instead of just "2" when printing the value of a
corresponding variable, so it's no longer necessary
to manually look up what constant has that integer
value to know what relation this refers to.
offapi/com/sun/star/accessibility/AccessibleRelationType.idl
had this comment:
> <p>We are using constants instead of a more typesafe enum. The reason
> for this is that IDL enums may not be extended. Therefore, in order to
> include future extensions to the set of roles we have to use constants
> here.</p>
However, the a11y UNO API is internal (not published),
so that shouldn't be a concern.
Change-Id: I44a7d56cb085dc24effb24fcd34bb222b78ef4cd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176153
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
Diffstat (limited to 'sc/source/ui/inc')
-rw-r--r-- | sc/source/ui/inc/AccessibleCell.hxx | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sc/source/ui/inc/AccessibleCell.hxx b/sc/source/ui/inc/AccessibleCell.hxx index db6b4c3944fd..f5c3f8d2821f 100644 --- a/sc/source/ui/inc/AccessibleCell.hxx +++ b/sc/source/ui/inc/AccessibleCell.hxx @@ -22,6 +22,7 @@ #include <memory> #include "AccessibleCellBase.hxx" #include "viewdata.hxx" +#include <com/sun/star/accessibility/AccessibleRelationType.hpp> #include <com/sun/star/accessibility/XAccessibleExtendedAttributes.hpp> #include <rtl/ref.hxx> #include <editeng/AccessibleStaticTextBase.hxx> @@ -36,6 +37,8 @@ class ScAccessibleDocument; typedef cppu::ImplHelper1< css::accessibility::XAccessibleExtendedAttributes> ScAccessibleCellAttributeImpl; +using css::accessibility::AccessibleRelationType; + /** @descr This base class provides an implementation of the <code>AccessibleCell</code> service. @@ -152,10 +155,10 @@ private: void FillDependents(utl::AccessibleRelationSetHelper* pRelationSet); void FillPrecedents(utl::AccessibleRelationSetHelper* pRelationSet); void AddRelation(const ScAddress& rCell, - const sal_uInt16 aRelationType, + const AccessibleRelationType eRelationType, ::utl::AccessibleRelationSetHelper* pRelationSet); void AddRelation(const ScRange& rRange, - const sal_uInt16 aRelationType, + const AccessibleRelationType eRelationType, ::utl::AccessibleRelationSetHelper* pRelationSet); bool IsFormulaMode(); bool IsDropdown() const; |