summaryrefslogtreecommitdiff
path: root/vcl/source/window/tabpage.cxx
diff options
context:
space:
mode:
authorThomas Benisch <tbe@openoffice.org>2002-08-19 15:01:07 +0000
committerThomas Benisch <tbe@openoffice.org>2002-08-19 15:01:07 +0000
commit6da9dc84a7c68ee0e8bf908523bf28be9fbf176b (patch)
tree46be5148cc0e293b07112e2081c90e4853f0561e /vcl/source/window/tabpage.cxx
parent51f080b8ba71a5c60d93d6de3fdd56d49298f620 (diff)
#100352# added CreateAccessible()
Diffstat (limited to 'vcl/source/window/tabpage.cxx')
-rw-r--r--vcl/source/window/tabpage.cxx46
1 files changed, 44 insertions, 2 deletions
diff --git a/vcl/source/window/tabpage.cxx b/vcl/source/window/tabpage.cxx
index 27f5dbfa66d4..fa140ef05137 100644
--- a/vcl/source/window/tabpage.cxx
+++ b/vcl/source/window/tabpage.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: tabpage.cxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: th $ $Date: 2001-07-06 16:04:57 $
+ * last change: $Author: tbe $ $Date: 2002-08-19 16:01:07 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -78,9 +78,17 @@
#ifndef _SV_TABPAGE_HXX
#include <tabpage.hxx>
#endif
+#ifndef _SV_TABCTRL_HXX
+#include <tabctrl.hxx>
+#endif
+
+#ifndef _DRAFTS_COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLE_HPP_
+#include <drafts/com/sun/star/accessibility/XAccessible.hpp>
+#endif
#pragma hdrstop
+
// =======================================================================
void TabPage::ImplInit( Window* pParent, WinBits nStyle )
@@ -183,3 +191,37 @@ void TabPage::ActivatePage()
void TabPage::DeactivatePage()
{
}
+
+// -----------------------------------------------------------------------
+
+::com::sun::star::uno::Reference< ::drafts::com::sun::star::accessibility::XAccessible > TabPage::CreateAccessible()
+{
+ ::com::sun::star::uno::Reference< ::drafts::com::sun::star::accessibility::XAccessible > xAcc;
+
+ Window* pParent = GetAccessibleParentWindow();
+ if ( pParent && pParent->GetType() == WINDOW_TABCONTROL )
+ {
+ TabControl* pTabControl = static_cast< TabControl* >( pParent );
+ if ( pTabControl )
+ {
+ for ( sal_uInt16 i = 0, nCount = pTabControl->GetPageCount(); i < nCount; ++i )
+ {
+ sal_uInt16 nPageId = pTabControl->GetPageId( i );
+ if ( pTabControl->GetTabPage( nPageId ) == this )
+ {
+ ::com::sun::star::uno::Reference< ::drafts::com::sun::star::accessibility::XAccessible > xParent = pTabControl->GetAccessible();
+ if ( xParent.is() )
+ {
+ ::com::sun::star::uno::Reference< ::drafts::com::sun::star::accessibility::XAccessibleContext > xParentContext( xParent->getAccessibleContext() );
+ if ( xParentContext.is() )
+ xAcc = xParentContext->getAccessibleChild( i );
+ }
+ }
+ }
+ }
+ }
+ else
+ xAcc = Window::CreateAccessible();
+
+ return xAcc;
+}