summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiklas Johansson <sleeping.pillow@gmail.com>2015-01-16 12:51:52 +0100
committerCaolán McNamara <caolanm@redhat.com>2015-01-19 12:59:05 +0000
commit5346929ef8127e177a1bf86f47be69da0ad7603f (patch)
treeceaeb63c859573ea0f2ba9de2936bad9f15d1aac
parentc019c3d845d5281d206c2004985fb3b10a4707e9 (diff)
fdo#86674 paragraphs have ATK_STATE_INVALID
A few states have been added in the IA2 integration. These need to be handled somehow on linux as well. At the moment they all get the state INVALID. Let's add the state DEFAULT that already have a equivalent. The state MOVEABLE is causing the issues in paragraphs of LibreOffice Writer. The state is not invalid so let's avoid reporting it at all. There must be a cleaner way of doing this however. Reviewed-on: https://gerrit.libreoffice.org/13727 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit df5fa4082cfb17c5d5be6678995689485df6d429) Reviewed-on: https://gerrit.libreoffice.org/13947 (cherry picked from commit 3bde8657f50b88268ffb2693cc298411fcead005) Change-Id: I859439f92fe19f5050195383f43fa4af787b249e Reviewed-on: https://gerrit.libreoffice.org/13951 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--vcl/unx/gtk/a11y/atkwrapper.cxx11
1 files changed, 10 insertions, 1 deletions
diff --git a/vcl/unx/gtk/a11y/atkwrapper.cxx b/vcl/unx/gtk/a11y/atkwrapper.cxx
index a30bf1618a9c..8a0f8f00d99f 100644
--- a/vcl/unx/gtk/a11y/atkwrapper.cxx
+++ b/vcl/unx/gtk/a11y/atkwrapper.cxx
@@ -160,12 +160,16 @@ AtkStateType mapAtkState( sal_Int16 nState )
MAP_DIRECT( TRANSIENT );
MAP_DIRECT( VERTICAL );
MAP_DIRECT( VISIBLE );
+ MAP_DIRECT( DEFAULT );
// a spelling error ...
case accessibility::AccessibleStateType::DEFUNC:
type = ATK_STATE_DEFUNCT; break;
case accessibility::AccessibleStateType::MULTI_SELECTABLE:
type = ATK_STATE_MULTISELECTABLE; break;
default:
+ //Mis-use ATK_STATE_LAST_DEFINED to check if a state is unmapped
+ //NOTE! Do not report it
+ type = ATK_STATE_LAST_DEFINED;
break;
}
@@ -534,7 +538,12 @@ wrapper_ref_state_set( AtkObject *atk_obj )
uno::Sequence< sal_Int16 > aStates = xStateSet->getStates();
for( sal_Int32 n = 0; n < aStates.getLength(); n++ )
- atk_state_set_add_state( pSet, mapAtkState( aStates[n] ) );
+ {
+ // ATK_STATE_LAST_DEFINED is used to check if the state
+ // is unmapped, do not report it to Atk
+ if ( mapAtkState( aStates[n] ) != ATK_STATE_LAST_DEFINED )
+ atk_state_set_add_state( pSet, mapAtkState( aStates[n] ) );
+ }
// We need to emulate FOCUS state for menus, menu-items etc.
if( atk_obj == atk_get_focus_object() )