diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-02-19 10:58:04 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-02-19 11:07:12 +0000 |
commit | da13dd9a3513fa003b5a3537f6d1fb4e8ce23262 (patch) | |
tree | c7b4346206361e8e9d981196ef44abc2cc55e272 /accessibility | |
parent | coverity#738866 Uninitialized scalar field (diff) | |
download | core-da13dd9a3513fa003b5a3537f6d1fb4e8ce23262.tar.gz core-da13dd9a3513fa003b5a3537f6d1fb4e8ce23262.zip |
Related: fdo#74242 #i104470# we now have a seperate CARET_CHANGED event
so cursoring left and right in normal non-multiline edit widgets should
give a11y cursor-changed events
Change-Id: I91e86e43d049793912b3ffcc2802bb9aa4b3857c
Diffstat (limited to 'accessibility')
-rw-r--r-- | accessibility/source/standard/vclxaccessibleedit.cxx | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/accessibility/source/standard/vclxaccessibleedit.cxx b/accessibility/source/standard/vclxaccessibleedit.cxx index 20e4c862a895..b7e53761aa85 100644 --- a/accessibility/source/standard/vclxaccessibleedit.cxx +++ b/accessibility/source/standard/vclxaccessibleedit.cxx @@ -77,33 +77,30 @@ void VCLXAccessibleEdit::ProcessWindowEvent( const VclWindowEvent& rVclWindowEve SetText( implGetText() ); } break; - case VCLEVENT_EDIT_SELECTIONCHANGED: + case VCLEVENT_EDIT_CARETCHANGED: { sal_Int32 nOldCaretPosition = m_nCaretPosition; - sal_Int32 nOldSelectionStart = m_nSelectionStart; - m_nCaretPosition = getCaretPosition(); - m_nSelectionStart = getSelectionStart(); Window* pWindow = GetWindow(); - if ( pWindow && pWindow->HasChildPathFocus() ) + if (pWindow && pWindow->HasChildPathFocus()) { - if ( m_nCaretPosition != nOldCaretPosition ) + if (m_nCaretPosition != nOldCaretPosition) { Any aOldValue, aNewValue; - aOldValue <<= (sal_Int32) nOldCaretPosition; - aNewValue <<= (sal_Int32) m_nCaretPosition; + aOldValue <<= nOldCaretPosition; + aNewValue <<= m_nCaretPosition; NotifyAccessibleEvent( AccessibleEventId::CARET_CHANGED, aOldValue, aNewValue ); } - - // #i104470# VCL only has SELECTION_CHANGED, but UAA distinguishes between SELECTION_CHANGED and CARET_CHANGED - sal_Bool bHasSelection = ( m_nSelectionStart != m_nCaretPosition ); - sal_Bool bHadSelection = ( nOldSelectionStart != nOldCaretPosition ); - if ( ( bHasSelection != bHadSelection ) || ( bHasSelection && ( ( m_nCaretPosition != nOldCaretPosition ) || ( m_nSelectionStart != nOldSelectionStart ) ) ) ) - { - NotifyAccessibleEvent( AccessibleEventId::TEXT_SELECTION_CHANGED, Any(), Any() ); - } - + } + } + break; + case VCLEVENT_EDIT_SELECTIONCHANGED: + { + Window* pWindow = GetWindow(); + if (pWindow && pWindow->HasChildPathFocus()) + { + NotifyAccessibleEvent( AccessibleEventId::TEXT_SELECTION_CHANGED, Any(), Any() ); } } break; |