diff options
author | Frank Schoenheit [fs] <frank.schoenheit@sun.com> | 2010-04-01 17:52:36 +0200 |
---|---|---|
committer | Frank Schoenheit [fs] <frank.schoenheit@sun.com> | 2010-04-01 17:52:36 +0200 |
commit | 8187d63ccda9c2cb184ce055f6c42577546d6251 (patch) | |
tree | c64ed0f73b4787fc16046d69954f3cd3ccc6d746 /svtools | |
parent | a42067c4fd10629bd6b1f3a301b1e8eab5542584 (diff) |
slidecopy: improved A11Y API implementations for the ToolPanelDeck
items left:
- A11Y representation of the scroll buttons of the PanelTabBar
- AccessibleToolPanelTabBar event notifications
- consolidate AccessibleToolPanelDeck/TabBar/Item?
Diffstat (limited to 'svtools')
-rwxr-xr-x | svtools/inc/svtools/accessiblefactory.hxx | 11 | ||||
-rwxr-xr-x | svtools/inc/svtools/toolpanel/decklayouter.hxx | 18 | ||||
-rw-r--r--[-rwxr-xr-x] | svtools/inc/svtools/toolpanel/paneltabbar.hxx (renamed from svtools/source/toolpanel/paneltabbar.hxx) | 20 | ||||
-rwxr-xr-x | svtools/inc/svtools/toolpanel/tablayouter.hxx | 8 | ||||
-rwxr-xr-x | svtools/inc/svtools/toolpanel/toolpaneldeck.hxx | 3 | ||||
-rwxr-xr-x | svtools/source/misc/svtaccessiblefactory.cxx | 8 | ||||
-rwxr-xr-x | svtools/source/toolpanel/makefile.mk | 1 | ||||
-rwxr-xr-x | svtools/source/toolpanel/paneltabbar.cxx | 70 | ||||
-rw-r--r-- | svtools/source/toolpanel/paneltabbarpeer.cxx | 101 | ||||
-rw-r--r-- | svtools/source/toolpanel/paneltabbarpeer.hxx | 69 | ||||
-rw-r--r-- | svtools/source/toolpanel/tabbargeometry.cxx | 5 | ||||
-rwxr-xr-x | svtools/source/toolpanel/tablayouter.cxx | 24 |
12 files changed, 274 insertions, 64 deletions
diff --git a/svtools/inc/svtools/accessiblefactory.hxx b/svtools/inc/svtools/accessiblefactory.hxx index ab5eb595f76f..f67232b2faad 100755 --- a/svtools/inc/svtools/accessiblefactory.hxx +++ b/svtools/inc/svtools/accessiblefactory.hxx @@ -65,7 +65,8 @@ namespace svt //........................................................................ class ToolPanelDeck; - class TabDeckLayouter; + class IToolPanelDeck; + class PanelTabBar; /** a function which is able to create a factory for the standard Accessible/Context components needed for standard toolkit controls @@ -174,11 +175,11 @@ namespace svt const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& i_rAccessibleParent, ::svt::ToolPanelDeck& i_rPanelDeck ) = 0; - virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > - createAccessibleToolPanelDeckTabBarItem( + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > + createAccessibleToolPanelTabBar( const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& i_rAccessibleParent, - const ::rtl::Reference< ::svt::TabDeckLayouter >& i_pLayouter, - const size_t i_nItemPos + ::svt::IToolPanelDeck& i_rPanelDeck, + ::svt::PanelTabBar& i_rTabBar ) = 0; }; diff --git a/svtools/inc/svtools/toolpanel/decklayouter.hxx b/svtools/inc/svtools/toolpanel/decklayouter.hxx index 1542797a77b8..da03d7c6c3aa 100755 --- a/svtools/inc/svtools/toolpanel/decklayouter.hxx +++ b/svtools/inc/svtools/toolpanel/decklayouter.hxx @@ -74,19 +74,19 @@ namespace svt */ virtual void SetFocusToPanelSelector() = 0; - /** assuming that tools panels, no matter whether currently active or inactive, are visually represented - by some item, this method is to retrieve the position of an item for a given screen location. + /** returns the number of components in the XAccessible hierarchy which are needed to represent all elements + the layouter is responsible form. + + Note that the implementation must guarantee that the count is fixed over the life time of the layouter. */ - virtual ::boost::optional< size_t > - GetPanelItemFromScreenPos( const ::Point& i_rScreenPos ) = 0; + virtual size_t GetAccessibleChildCount() const = 0; - /** assuming that tools panels, no matter whether currently active or inactive, are visually represented - by some item, this method is to retrieve the XAccessible implementation for such an item, given - by panel position. + /** retrieves the XAccessible implementation for the <code>i_nChildIndex</code>'th child in the XAccessible + hierarchy. */ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > - GetPanelItemAccessible( - const size_t i_nItemPos, + GetAccessibleChild( + const size_t i_nChildIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& i_rParentAccessible ) = 0; diff --git a/svtools/source/toolpanel/paneltabbar.hxx b/svtools/inc/svtools/toolpanel/paneltabbar.hxx index 9de726cc1e58..3eb9e7a5624d 100755..100644 --- a/svtools/source/toolpanel/paneltabbar.hxx +++ b/svtools/inc/svtools/toolpanel/paneltabbar.hxx @@ -23,15 +23,18 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ -#ifndef PANELTABBAR_HXX -#define PANELTABBAR_HXX +#ifndef SVT_PANELTABBAR_HXX +#define SVT_PANELTABBAR_HXX + +#include "svtools/svtdllapi.h" #include "svtools/toolpanel/tabalignment.hxx" #include "svtools/toolpanel/tabitemcontent.hxx" #include <vcl/ctrl.hxx> #include <memory> +#include <boost/optional.hpp> //........................................................................ namespace svt @@ -39,6 +42,7 @@ namespace svt //........................................................................ class PanelTabBar_Impl; + class IToolPanelDeck; //==================================================================== //= PanelTabBar @@ -48,7 +52,7 @@ namespace svt At the moment, this control aligns the tabs vertically, this might be extended to also support a horizontal layout in the future. */ - class PanelTabBar : public Control + class SVT_DLLPUBLIC PanelTabBar : public Control { public: PanelTabBar( Window& i_rParentWindow, IToolPanelDeck& i_rPanelDeck, const TabAlignment i_eAlignment, const TabItemContent i_eItemContent ); @@ -58,8 +62,11 @@ namespace svt TabItemContent GetTabItemContent() const; void SetTabItemContent( const TabItemContent& i_eItemContent ); + bool IsVertical() const; + + IToolPanelDeck& GetPanelDeck() const; + // operations - ::boost::optional< size_t > FindItemForPoint( const Point& i_rPoint ) const; ::boost::optional< size_t > GetFocusedPanelItem() const; void FocusPanelItem( const size_t i_nItemPos ); Rectangle GetItemScreenRect( const size_t i_nItemPos ) const; @@ -77,6 +84,9 @@ namespace svt virtual void KeyInput( const KeyEvent& i_rKeyEvent ); virtual void DataChanged( const DataChangedEvent& i_rDataChanedEvent ); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > + GetComponentInterface( BOOL i_bCreate ); + private: ::std::auto_ptr< PanelTabBar_Impl > m_pImpl; }; @@ -85,5 +95,5 @@ namespace svt } // namespace svt //........................................................................ -#endif // PANELTABBAR_HXX +#endif // SVT_PANELTABBAR_HXX diff --git a/svtools/inc/svtools/toolpanel/tablayouter.hxx b/svtools/inc/svtools/toolpanel/tablayouter.hxx index 9d4b56db649c..92b36acf9114 100755 --- a/svtools/inc/svtools/toolpanel/tablayouter.hxx +++ b/svtools/inc/svtools/toolpanel/tablayouter.hxx @@ -80,7 +80,6 @@ namespace svt TabAlignment GetTabAlignment() const; // helpers for the A11Y implementation - IToolPanelDeck& GetPanelDeck() const; ::boost::optional< size_t > GetFocusedPanelItem() const; void FocusPanelItem( const size_t i_nItemPos ); @@ -92,11 +91,10 @@ namespace svt virtual Rectangle Layout( const Rectangle& i_rDeckPlayground ); virtual void Destroy(); virtual void SetFocusToPanelSelector(); - virtual ::boost::optional< size_t > - GetPanelItemFromScreenPos( const ::Point& i_rScreenPos ); + virtual size_t GetAccessibleChildCount() const; virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > - GetPanelItemAccessible( - const size_t i_nItemPos, + GetAccessibleChild( + const size_t i_nChildIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& i_rParentAccessible ); diff --git a/svtools/inc/svtools/toolpanel/toolpaneldeck.hxx b/svtools/inc/svtools/toolpanel/toolpaneldeck.hxx index 911857f46150..358464211255 100755 --- a/svtools/inc/svtools/toolpanel/toolpaneldeck.hxx +++ b/svtools/inc/svtools/toolpanel/toolpaneldeck.hxx @@ -175,7 +175,8 @@ namespace svt virtual long Notify( NotifyEvent& i_rNotifyEvent ); virtual void GetFocus(); - ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > GetComponentInterface( BOOL i_bCreate ); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > + GetComponentInterface( BOOL i_bCreate ); private: ::std::auto_ptr< ToolPanelDeck_Impl > m_pImpl; diff --git a/svtools/source/misc/svtaccessiblefactory.cxx b/svtools/source/misc/svtaccessiblefactory.cxx index 8a45ee2e0b74..b21e33a9c6e4 100755 --- a/svtools/source/misc/svtaccessiblefactory.cxx +++ b/svtools/source/misc/svtaccessiblefactory.cxx @@ -221,11 +221,11 @@ namespace svt { return NULL; } - virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > - createAccessibleToolPanelDeckTabBarItem( + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > + createAccessibleToolPanelTabBar( const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& /*i_rAccessibleParent*/, - const ::rtl::Reference< ::svt::TabDeckLayouter >& /*i_pLayouter*/, - const size_t /*i_nItemPos*/ + ::svt::IToolPanelDeck& /*i_rPanelDeck*/, + ::svt::PanelTabBar& /*i_rTabBar*/ ) { return NULL; diff --git a/svtools/source/toolpanel/makefile.mk b/svtools/source/toolpanel/makefile.mk index 5efaf6fe0af3..408d8eeb87b2 100755 --- a/svtools/source/toolpanel/makefile.mk +++ b/svtools/source/toolpanel/makefile.mk @@ -47,6 +47,7 @@ SLOFILES=\ $(SLO)$/dummypanel.obj \ $(SLO)$/paneldecklisteners.obj \ $(SLO)$/paneltabbar.obj \ + $(SLO)$/paneltabbarpeer.obj \ $(SLO)$/refbase.obj \ $(SLO)$/tabbargeometry.obj \ $(SLO)$/tablayouter.obj \ diff --git a/svtools/source/toolpanel/paneltabbar.cxx b/svtools/source/toolpanel/paneltabbar.cxx index f9a40004cb61..9fe193d9ac4f 100755 --- a/svtools/source/toolpanel/paneltabbar.cxx +++ b/svtools/source/toolpanel/paneltabbar.cxx @@ -26,9 +26,11 @@ #include "precompiled_svtools.hxx" +#include "svtools/toolpanel/paneltabbar.hxx" + #include "svtools/toolpanel/toolpaneldeck.hxx" #include "tabitemdescriptor.hxx" -#include "paneltabbar.hxx" +#include "paneltabbarpeer.hxx" #include "tabbargeometry.hxx" #include <vcl/button.hxx> @@ -51,6 +53,9 @@ namespace svt { //........................................................................ + using ::com::sun::star::uno::Reference; + using ::com::sun::star::awt::XWindowPeer; + typedef sal_uInt16 ItemFlags; #define ITEM_STATE_NORMAL 0x00 @@ -385,6 +390,8 @@ namespace svt Rectangle GetActualLogicalItemRect( const Rectangle& i_rLogicalItemRect ) const; Rectangle GetItemScreenRect( const size_t i_nItemPos ) const; + void FocusItem( const ::boost::optional< size_t >& i_rItemPos ); + inline bool IsVertical() const { return ( ( m_eTabAlignment == TABS_LEFT ) @@ -546,9 +553,9 @@ namespace svt Rectangle aContentArea; - Size aCompleteSize( impl_calculateItemContentSize( pPanel, TABITEM_IMAGE_AND_TEXT ) ); - Size aIconOnlySize( impl_calculateItemContentSize( pPanel, TABITEM_IMAGE_ONLY ) ); - Size aTextOnlySize( impl_calculateItemContentSize( pPanel, TABITEM_TEXT_ONLY ) ); + const Size aCompleteSize( impl_calculateItemContentSize( pPanel, TABITEM_IMAGE_AND_TEXT ) ); + const Size aIconOnlySize( impl_calculateItemContentSize( pPanel, TABITEM_IMAGE_ONLY ) ); + const Size aTextOnlySize( impl_calculateItemContentSize( pPanel, TABITEM_TEXT_ONLY ) ); // TODO: have one method calculating all sizes? @@ -602,7 +609,7 @@ namespace svt { // have a minimal size - this is pure heuristics, but if it doesn't suit your needs, then give your panels // a name and or image! :) - aItemContentSize = Size( 14, 14 ); + aItemContentSize = Size( 16, 16 ); } aItemContentSize.Width() += 2 * ITEM_OUTER_SPACE; @@ -890,6 +897,22 @@ namespace svt } //------------------------------------------------------------------------------------------------------------------ + void PanelTabBar_Impl::FocusItem( const ::boost::optional< size_t >& i_rItemPos ) + { + // reset old focus item + if ( !!m_aFocusedItem ) + InvalidateItem( *m_aFocusedItem ); + m_aFocusedItem.reset(); + + // mark the active icon as focused + if ( !!i_rItemPos ) + { + m_aFocusedItem = i_rItemPos; + InvalidateItem( *m_aFocusedItem ); + } + } + + //------------------------------------------------------------------------------------------------------------------ IMPL_LINK( PanelTabBar_Impl, OnScroll, const PushButton*, i_pButton ) { if ( i_pButton == &m_aScrollBack ) @@ -987,6 +1010,13 @@ namespace svt } //------------------------------------------------------------------------------------------------------------------ + IToolPanelDeck& PanelTabBar::GetPanelDeck() const + { + DBG_CHECK( *m_pImpl ); + return m_pImpl->m_rPanelDeck; + } + + //------------------------------------------------------------------------------------------------------------------ Size PanelTabBar::GetOptimalSize( WindowSizeType i_eType ) const { m_pImpl->EnsureItemsCache(); @@ -1145,15 +1175,8 @@ namespace svt void PanelTabBar::GetFocus() { Control::GetFocus(); - if ( m_pImpl->m_rPanelDeck.GetPanelCount() ) - { - ::boost::optional< size_t > aActivePanel( m_pImpl->m_rPanelDeck.GetActivePanel() ); - if ( !!aActivePanel ) - { - m_pImpl->m_aFocusedItem = aActivePanel; - m_pImpl->InvalidateItem( *m_pImpl->m_aFocusedItem ); - } - } + if ( !m_pImpl->m_aFocusedItem ) + m_pImpl->FocusItem( m_pImpl->m_rPanelDeck.GetActivePanel() ); } //------------------------------------------------------------------------------------------------------------------ @@ -1272,9 +1295,9 @@ namespace svt } //------------------------------------------------------------------------------------------------------------------ - ::boost::optional< size_t > PanelTabBar::FindItemForPoint( const Point& i_rPoint ) const + bool PanelTabBar::IsVertical() const { - return m_pImpl->FindItemForPoint( i_rPoint ); + return m_pImpl->IsVertical(); } //------------------------------------------------------------------------------------------------------------------ @@ -1291,7 +1314,8 @@ namespace svt if ( !HasChildPathFocus() ) GrabFocus(); - OSL_ENSURE( !!m_pImpl->m_aFocusedItem, "PanelTabBar::FocusPanelItem: have the focus, but not focused item?" ); + m_pImpl->FocusItem( i_nItemPos ); + OSL_POSTCOND( !!m_pImpl->m_aFocusedItem, "PanelTabBar::FocusPanelItem: have the focus, but not focused item?" ); if ( !!m_pImpl->m_aFocusedItem ) m_pImpl->InvalidateItem( *m_pImpl->m_aFocusedItem ); m_pImpl->m_aFocusedItem.reset( i_nItemPos ); @@ -1303,6 +1327,18 @@ namespace svt return m_pImpl->GetItemScreenRect( i_nItemPos ); } + //------------------------------------------------------------------------------------------------------------------ + Reference< XWindowPeer > PanelTabBar::GetComponentInterface( BOOL i_bCreate ) + { + Reference< XWindowPeer > xWindowPeer( Control::GetComponentInterface( FALSE ) ); + if ( !xWindowPeer.is() && i_bCreate ) + { + xWindowPeer.set( new PanelTabBarPeer( *this ) ); + SetComponentInterface( xWindowPeer ); + } + return xWindowPeer; + } + //........................................................................ } // namespace svt //........................................................................ diff --git a/svtools/source/toolpanel/paneltabbarpeer.cxx b/svtools/source/toolpanel/paneltabbarpeer.cxx new file mode 100644 index 000000000000..d8329109ffb4 --- /dev/null +++ b/svtools/source/toolpanel/paneltabbarpeer.cxx @@ -0,0 +1,101 @@ +/************************************************************************* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "precompiled_svtools.hxx" + +#include "paneltabbarpeer.hxx" +#include "svtools/toolpanel/paneltabbar.hxx" + +/** === begin UNO includes === **/ +#include <com/sun/star/lang/DisposedException.hpp> +/** === end UNO includes === **/ + +#include <tools/diagnose_ex.h> + +//........................................................................ +namespace svt +{ +//........................................................................ + + /** === begin UNO using === **/ + using ::com::sun::star::uno::Reference; + using ::com::sun::star::uno::XInterface; + using ::com::sun::star::uno::UNO_QUERY; + using ::com::sun::star::uno::UNO_QUERY_THROW; + using ::com::sun::star::uno::UNO_SET_THROW; + using ::com::sun::star::uno::Exception; + using ::com::sun::star::uno::RuntimeException; + using ::com::sun::star::uno::Any; + using ::com::sun::star::uno::makeAny; + using ::com::sun::star::uno::Sequence; + using ::com::sun::star::uno::Type; + using ::com::sun::star::accessibility::XAccessibleContext; + using ::com::sun::star::lang::DisposedException; + /** === end UNO using === **/ + + //================================================================================================================== + //= PanelTabBarPeer + //================================================================================================================== + //------------------------------------------------------------------------------------------------------------------ + PanelTabBarPeer::PanelTabBarPeer( PanelTabBar& i_rTabBar ) + :VCLXWindow() + ,m_pTabBar( &i_rTabBar ) + { + } + + //------------------------------------------------------------------------------------------------------------------ + PanelTabBarPeer::~PanelTabBarPeer() + { + } + + //------------------------------------------------------------------------------------------------------------------ + Reference< XAccessibleContext > PanelTabBarPeer::CreateAccessibleContext() + { + ::vos::OGuard aSolarGuard( GetMutex() ); + if ( m_pTabBar == NULL ) + throw DisposedException( ::rtl::OUString(), *this ); + + + + Window* pAccessibleParent( m_pTabBar->GetAccessibleParentWindow() ); + ENSURE_OR_RETURN( pAccessibleParent != NULL, "no accessible parent => no accessible context", NULL ); + Reference< XAccessible > xAccessibleParent( pAccessibleParent->GetAccessible(), UNO_SET_THROW ); + return m_aAccessibleFactory.getFactory().createAccessibleToolPanelTabBar( xAccessibleParent, m_pTabBar->GetPanelDeck(), *m_pTabBar ); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL PanelTabBarPeer::dispose() throw(RuntimeException) + { + { + ::vos::OGuard aSolarGuard( GetMutex() ); + m_pTabBar = NULL; + } + VCLXWindow::dispose(); + } + +//........................................................................ +} // namespace svt +//........................................................................ diff --git a/svtools/source/toolpanel/paneltabbarpeer.hxx b/svtools/source/toolpanel/paneltabbarpeer.hxx new file mode 100644 index 000000000000..7c2e5188d994 --- /dev/null +++ b/svtools/source/toolpanel/paneltabbarpeer.hxx @@ -0,0 +1,69 @@ +/************************************************************************* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SVT_PANELTABBARPEER_HXX +#define SVT_PANELTABBARPEER_HXX + +#include "svtaccessiblefactory.hxx" + +/** === begin UNO includes === **/ +/** === end UNO includes === **/ + +#include <toolkit/awt/vclxwindow.hxx> + +//...................................................................................................................... +namespace svt +{ +//...................................................................................................................... + + class PanelTabBar; + //==================================================================== + //= PanelTabBarPeer + //==================================================================== + class PanelTabBarPeer : public VCLXWindow + { + public: + PanelTabBarPeer( PanelTabBar& i_rTabBar ); + + protected: + ~PanelTabBarPeer(); + + // VCLXWindow overridables + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > CreateAccessibleContext(); + + // XComponent + void SAL_CALL dispose() throw(::com::sun::star::uno::RuntimeException); + + private: + AccessibleFactoryAccess m_aAccessibleFactory; + PanelTabBar* m_pTabBar; + }; + +//........................................................................ +} // namespace svt +//........................................................................ + +#endif // SVT_PANELTABBARPEER_HXX diff --git a/svtools/source/toolpanel/tabbargeometry.cxx b/svtools/source/toolpanel/tabbargeometry.cxx index 2e34ab6da636..f0f5c66d3af3 100644 --- a/svtools/source/toolpanel/tabbargeometry.cxx +++ b/svtools/source/toolpanel/tabbargeometry.cxx @@ -274,10 +274,9 @@ namespace svt // the rect of the last item const Rectangle& rLastItemRect( i_bMinimalSize ? io_rItems.rbegin()->aIconOnlyArea : io_rItems.rbegin()->aCompleteArea ); - const Point aBottomRight( rLastItemRect.BottomRight() ); return Size( - aBottomRight.X() + 1 + m_aItemsInset.Right(), - aBottomRight.Y() + 1 + m_aItemsInset.Bottom() + rLastItemRect.Left() + 1 + m_aItemsInset.Right(), + rLastItemRect.Top() + 1 + rLastItemRect.Bottom() + m_aItemsInset.Bottom() ); } diff --git a/svtools/source/toolpanel/tablayouter.cxx b/svtools/source/toolpanel/tablayouter.cxx index 4f73558afecf..227640e6cad6 100755 --- a/svtools/source/toolpanel/tablayouter.cxx +++ b/svtools/source/toolpanel/tablayouter.cxx @@ -28,7 +28,7 @@ #include "svtools/toolpanel/tablayouter.hxx" #include "svtools/toolpanel/toolpaneldeck.hxx" -#include "paneltabbar.hxx" +#include "svtools/toolpanel/paneltabbar.hxx" #include "svtaccessiblefactory.hxx" #include <tools/gen.hxx> @@ -127,13 +127,6 @@ namespace svt } //-------------------------------------------------------------------- - IToolPanelDeck& TabDeckLayouter::GetPanelDeck() const - { - lcl_checkDisposed( *m_pData ); - return m_pData->rPanels; - } - - //-------------------------------------------------------------------- ::boost::optional< size_t > TabDeckLayouter::GetFocusedPanelItem() const { if ( lcl_checkDisposed( *m_pData ) ) @@ -239,26 +232,27 @@ namespace svt //-------------------------------------------------------------------- void TabDeckLayouter::SetFocusToPanelSelector() { - if ( lcl_checkDisposed( * m_pData ) ) + if ( lcl_checkDisposed( *m_pData ) ) return; m_pData->pTabBar->GrabFocus(); } //-------------------------------------------------------------------- - ::boost::optional< size_t > TabDeckLayouter::GetPanelItemFromScreenPos( const ::Point& i_rScreenPos ) + size_t TabDeckLayouter::GetAccessibleChildCount() const { if ( lcl_checkDisposed( *m_pData ) ) - return ::boost::optional< size_t >(); - const Point aOutputPos( m_pData->pTabBar->ScreenToOutputPixel( i_rScreenPos ) ); - return m_pData->pTabBar->FindItemForPoint( aOutputPos ); + return 0; + + return 1; } //-------------------------------------------------------------------- - Reference< XAccessible > TabDeckLayouter::GetPanelItemAccessible( const size_t i_nItemPos, const Reference< XAccessible >& i_rParentAccessible ) + Reference< XAccessible > TabDeckLayouter::GetAccessibleChild( const size_t i_nChildIndex, const Reference< XAccessible >& i_rParentAccessible ) { if ( lcl_checkDisposed( *m_pData ) ) return NULL; - return m_pData->aAccessibleFactory.getFactory().createAccessibleToolPanelDeckTabBarItem( i_rParentAccessible, this, i_nItemPos ); + + return m_pData->pTabBar->GetAccessible( TRUE ); } //........................................................................ |