[Libreoffice-commits] core.git: svx/source toolkit/source
Arnaud Versini
arnaud.versini at gmail.com
Sun Apr 22 20:03:41 UTC 2018
svx/source/accessibility/AccessibleControlShape.cxx | 5 +++--
toolkit/source/awt/vclxaccessiblecomponent.cxx | 14 ++++++++------
2 files changed, 11 insertions(+), 8 deletions(-)
New commits:
commit 860de7575aa0c3079aac25634677248ac68c1f02
Author: Arnaud Versini <arnaud.versini at gmail.com>
Date: Sun Apr 22 16:34:49 2018 +0200
Reuse getAccessibleRole result if possible
Change-Id: I9566cd6f01a2e21f471d5ce96948ea635729c6f6
Reviewed-on: https://gerrit.libreoffice.org/53288
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/svx/source/accessibility/AccessibleControlShape.cxx b/svx/source/accessibility/AccessibleControlShape.cxx
index b97f164292cb..7c12cf570014 100644
--- a/svx/source/accessibility/AccessibleControlShape.cxx
+++ b/svx/source/accessibility/AccessibleControlShape.cxx
@@ -599,8 +599,9 @@ OUString AccessibleControlShape::CreateAccessibleName()
ensureControlModelAccess();
OUString sName;
- if ( getAccessibleRole() != AccessibleRole::SHAPE
- && getAccessibleRole() != AccessibleRole::RADIO_BUTTON )
+ sal_Int16 aAccessibleRole = getAccessibleRole();
+ if ( aAccessibleRole != AccessibleRole::SHAPE
+ && aAccessibleRole != AccessibleRole::RADIO_BUTTON )
{
AccessibleControlShape* pCtlAccShape = GetLabeledByControlShape();
if(pCtlAccShape)
diff --git a/toolkit/source/awt/vclxaccessiblecomponent.cxx b/toolkit/source/awt/vclxaccessiblecomponent.cxx
index 015fafabd425..aa86bb0c9606 100644
--- a/toolkit/source/awt/vclxaccessiblecomponent.cxx
+++ b/toolkit/source/awt/vclxaccessiblecomponent.cxx
@@ -201,12 +201,13 @@ void VCLXAccessibleComponent::ProcessWindowEvent( const VclWindowEvent& rVclWind
break;
case VclEventId::WindowActivate:
{
+ sal_Int16 aAccessibleRole = getAccessibleRole();
// avoid notification if a child frame is already active
// only one frame may be active at a given time
if ( !pAccWindow->HasActiveChildFrame() &&
- ( getAccessibleRole() == accessibility::AccessibleRole::FRAME ||
- getAccessibleRole() == accessibility::AccessibleRole::ALERT ||
- getAccessibleRole() == accessibility::AccessibleRole::DIALOG ) ) // #i18891#
+ ( aAccessibleRole == accessibility::AccessibleRole::FRAME ||
+ aAccessibleRole == accessibility::AccessibleRole::ALERT ||
+ aAccessibleRole == accessibility::AccessibleRole::DIALOG ) ) // #i18891#
{
aNewValue <<= accessibility::AccessibleStateType::ACTIVE;
NotifyAccessibleEvent( accessibility::AccessibleEventId::STATE_CHANGED, aOldValue, aNewValue );
@@ -215,9 +216,10 @@ void VCLXAccessibleComponent::ProcessWindowEvent( const VclWindowEvent& rVclWind
break;
case VclEventId::WindowDeactivate:
{
- if ( getAccessibleRole() == accessibility::AccessibleRole::FRAME ||
- getAccessibleRole() == accessibility::AccessibleRole::ALERT ||
- getAccessibleRole() == accessibility::AccessibleRole::DIALOG ) // #i18891#
+ sal_Int16 aAccessibleRole = getAccessibleRole();
+ if ( aAccessibleRole == accessibility::AccessibleRole::FRAME ||
+ aAccessibleRole == accessibility::AccessibleRole::ALERT ||
+ aAccessibleRole == accessibility::AccessibleRole::DIALOG ) // #i18891#
{
aOldValue <<= accessibility::AccessibleStateType::ACTIVE;
NotifyAccessibleEvent( accessibility::AccessibleEventId::STATE_CHANGED, aOldValue, aNewValue );
More information about the Libreoffice-commits
mailing list