diff options
-rw-r--r-- | svtools/source/contnr/imivctl1.cxx | 8 | ||||
-rw-r--r-- | svtools/source/contnr/svtabbx.cxx | 11 | ||||
-rw-r--r-- | svtools/source/contnr/svtreebx.cxx | 16 | ||||
-rw-r--r-- | toolkit/source/helper/unowrapper.cxx | 8 | ||||
-rw-r--r-- | vcl/inc/vcl/vclevent.hxx | 4 | ||||
-rw-r--r-- | vcl/source/window/dlgctrl.cxx | 65 | ||||
-rw-r--r-- | vcl/source/window/taskpanelist.cxx | 28 | ||||
-rw-r--r-- | vcl/unx/gtk/a11y/atklistener.cxx | 26 | ||||
-rw-r--r-- | vcl/unx/gtk/a11y/atktext.cxx | 11 | ||||
-rw-r--r-- | vcl/unx/gtk/a11y/atkutil.cxx | 31 |
10 files changed, 178 insertions, 30 deletions
diff --git a/svtools/source/contnr/imivctl1.cxx b/svtools/source/contnr/imivctl1.cxx index da75608a38b3..954c8a7ca179 100644 --- a/svtools/source/contnr/imivctl1.cxx +++ b/svtools/source/contnr/imivctl1.cxx @@ -540,7 +540,13 @@ void SvxIconChoiceCtrl_Impl::EntrySelected( SvxIconChoiceCtrlEntry* pEntry, BOOL ShowCursor( TRUE ); } // if( bUpdateMode ) - CallEventListeners( VCLEVENT_LISTBOX_SELECT, pEntry ); + // --> OD 2009-05-27 #i101012# + // emit vcl event LISTBOX_SELECT only in case that the given entry is selected. + if ( bSelect ) + { + CallEventListeners( VCLEVENT_LISTBOX_SELECT, pEntry ); + } + // <-- } void SvxIconChoiceCtrl_Impl::ResetVirtSize() diff --git a/svtools/source/contnr/svtabbx.cxx b/svtools/source/contnr/svtabbx.cxx index fc02c85dfd25..1770810c7a5d 100644 --- a/svtools/source/contnr/svtabbx.cxx +++ b/svtools/source/contnr/svtabbx.cxx @@ -989,7 +989,7 @@ Reference< XAccessible > SvHeaderTabListBox::CreateAccessibleCell( sal_Int32 _nR m_aAccessibleChildren.assign( nCount, Reference< XAccessible >() ); } - nIndex = ( _nRow * GetColumnCount() ) + _nColumnPos + GetColumnCount(); + nIndex = ( _nRow * nColumnCount ) + _nColumnPos + nColumnCount; xChild = m_aAccessibleChildren[ nIndex ]; } @@ -1084,15 +1084,10 @@ sal_Bool SvHeaderTabListBox::ConvertPointToColumnHeader( sal_uInt16&, const Poin switch( _eType ) { case ::svt::BBTYPE_BROWSEBOX: - aRetText = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "HeaderTabListBox" ) ); - break; - case ::svt::BBTYPE_TABLE: - aRetText = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "HeaderTabListBoxTable" ) ); - break; - case ::svt::BBTYPE_COLUMNHEADERBAR: - aRetText = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ColumnHeaderBar of HeaderTabListBox" ) ); + // should be empty now (see #i63983) + aRetText = ::rtl::OUString(); break; case ::svt::BBTYPE_TABLECELL: diff --git a/svtools/source/contnr/svtreebx.cxx b/svtools/source/contnr/svtreebx.cxx index 200dd30eda1a..a697928842af 100644 --- a/svtools/source/contnr/svtreebx.cxx +++ b/svtools/source/contnr/svtreebx.cxx @@ -1040,6 +1040,14 @@ BOOL SvTreeListBox::Expand( SvLBoxEntry* pParent ) pParent->SetFlags( nFlags ); GetModel()->InvalidateEntry( pParent ); // neu zeichnen } + + // --> OD 2009-04-01 #i92103# + if ( bExpanded ) + { + pImp->CallEventListeners( VCLEVENT_LISTBOX_ENTRY_EXPANDED, pParent ); + } + // <-- + return bExpanded; } @@ -1059,6 +1067,14 @@ BOOL SvTreeListBox::Collapse( SvLBoxEntry* pParent ) pHdlEntry = pParent; ExpandedHdl(); } + + // --> OD 2009-04-01 #i92103# + if ( bCollapsed ) + { + pImp->CallEventListeners( VCLEVENT_LISTBOX_ENTRY_COLLAPSED, pParent ); + } + // <-- + return bCollapsed; } diff --git a/toolkit/source/helper/unowrapper.cxx b/toolkit/source/helper/unowrapper.cxx index a652d493e653..96b8908558a7 100644 --- a/toolkit/source/helper/unowrapper.cxx +++ b/toolkit/source/helper/unowrapper.cxx @@ -65,6 +65,13 @@ using namespace ::com::sun::star; case WINDOW_OKBUTTON: case WINDOW_CANCELBUTTON: return new VCLXButton; case WINDOW_CHECKBOX: return new VCLXCheckBox; + // --> OD 2009-06-29 #i95042# + // A Window of type <MetricBox> is inherited from type <ComboBox>. + // Thus, it does make more sense to return a <VCLXComboBox> instance + // instead of only a <VCLXWindow> instance, especially regarding its + // corresponding accessibility API. + case WINDOW_METRICBOX: + // <-- case WINDOW_COMBOBOX: return new VCLXComboBox; case WINDOW_SPINFIELD: case WINDOW_NUMERICFIELD: @@ -109,7 +116,6 @@ using namespace ::com::sun::star; // case WINDOW_DATEBOX: // case WINDOW_GROUPBOX: // case WINDOW_LONGCURRENCYBOX: - // case WINDOW_METRICBOX: // case WINDOW_SPLITTER: // case WINDOW_STATUSBAR: // case WINDOW_TABCONTROL: diff --git a/vcl/inc/vcl/vclevent.hxx b/vcl/inc/vcl/vclevent.hxx index 88ad880e26ab..a28127dd6f82 100644 --- a/vcl/inc/vcl/vclevent.hxx +++ b/vcl/inc/vcl/vclevent.hxx @@ -146,6 +146,10 @@ class Menu; #define VCLEVENT_ROADMAP_ITEMSELECTED 1171 #define VCLEVENT_TOOLBOX_FORMATCHANGED 1172 // request new layout #define VCLEVENT_COMBOBOX_SETTEXT 1173 +// --> OD 2009-04-01 #i92103# +#define VCLEVENT_LISTBOX_ENTRY_EXPANDED 1174 +#define VCLEVENT_LISTBOX_ENTRY_COLLAPSED 1175 +// <-- // VclMenuEvent #define VCLEVENT_MENU_ACTIVATE 1200 diff --git a/vcl/source/window/dlgctrl.cxx b/vcl/source/window/dlgctrl.cxx index 392c2ceaa478..c6f64d74c5fc 100644 --- a/vcl/source/window/dlgctrl.cxx +++ b/vcl/source/window/dlgctrl.cxx @@ -46,10 +46,41 @@ using namespace ::com::sun::star; // ======================================================================= +static BOOL ImplHasIndirectTabParent( Window* pWindow ) +{ + // The window has inderect tab parent if it is included in tab hierarchy + // of the indirect parent window + + return ( pWindow && pWindow->GetParent() + && ( pWindow->GetParent()->ImplGetWindow()->GetStyle() & WB_CHILDDLGCTRL ) ); +} + +// ----------------------------------------------------------------------- + +static Window* ImplGetTopParentOfTabHierarchy( Window* pParent ) +{ + // The method allows to find the most close parent containing all the + // window from the current tab-hierarchy + // The direct parent should be provided as a parameter here + + Window* pResult = pParent; + + if ( pResult ) + { + while ( pResult->GetParent() && ( pResult->ImplGetWindow()->GetStyle() & WB_CHILDDLGCTRL ) ) + pResult = pResult->GetParent(); + } + + return pResult; +} + +// ----------------------------------------------------------------------- + static Window* ImplGetSubChildWindow( Window* pParent, USHORT n, USHORT& nIndex ) { Window* pTabPage = NULL; Window* pFoundWindow = NULL; + Window* pWindow = pParent->GetWindow( WINDOW_FIRSTCHILD ); Window* pNextWindow = pWindow; while ( pWindow ) @@ -96,7 +127,8 @@ static Window* ImplGetSubChildWindow( Window* pParent, USHORT n, USHORT& nIndex } } } - else if ( pWindow->GetStyle() & WB_DIALOGCONTROL ) + else if ( ( pWindow->GetStyle() & WB_DIALOGCONTROL ) + || ( pWindow->GetStyle() & WB_CHILDDLGCTRL ) ) pFoundWindow = ImplGetSubChildWindow( pWindow, n, nIndex ); } @@ -122,6 +154,8 @@ static Window* ImplGetSubChildWindow( Window* pParent, USHORT n, USHORT& nIndex static Window* ImplGetChildWindow( Window* pParent, USHORT n, USHORT& nIndex, BOOL bTestEnable ) { + pParent = ImplGetTopParentOfTabHierarchy( pParent ); + nIndex = 0; Window* pWindow = ImplGetSubChildWindow( pParent, n, nIndex ); if ( bTestEnable ) @@ -284,14 +318,16 @@ static Window* ImplFindDlgCtrlWindow( Window* pParent, Window* pWindow, USHORT& USHORT nFormEnd; // Focus-Fenster in der Child-Liste suchen - pSWindow = ImplGetChildWindow( pParent, 0, i, FALSE ); + Window* pFirstChildWindow = pSWindow = ImplGetChildWindow( pParent, 0, i, FALSE ); if( pWindow == NULL ) pWindow = pSWindow; while ( pSWindow ) { - if ( pSWindow->ImplGetWindow()->IsDialogControlStart() ) + // the DialogControlStart mark is only accepted for the direct children + if ( !ImplHasIndirectTabParent( pSWindow ) + && pSWindow->ImplGetWindow()->IsDialogControlStart() ) nFormStart = i; // SecondWindow wegen zusammengesetzten Controls wie @@ -331,12 +367,33 @@ static Window* ImplFindDlgCtrlWindow( Window* pParent, Window* pWindow, USHORT& // Formularende suchen nFormEnd = nFormStart; pTempWindow = pSWindow; + sal_Int32 nIteration = 0; do { nFormEnd = i; pTempWindow = ImplGetNextWindow( pParent, i, i, FALSE ); - if ( !i || (pTempWindow && pTempWindow->ImplGetWindow()->IsDialogControlStart()) ) + + // the DialogControlStart mark is only accepted for the direct children + if ( !i + || ( pTempWindow && !ImplHasIndirectTabParent( pTempWindow ) + && pTempWindow->ImplGetWindow()->IsDialogControlStart() ) ) break; + + if ( pTempWindow && pTempWindow == pFirstChildWindow ) + { + // It is possible to go through the begin of hierarchy once + // while looking for DialogControlStart mark. + // If it happens second time, it looks like an endless loop, + // that should be impossible, but just for the case... + nIteration++; + if ( nIteration >= 2 ) + { + // this is an unexpected scenario + DBG_ASSERT( FALSE, "It seems to be an endless loop!" ); + rFormStart = 0; + break; + } + } } while ( pTempWindow ); rFormEnd = nFormEnd; diff --git a/vcl/source/window/taskpanelist.cxx b/vcl/source/window/taskpanelist.cxx index bae6d99430f0..d1e598532b88 100644 --- a/vcl/source/window/taskpanelist.cxx +++ b/vcl/source/window/taskpanelist.cxx @@ -197,18 +197,21 @@ BOOL TaskPaneList::HandleKeyEvent( KeyEvent aKeyEvent ) { // F6 cycles through everything and works always - // Ctrl-TAB cycles through Menubar, Toolbars and Floatingwindows only and is - // only active if one of those items has the focus - BOOL bF6 = FALSE; + + // MAV, #i104204# + // The old design was the following one: + // < Ctrl-TAB cycles through Menubar, Toolbars and Floatingwindows only and is + // < only active if one of those items has the focus + // + // Since the design of Ctrl-Tab looks to be inconsistent ( non-modal dialogs are not reachable + // and the shortcut conflicts with tab-control shortcut ), it is no more supported BOOL bSplitterOnly = FALSE; BOOL bFocusInList = FALSE; KeyCode aKeyCode = aKeyEvent.GetKeyCode(); BOOL bForward = !aKeyCode.IsShift(); - if( ( (aKeyCode.IsMod1() || aKeyCode.IsMod2()) && aKeyCode.GetCode() == KEY_TAB ) // Ctrl-TAB or Alt-TAB - || ( bF6 = ( aKeyCode.GetCode()) == KEY_F6 ) != FALSE // F6 - ) + if( aKeyCode.GetCode() == KEY_F6 ) // F6 { - bSplitterOnly = bF6 && aKeyCode.IsMod1() && aKeyCode.IsShift(); + bSplitterOnly = aKeyCode.IsMod1() && aKeyCode.IsShift(); // is the focus in the list ? ::std::vector< Window* >::iterator p = mTaskPanes.begin(); @@ -219,12 +222,8 @@ BOOL TaskPaneList::HandleKeyEvent( KeyEvent aKeyEvent ) { bFocusInList = TRUE; - // Ctrl-TAB does not work in Dialogs - if( !bF6 && pWin->IsDialog() ) - return FALSE; - // Ctrl-F6 goes directly to the document - if( !pWin->IsDialog() && bF6 && aKeyCode.IsMod1() && !aKeyCode.IsShift() ) + if( !pWin->IsDialog() && aKeyCode.IsMod1() && !aKeyCode.IsShift() ) { pWin->GrabFocusToDocument(); return TRUE; @@ -236,7 +235,8 @@ BOOL TaskPaneList::HandleKeyEvent( KeyEvent aKeyEvent ) if( bSplitterOnly ) pNextWin = FindNextSplitter( *p, TRUE ); else - pNextWin = bF6 ? FindNextFloat( *p, bForward ) : FindNextPane( *p, bForward ); + pNextWin = FindNextFloat( *p, bForward ); + if( pNextWin != pWin ) { ImplGetSVData()->maWinData.mbNoSaveFocus = TRUE; @@ -261,7 +261,7 @@ BOOL TaskPaneList::HandleKeyEvent( KeyEvent aKeyEvent ) } // the focus is not in the list: activate first float if F6 was pressed - if( !bFocusInList && bF6 ) + if( !bFocusInList ) { Window *pWin; if( bSplitterOnly ) diff --git a/vcl/unx/gtk/a11y/atklistener.cxx b/vcl/unx/gtk/a11y/atklistener.cxx index c3b2859f7c3f..f083e7cc584e 100644 --- a/vcl/unx/gtk/a11y/atklistener.cxx +++ b/vcl/unx/gtk/a11y/atklistener.cxx @@ -360,6 +360,32 @@ void AtkListener::notifyEvent( const accessibility::AccessibleEventObject& aEven break; } + // --> OD 2009-05-26 #i92103# + case accessibility::AccessibleEventId::LISTBOX_ENTRY_EXPANDED: + { + AtkObject *pChild = getObjFromAny( aEvent.NewValue ); + if( pChild ) + { + AtkStateType eExpandedState = ATK_STATE_EXPANDED; + atk_object_notify_state_change( pChild, eExpandedState, true ); + g_object_unref( pChild ); + } + break; + } + + case accessibility::AccessibleEventId::LISTBOX_ENTRY_COLLAPSED: + { + AtkObject *pChild = getObjFromAny( aEvent.NewValue ); + if( pChild ) + { + AtkStateType eExpandedState = ATK_STATE_EXPANDED; + atk_object_notify_state_change( pChild, eExpandedState, false ); + g_object_unref( pChild ); + } + break; + } + // <-- + // AtkAction signals ... case accessibility::AccessibleEventId::ACTION_CHANGED: g_signal_emit_by_name( G_OBJECT( atk_obj ), "property_change::accessible-actions"); diff --git a/vcl/unx/gtk/a11y/atktext.cxx b/vcl/unx/gtk/a11y/atktext.cxx index 1c839ed58839..8bdfe1706962 100644 --- a/vcl/unx/gtk/a11y/atktext.cxx +++ b/vcl/unx/gtk/a11y/atktext.cxx @@ -442,13 +442,20 @@ text_wrapper_get_run_attributes( AtkText *text, pTextAttributes->getRunAttributes( offset, uno::Sequence< rtl::OUString > () ); pSet = attribute_set_new_from_property_values( aAttributeList, true, text ); - if( pSet ) + // --> OD 2009-06-22 #i100938# + // - always provide start_offset and end_offset +// if( pSet ) + // <-- { accessibility::TextSegment aTextSegment = pText->getTextAtIndex(offset, accessibility::AccessibleTextType::ATTRIBUTE_RUN); *start_offset = aTextSegment.SegmentStart; - *end_offset = aTextSegment.SegmentEnd + 1; // FIXME: TESTME + // --> OD 2009-06-22 #i100938# + // Do _not_ increment the end_offset provide by <accessibility::TextSegment> instance +// *end_offset = aTextSegment.SegmentEnd + 1; // FIXME: TESTME + *end_offset = aTextSegment.SegmentEnd; + // <-- } } } diff --git a/vcl/unx/gtk/a11y/atkutil.cxx b/vcl/unx/gtk/a11y/atkutil.cxx index 91f4b3280448..5206c8ce87ca 100644 --- a/vcl/unx/gtk/a11y/atkutil.cxx +++ b/vcl/unx/gtk/a11y/atkutil.cxx @@ -36,6 +36,9 @@ #include <com/sun/star/accessibility/XAccessibleSelection.hpp> #include <com/sun/star/accessibility/AccessibleEventId.hpp> #include <com/sun/star/accessibility/AccessibleStateType.hpp> +// --> OD 2009-04-14 #i93269# +#include <com/sun/star/accessibility/XAccessibleText.hpp> +// <-- #include <cppuhelper/implbase1.hxx> #include <vos/mutex.hxx> #include <rtl/ref.hxx> @@ -86,6 +89,34 @@ atk_wrapper_focus_idle_handler (gpointer data) fprintf(stderr, "notifying focus event for %p\n", atk_obj); #endif atk_focus_tracker_notify(atk_obj); + // --> OD 2009-04-14 #i93269# + // emit text_caret_moved event for <XAccessibleText> object, + // if cursor is inside the <XAccessibleText> object. + // also emit state-changed:focused event under the same condition. + { + AtkObjectWrapper* wrapper_obj = ATK_OBJECT_WRAPPER (atk_obj); + if( !wrapper_obj->mpText && wrapper_obj->mpContext ) + { + uno::Any any = wrapper_obj->mpContext->queryInterface( accessibility::XAccessibleText::static_type(NULL) ); + if ( typelib_TypeClass_INTERFACE == any.pType->eTypeClass && + any.pReserved != 0 ) + { + wrapper_obj->mpText = reinterpret_cast< accessibility::XAccessibleText * > (any.pReserved); + if ( wrapper_obj->mpText != 0 ) + { + wrapper_obj->mpText->acquire(); + gint caretPos = wrapper_obj->mpText->getCaretPosition(); + + if ( caretPos != -1 ) + { + atk_object_notify_state_change( atk_obj, ATK_STATE_FOCUSED, TRUE ); + g_signal_emit_by_name( atk_obj, "text_caret_moved", caretPos ); + } + } + } + } + } + // <-- g_object_unref(atk_obj); } } |