2010-10-14 08:30:41 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2011-03-31 10:05:04 +02:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2002-04-12 11:48:59 +00:00
|
|
|
|
2003-04-24 15:13:12 +00:00
|
|
|
#include <com/sun/star/accessibility/XAccessibleSelection.hpp>
|
2002-04-12 11:48:59 +00:00
|
|
|
#include <accselectionhelper.hxx>
|
|
|
|
|
|
|
|
#include <acccontext.hxx>
|
|
|
|
#include <accmap.hxx>
|
2002-05-15 12:22:47 +00:00
|
|
|
#include <svx/AccessibleShape.hxx>
|
2002-04-12 11:48:59 +00:00
|
|
|
#include <viewsh.hxx>
|
2010-02-02 15:11:26 +01:00
|
|
|
#include <fesh.hxx>
|
2013-10-22 15:58:57 +03:00
|
|
|
#include <vcl/svapp.hxx>
|
2010-02-02 15:11:26 +01:00
|
|
|
#include <flyfrm.hxx>
|
2002-04-12 11:48:59 +00:00
|
|
|
|
2013-11-29 13:03:27 +00:00
|
|
|
#include <com/sun/star/uno/Reference.hxx>
|
|
|
|
#include <com/sun/star/accessibility/AccessibleStateType.hpp>
|
|
|
|
#include <com/sun/star/accessibility/XAccessibleStateSet.hpp>
|
|
|
|
#include <fmtanchr.hxx>
|
|
|
|
|
|
|
|
using namespace ::com::sun::star::accessibility;
|
2007-09-27 07:24:02 +00:00
|
|
|
using namespace ::com::sun::star;
|
2002-08-15 08:29:35 +00:00
|
|
|
using namespace ::com::sun::star::uno;
|
2007-09-27 07:24:02 +00:00
|
|
|
|
2003-04-24 15:13:12 +00:00
|
|
|
using ::com::sun::star::accessibility::XAccessible;
|
|
|
|
using ::com::sun::star::accessibility::XAccessibleContext;
|
|
|
|
using ::com::sun::star::accessibility::XAccessibleSelection;
|
2002-04-12 11:48:59 +00:00
|
|
|
|
2010-02-02 15:11:26 +01:00
|
|
|
using namespace ::sw::access;
|
2002-04-12 11:48:59 +00:00
|
|
|
|
|
|
|
SwAccessibleSelectionHelper::SwAccessibleSelectionHelper(
|
|
|
|
SwAccessibleContext& rCtxt ) :
|
|
|
|
rContext( rCtxt )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
SwAccessibleSelectionHelper::~SwAccessibleSelectionHelper()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
SwFEShell* SwAccessibleSelectionHelper::GetFEShell()
|
|
|
|
{
|
2011-05-08 22:14:45 +02:00
|
|
|
OSL_ENSURE( rContext.GetMap() != NULL, "no map?" );
|
2013-10-26 19:50:13 +02:00
|
|
|
SwViewShell* pViewShell = rContext.GetMap()->GetShell();
|
2011-05-08 22:14:45 +02:00
|
|
|
OSL_ENSURE( pViewShell != NULL,
|
2002-04-12 11:48:59 +00:00
|
|
|
"No view shell? Then what are you looking at?" );
|
|
|
|
|
|
|
|
SwFEShell* pFEShell = NULL;
|
|
|
|
if( pViewShell->ISA( SwFEShell ) )
|
|
|
|
{
|
|
|
|
pFEShell = static_cast<SwFEShell*>( pViewShell );
|
|
|
|
}
|
|
|
|
|
|
|
|
return pFEShell;
|
|
|
|
}
|
|
|
|
|
2002-08-15 08:29:35 +00:00
|
|
|
void SwAccessibleSelectionHelper::throwIndexOutOfBoundsException()
|
2007-09-27 07:24:02 +00:00
|
|
|
throw ( lang::IndexOutOfBoundsException )
|
2002-08-15 08:29:35 +00:00
|
|
|
{
|
|
|
|
Reference < XAccessibleContext > xThis( &rContext );
|
|
|
|
Reference < XAccessibleSelection >xSelThis( xThis, UNO_QUERY );
|
2007-09-27 07:24:02 +00:00
|
|
|
lang::IndexOutOfBoundsException aExcept(
|
2013-03-01 13:50:58 +01:00
|
|
|
OUString( "index out of bounds" ),
|
2002-08-15 08:29:35 +00:00
|
|
|
xSelThis ); \
|
|
|
|
throw aExcept;
|
|
|
|
}
|
|
|
|
|
2013-03-31 22:05:00 +11:00
|
|
|
// XAccessibleSelection
|
2002-04-12 11:48:59 +00:00
|
|
|
void SwAccessibleSelectionHelper::selectAccessibleChild(
|
|
|
|
sal_Int32 nChildIndex )
|
2007-09-27 07:24:02 +00:00
|
|
|
throw ( lang::IndexOutOfBoundsException,
|
2002-04-12 11:48:59 +00:00
|
|
|
RuntimeException )
|
|
|
|
{
|
2010-10-13 01:44:10 -05:00
|
|
|
SolarMutexGuard aGuard;
|
2002-04-12 11:48:59 +00:00
|
|
|
|
|
|
|
// Get the respective child as SwFrm (also do index checking), ...
|
2010-02-02 15:11:26 +01:00
|
|
|
const SwAccessibleChild aChild = rContext.GetChild( *(rContext.GetMap()),
|
|
|
|
nChildIndex );
|
2002-04-12 11:48:59 +00:00
|
|
|
if( !aChild.IsValid() )
|
2002-08-15 08:29:35 +00:00
|
|
|
throwIndexOutOfBoundsException();
|
2002-04-12 11:48:59 +00:00
|
|
|
|
|
|
|
// we can only select fly frames, so we ignore (should: return
|
|
|
|
// false) all other attempts at child selection
|
|
|
|
SwFEShell* pFEShell = GetFEShell();
|
2002-05-15 12:22:47 +00:00
|
|
|
if( pFEShell != NULL )
|
2002-04-12 11:48:59 +00:00
|
|
|
{
|
2010-02-02 15:11:26 +01:00
|
|
|
const SdrObject *pObj = aChild.GetDrawObject();
|
2002-05-15 12:22:47 +00:00
|
|
|
if( pObj )
|
2011-01-25 10:18:38 +00:00
|
|
|
rContext.Select( const_cast< SdrObject *>( pObj ), 0==aChild.GetSwFrm());
|
2002-04-12 11:48:59 +00:00
|
|
|
}
|
|
|
|
// no frame shell, or no frame, or no fly frame -> can't select
|
|
|
|
}
|
|
|
|
|
2013-11-29 13:03:27 +00:00
|
|
|
//When the selected state of the SwFrmOrObj is setted, return true.
|
|
|
|
static sal_Bool lcl_getSelectedState(const SwAccessibleChild& aChild,
|
|
|
|
SwAccessibleContext* pContext,
|
|
|
|
SwAccessibleMap* pMap)
|
|
|
|
{
|
|
|
|
Reference< XAccessible > xAcc;
|
|
|
|
if ( aChild.GetSwFrm() )
|
|
|
|
{
|
|
|
|
xAcc = pMap->GetContext( aChild.GetSwFrm(), sal_False );
|
|
|
|
}
|
|
|
|
else if ( aChild.GetDrawObject() )
|
|
|
|
{
|
|
|
|
xAcc = pMap->GetContext( aChild.GetDrawObject(), pContext, sal_False );
|
|
|
|
}
|
|
|
|
|
|
|
|
if( xAcc.is() )
|
|
|
|
{
|
|
|
|
Reference< XAccessibleContext > pRContext = xAcc->getAccessibleContext();
|
|
|
|
if(!pRContext.is())
|
|
|
|
return sal_False;
|
|
|
|
Reference<XAccessibleStateSet> pRStateSet = pRContext->getAccessibleStateSet();
|
|
|
|
if( pRStateSet.is() )
|
|
|
|
{
|
|
|
|
Sequence<short> pStates = pRStateSet->getStates();
|
|
|
|
long count = pStates.getLength();
|
|
|
|
for( int i = 0; i < count; i++ )
|
|
|
|
{
|
|
|
|
if( pStates[i] == AccessibleStateType::SELECTED)
|
|
|
|
return sal_True;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return sal_False;
|
|
|
|
}
|
|
|
|
|
2002-04-12 11:48:59 +00:00
|
|
|
sal_Bool SwAccessibleSelectionHelper::isAccessibleChildSelected(
|
|
|
|
sal_Int32 nChildIndex )
|
2007-09-27 07:24:02 +00:00
|
|
|
throw ( lang::IndexOutOfBoundsException,
|
2002-04-12 11:48:59 +00:00
|
|
|
RuntimeException )
|
|
|
|
{
|
2010-10-13 01:44:10 -05:00
|
|
|
SolarMutexGuard aGuard;
|
2002-04-12 11:48:59 +00:00
|
|
|
|
|
|
|
// Get the respective child as SwFrm (also do index checking), ...
|
2010-02-02 15:11:26 +01:00
|
|
|
const SwAccessibleChild aChild = rContext.GetChild( *(rContext.GetMap()),
|
|
|
|
nChildIndex );
|
2002-04-12 11:48:59 +00:00
|
|
|
if( !aChild.IsValid() )
|
2002-08-15 08:29:35 +00:00
|
|
|
throwIndexOutOfBoundsException();
|
2002-04-12 11:48:59 +00:00
|
|
|
|
|
|
|
// ... and compare to the currently selected frame
|
2002-05-15 12:22:47 +00:00
|
|
|
sal_Bool bRet = sal_False;
|
|
|
|
SwFEShell* pFEShell = GetFEShell();
|
|
|
|
if( pFEShell )
|
|
|
|
{
|
2010-02-02 15:11:26 +01:00
|
|
|
if ( aChild.GetSwFrm() != 0 )
|
2002-05-15 12:22:47 +00:00
|
|
|
{
|
|
|
|
bRet = (pFEShell->GetCurrFlyFrm() == aChild.GetSwFrm());
|
|
|
|
}
|
2010-02-02 15:11:26 +01:00
|
|
|
else if ( aChild.GetDrawObject() )
|
2002-05-15 12:22:47 +00:00
|
|
|
{
|
2010-02-02 15:11:26 +01:00
|
|
|
bRet = pFEShell->IsObjSelected( *aChild.GetDrawObject() );
|
2002-05-15 12:22:47 +00:00
|
|
|
}
|
2013-11-29 13:03:27 +00:00
|
|
|
//If the SwFrmOrObj is not selected directly in the UI, we should check whether it is selected in the selection cursor.
|
|
|
|
if( !bRet )
|
|
|
|
{
|
|
|
|
if( lcl_getSelectedState( aChild, &rContext, rContext.GetMap() ) == sal_True)
|
|
|
|
bRet = sal_True;
|
|
|
|
}
|
2002-05-15 12:22:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return bRet;
|
2002-04-12 11:48:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void SwAccessibleSelectionHelper::clearAccessibleSelection( )
|
|
|
|
throw ( RuntimeException )
|
|
|
|
{
|
|
|
|
// return sal_False // we can't deselect
|
|
|
|
}
|
|
|
|
|
2003-05-22 11:51:25 +00:00
|
|
|
void SwAccessibleSelectionHelper::selectAllAccessibleChildren( )
|
2002-04-12 11:48:59 +00:00
|
|
|
throw ( RuntimeException )
|
|
|
|
{
|
2010-10-13 01:44:10 -05:00
|
|
|
SolarMutexGuard aGuard;
|
2002-04-12 11:48:59 +00:00
|
|
|
|
|
|
|
// We can select only one. So iterate over the children to find
|
|
|
|
// the first we can select, and select it.
|
|
|
|
|
2002-05-15 12:22:47 +00:00
|
|
|
SwFEShell* pFEShell = GetFEShell();
|
|
|
|
if( pFEShell )
|
2002-04-12 11:48:59 +00:00
|
|
|
{
|
2010-02-02 15:11:26 +01:00
|
|
|
::std::list< SwAccessibleChild > aChildren;
|
|
|
|
rContext.GetChildren( *(rContext.GetMap()), aChildren );
|
2002-05-15 12:22:47 +00:00
|
|
|
|
2010-02-02 15:11:26 +01:00
|
|
|
::std::list< SwAccessibleChild >::const_iterator aIter = aChildren.begin();
|
|
|
|
::std::list< SwAccessibleChild >::const_iterator aEndIter = aChildren.end();
|
2002-05-15 12:22:47 +00:00
|
|
|
while( aIter != aEndIter )
|
2002-04-12 11:48:59 +00:00
|
|
|
{
|
2010-02-02 15:11:26 +01:00
|
|
|
const SwAccessibleChild& rChild = *aIter;
|
|
|
|
const SdrObject* pObj = rChild.GetDrawObject();
|
2002-05-15 12:22:47 +00:00
|
|
|
const SwFrm* pFrm = rChild.GetSwFrm();
|
|
|
|
if( pObj && !(pFrm != 0 && pFEShell->IsObjSelected()) )
|
2002-04-12 11:48:59 +00:00
|
|
|
{
|
2002-08-09 07:40:25 +00:00
|
|
|
rContext.Select( const_cast< SdrObject *>( pObj ), 0==pFrm );
|
2002-05-15 12:22:47 +00:00
|
|
|
if( pFrm )
|
|
|
|
break;
|
2002-04-12 11:48:59 +00:00
|
|
|
}
|
2002-05-15 12:22:47 +00:00
|
|
|
++aIter;
|
2002-04-12 11:48:59 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
sal_Int32 SwAccessibleSelectionHelper::getSelectedAccessibleChildCount( )
|
|
|
|
throw ( RuntimeException )
|
|
|
|
{
|
2010-10-13 01:44:10 -05:00
|
|
|
SolarMutexGuard aGuard;
|
2002-04-12 11:48:59 +00:00
|
|
|
|
2002-05-15 12:22:47 +00:00
|
|
|
sal_Int32 nCount = 0;
|
2002-04-12 11:48:59 +00:00
|
|
|
// Only one frame can be selected at a time, and we only frames
|
|
|
|
// for selectable children.
|
2002-05-15 12:22:47 +00:00
|
|
|
SwFEShell* pFEShell = GetFEShell();
|
|
|
|
if( pFEShell != 0 )
|
|
|
|
{
|
2010-02-02 15:11:26 +01:00
|
|
|
const SwFlyFrm* pFlyFrm = pFEShell->GetCurrFlyFrm();
|
2002-05-15 12:22:47 +00:00
|
|
|
if( pFlyFrm )
|
|
|
|
{
|
2013-11-29 13:03:27 +00:00
|
|
|
nCount = 1;
|
2002-05-15 12:22:47 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
sal_uInt16 nSelObjs = pFEShell->IsObjSelected();
|
|
|
|
if( nSelObjs > 0 )
|
|
|
|
{
|
2010-02-02 15:11:26 +01:00
|
|
|
::std::list< SwAccessibleChild > aChildren;
|
|
|
|
rContext.GetChildren( *(rContext.GetMap()), aChildren );
|
2002-05-15 12:22:47 +00:00
|
|
|
|
2010-02-02 15:11:26 +01:00
|
|
|
::std::list< SwAccessibleChild >::const_iterator aIter =
|
2002-05-15 12:22:47 +00:00
|
|
|
aChildren.begin();
|
2010-02-02 15:11:26 +01:00
|
|
|
::std::list< SwAccessibleChild >::const_iterator aEndIter =
|
2002-05-15 12:22:47 +00:00
|
|
|
aChildren.end();
|
|
|
|
while( aIter != aEndIter && nCount < nSelObjs )
|
|
|
|
{
|
2010-02-02 15:11:26 +01:00
|
|
|
const SwAccessibleChild& rChild = *aIter;
|
|
|
|
if( rChild.GetDrawObject() && !rChild.GetSwFrm() &&
|
2002-05-22 10:48:43 +00:00
|
|
|
rContext.GetParent(rChild, rContext.IsInPagePreview())
|
|
|
|
== rContext.GetFrm() &&
|
2010-02-02 15:11:26 +01:00
|
|
|
pFEShell->IsObjSelected( *rChild.GetDrawObject() ) )
|
2002-05-15 12:22:47 +00:00
|
|
|
{
|
|
|
|
nCount++;
|
|
|
|
}
|
|
|
|
++aIter;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2013-11-29 13:03:27 +00:00
|
|
|
//If the SwFrmOrObj is not selected directly in the UI,
|
|
|
|
//we should check whether it is selected in the selection cursor.
|
|
|
|
if( nCount == 0 )
|
|
|
|
{
|
|
|
|
::std::list< SwAccessibleChild > aChildren;
|
|
|
|
rContext.GetChildren( *(rContext.GetMap()), aChildren );
|
|
|
|
::std::list< SwAccessibleChild >::const_iterator aIter =
|
|
|
|
aChildren.begin();
|
|
|
|
::std::list< SwAccessibleChild >::const_iterator aEndIter =
|
|
|
|
aChildren.end();
|
|
|
|
while( aIter != aEndIter )
|
|
|
|
{
|
|
|
|
const SwAccessibleChild& aChild = *aIter;
|
|
|
|
if( lcl_getSelectedState( aChild, &rContext, rContext.GetMap() ) )
|
|
|
|
nCount++;
|
|
|
|
++aIter;
|
|
|
|
}
|
|
|
|
}
|
2002-05-15 12:22:47 +00:00
|
|
|
}
|
|
|
|
return nCount;
|
2002-04-12 11:48:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Reference<XAccessible> SwAccessibleSelectionHelper::getSelectedAccessibleChild(
|
|
|
|
sal_Int32 nSelectedChildIndex )
|
2007-09-27 07:24:02 +00:00
|
|
|
throw ( lang::IndexOutOfBoundsException,
|
2002-04-12 11:48:59 +00:00
|
|
|
RuntimeException)
|
|
|
|
{
|
2010-10-13 01:44:10 -05:00
|
|
|
SolarMutexGuard aGuard;
|
2002-04-12 11:48:59 +00:00
|
|
|
|
|
|
|
// Since the index is relative to the selected children, and since
|
|
|
|
// there can be at most one selected frame child, the index must
|
|
|
|
// be 0, and a selection must exist, otherwise we have to throw an
|
2007-09-27 07:24:02 +00:00
|
|
|
// lang::IndexOutOfBoundsException
|
2002-05-15 12:22:47 +00:00
|
|
|
SwFEShell* pFEShell = GetFEShell();
|
|
|
|
if( 0 == pFEShell )
|
2002-08-15 08:29:35 +00:00
|
|
|
throwIndexOutOfBoundsException();
|
2002-04-12 11:48:59 +00:00
|
|
|
|
2010-02-02 15:11:26 +01:00
|
|
|
SwAccessibleChild aChild;
|
2002-05-15 12:22:47 +00:00
|
|
|
const SwFlyFrm *pFlyFrm = pFEShell->GetCurrFlyFrm();
|
|
|
|
if( pFlyFrm )
|
|
|
|
{
|
2013-11-29 13:03:27 +00:00
|
|
|
if( 0 == nSelectedChildIndex )
|
2002-05-22 10:48:43 +00:00
|
|
|
{
|
2013-11-29 13:03:27 +00:00
|
|
|
if(rContext.GetParent( SwAccessibleChild(pFlyFrm), rContext.IsInPagePreview()) == rContext.GetFrm() )
|
|
|
|
{
|
|
|
|
aChild = pFlyFrm;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
const SwFrmFmt *pFrmFmt = pFlyFrm->GetFmt();
|
|
|
|
if (pFrmFmt)
|
|
|
|
{
|
|
|
|
const SwFmtAnchor& pAnchor = pFrmFmt->GetAnchor();
|
|
|
|
if( pAnchor.GetAnchorId() == FLY_AS_CHAR )
|
|
|
|
{
|
|
|
|
const SwFrm *pParaFrm = rContext.GetParent( SwAccessibleChild(pFlyFrm), rContext.IsInPagePreview() );
|
|
|
|
aChild = pParaFrm;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2002-05-22 10:48:43 +00:00
|
|
|
}
|
2002-05-15 12:22:47 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
sal_uInt16 nSelObjs = pFEShell->IsObjSelected();
|
|
|
|
if( 0 == nSelObjs || nSelectedChildIndex >= nSelObjs )
|
2002-08-15 08:29:35 +00:00
|
|
|
throwIndexOutOfBoundsException();
|
2002-05-15 12:22:47 +00:00
|
|
|
|
2010-02-02 15:11:26 +01:00
|
|
|
::std::list< SwAccessibleChild > aChildren;
|
|
|
|
rContext.GetChildren( *(rContext.GetMap()), aChildren );
|
2002-05-15 12:22:47 +00:00
|
|
|
|
2010-02-02 15:11:26 +01:00
|
|
|
::std::list< SwAccessibleChild >::const_iterator aIter = aChildren.begin();
|
|
|
|
::std::list< SwAccessibleChild >::const_iterator aEndIter = aChildren.end();
|
2002-05-15 12:22:47 +00:00
|
|
|
while( aIter != aEndIter && !aChild.IsValid() )
|
|
|
|
{
|
2010-02-02 15:11:26 +01:00
|
|
|
const SwAccessibleChild& rChild = *aIter;
|
|
|
|
if( rChild.GetDrawObject() && !rChild.GetSwFrm() &&
|
2002-05-22 10:48:43 +00:00
|
|
|
rContext.GetParent(rChild, rContext.IsInPagePreview()) ==
|
|
|
|
rContext.GetFrm() &&
|
2010-02-02 15:11:26 +01:00
|
|
|
pFEShell->IsObjSelected( *rChild.GetDrawObject() ) )
|
2002-05-15 12:22:47 +00:00
|
|
|
{
|
|
|
|
if( 0 == nSelectedChildIndex )
|
|
|
|
aChild = rChild;
|
|
|
|
else
|
|
|
|
--nSelectedChildIndex;
|
|
|
|
}
|
|
|
|
++aIter;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if( !aChild.IsValid() )
|
2002-08-15 08:29:35 +00:00
|
|
|
throwIndexOutOfBoundsException();
|
2002-05-15 12:22:47 +00:00
|
|
|
|
2011-05-08 22:14:45 +02:00
|
|
|
OSL_ENSURE( rContext.GetMap() != NULL, "We need the map." );
|
2002-05-15 12:22:47 +00:00
|
|
|
Reference< XAccessible > xChild;
|
|
|
|
if( aChild.GetSwFrm() )
|
|
|
|
{
|
2010-10-15 11:44:38 -05:00
|
|
|
::rtl::Reference < SwAccessibleContext > xChildImpl(
|
2002-05-15 12:22:47 +00:00
|
|
|
rContext.GetMap()->GetContextImpl( aChild.GetSwFrm(),
|
|
|
|
sal_True ) );
|
2010-10-15 11:44:38 -05:00
|
|
|
if( xChildImpl.is() )
|
2002-05-15 12:22:47 +00:00
|
|
|
{
|
|
|
|
xChildImpl->SetParent( &rContext );
|
2010-10-15 11:44:38 -05:00
|
|
|
xChild = xChildImpl.get();
|
2002-05-15 12:22:47 +00:00
|
|
|
}
|
|
|
|
}
|
2010-02-02 15:11:26 +01:00
|
|
|
else if ( aChild.GetDrawObject() )
|
2002-05-15 12:22:47 +00:00
|
|
|
{
|
2010-10-15 11:44:38 -05:00
|
|
|
::rtl::Reference < ::accessibility::AccessibleShape > xChildImpl(
|
2010-02-02 15:11:26 +01:00
|
|
|
rContext.GetMap()->GetContextImpl( aChild.GetDrawObject(),
|
2002-05-15 12:22:47 +00:00
|
|
|
&rContext, sal_True ) );
|
2010-10-15 11:44:38 -05:00
|
|
|
if( xChildImpl.is() )
|
|
|
|
xChild = xChildImpl.get();
|
2002-05-15 12:22:47 +00:00
|
|
|
}
|
|
|
|
return xChild;
|
2002-04-12 11:48:59 +00:00
|
|
|
}
|
|
|
|
|
2011-01-30 04:19:53 +09:00
|
|
|
// index has to be treated as global child index.
|
2003-04-24 15:13:12 +00:00
|
|
|
void SwAccessibleSelectionHelper::deselectAccessibleChild(
|
2004-12-23 09:02:31 +00:00
|
|
|
sal_Int32 nChildIndex )
|
2007-09-27 07:24:02 +00:00
|
|
|
throw ( lang::IndexOutOfBoundsException,
|
2002-04-12 11:48:59 +00:00
|
|
|
RuntimeException )
|
|
|
|
{
|
2013-12-13 23:33:21 +01:00
|
|
|
SolarMutexGuard g;
|
|
|
|
|
2004-12-23 09:02:31 +00:00
|
|
|
if( nChildIndex < 0 ||
|
2010-02-02 15:11:26 +01:00
|
|
|
nChildIndex >= rContext.GetChildCount( *(rContext.GetMap()) ) )
|
2002-08-15 08:29:35 +00:00
|
|
|
throwIndexOutOfBoundsException();
|
2002-04-12 11:48:59 +00:00
|
|
|
}
|
2010-10-14 08:30:41 +02:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|