Kaydet (Commit) c4a7e5bd authored tarafından Miklos Vajna's avatar Miklos Vajna

sw: prefix members of SwAccessibleSelectionHelper

Using rCtxt vs rContext to refer to the local vs member variable is
suboptimal.

Change-Id: I160cb923e1467c5a1e34d84c6c5d9061f637e3bd
üst 7007908d
...@@ -44,8 +44,8 @@ using ::com::sun::star::accessibility::XAccessibleSelection; ...@@ -44,8 +44,8 @@ using ::com::sun::star::accessibility::XAccessibleSelection;
using namespace ::sw::access; using namespace ::sw::access;
SwAccessibleSelectionHelper::SwAccessibleSelectionHelper( SwAccessibleSelectionHelper::SwAccessibleSelectionHelper(
SwAccessibleContext& rCtxt ) : SwAccessibleContext& rContext ) :
rContext( rCtxt ) m_rContext( rContext )
{ {
} }
...@@ -55,8 +55,8 @@ SwAccessibleSelectionHelper::~SwAccessibleSelectionHelper() ...@@ -55,8 +55,8 @@ SwAccessibleSelectionHelper::~SwAccessibleSelectionHelper()
SwFEShell* SwAccessibleSelectionHelper::GetFEShell() SwFEShell* SwAccessibleSelectionHelper::GetFEShell()
{ {
OSL_ENSURE( rContext.GetMap() != NULL, "no map?" ); OSL_ENSURE( m_rContext.GetMap() != NULL, "no map?" );
SwViewShell* pViewShell = rContext.GetMap()->GetShell(); SwViewShell* pViewShell = m_rContext.GetMap()->GetShell();
OSL_ENSURE( pViewShell != NULL, OSL_ENSURE( pViewShell != NULL,
"No view shell? Then what are you looking at?" ); "No view shell? Then what are you looking at?" );
...@@ -72,7 +72,7 @@ SwFEShell* SwAccessibleSelectionHelper::GetFEShell() ...@@ -72,7 +72,7 @@ SwFEShell* SwAccessibleSelectionHelper::GetFEShell()
void SwAccessibleSelectionHelper::throwIndexOutOfBoundsException() void SwAccessibleSelectionHelper::throwIndexOutOfBoundsException()
throw ( lang::IndexOutOfBoundsException ) throw ( lang::IndexOutOfBoundsException )
{ {
Reference < XAccessibleContext > xThis( &rContext ); Reference < XAccessibleContext > xThis( &m_rContext );
Reference < XAccessibleSelection >xSelThis( xThis, UNO_QUERY ); Reference < XAccessibleSelection >xSelThis( xThis, UNO_QUERY );
lang::IndexOutOfBoundsException aExcept( lang::IndexOutOfBoundsException aExcept(
OUString( "index out of bounds" ), OUString( "index out of bounds" ),
...@@ -89,7 +89,7 @@ void SwAccessibleSelectionHelper::selectAccessibleChild( ...@@ -89,7 +89,7 @@ void SwAccessibleSelectionHelper::selectAccessibleChild(
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
// Get the respective child as SwFrm (also do index checking), ... // Get the respective child as SwFrm (also do index checking), ...
const SwAccessibleChild aChild = rContext.GetChild( *(rContext.GetMap()), const SwAccessibleChild aChild = m_rContext.GetChild( *(m_rContext.GetMap()),
nChildIndex ); nChildIndex );
if( !aChild.IsValid() ) if( !aChild.IsValid() )
throwIndexOutOfBoundsException(); throwIndexOutOfBoundsException();
...@@ -101,7 +101,7 @@ void SwAccessibleSelectionHelper::selectAccessibleChild( ...@@ -101,7 +101,7 @@ void SwAccessibleSelectionHelper::selectAccessibleChild(
{ {
const SdrObject *pObj = aChild.GetDrawObject(); const SdrObject *pObj = aChild.GetDrawObject();
if( pObj ) if( pObj )
rContext.Select( const_cast< SdrObject *>( pObj ), 0==aChild.GetSwFrm()); m_rContext.Select( const_cast< SdrObject *>( pObj ), 0==aChild.GetSwFrm());
} }
// no frame shell, or no frame, or no fly frame -> can't select // no frame shell, or no frame, or no fly frame -> can't select
} }
...@@ -149,7 +149,7 @@ bool SwAccessibleSelectionHelper::isAccessibleChildSelected( ...@@ -149,7 +149,7 @@ bool SwAccessibleSelectionHelper::isAccessibleChildSelected(
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
// Get the respective child as SwFrm (also do index checking), ... // Get the respective child as SwFrm (also do index checking), ...
const SwAccessibleChild aChild = rContext.GetChild( *(rContext.GetMap()), const SwAccessibleChild aChild = m_rContext.GetChild( *(m_rContext.GetMap()),
nChildIndex ); nChildIndex );
if( !aChild.IsValid() ) if( !aChild.IsValid() )
throwIndexOutOfBoundsException(); throwIndexOutOfBoundsException();
...@@ -170,7 +170,7 @@ bool SwAccessibleSelectionHelper::isAccessibleChildSelected( ...@@ -170,7 +170,7 @@ bool SwAccessibleSelectionHelper::isAccessibleChildSelected(
//If the SwFrmOrObj is not selected directly in the UI, we should check whether it is selected in the selection cursor. //If the SwFrmOrObj is not selected directly in the UI, we should check whether it is selected in the selection cursor.
if( !bRet ) if( !bRet )
{ {
if( lcl_getSelectedState( aChild, &rContext, rContext.GetMap() ) ) if( lcl_getSelectedState( aChild, &m_rContext, m_rContext.GetMap() ) )
bRet = true; bRet = true;
} }
} }
...@@ -190,7 +190,7 @@ void SwAccessibleSelectionHelper::selectAllAccessibleChildren( ) ...@@ -190,7 +190,7 @@ void SwAccessibleSelectionHelper::selectAllAccessibleChildren( )
if( pFEShell ) if( pFEShell )
{ {
::std::list< SwAccessibleChild > aChildren; ::std::list< SwAccessibleChild > aChildren;
rContext.GetChildren( *(rContext.GetMap()), aChildren ); m_rContext.GetChildren( *(m_rContext.GetMap()), aChildren );
::std::list< SwAccessibleChild >::const_iterator aIter = aChildren.begin(); ::std::list< SwAccessibleChild >::const_iterator aIter = aChildren.begin();
::std::list< SwAccessibleChild >::const_iterator aEndIter = aChildren.end(); ::std::list< SwAccessibleChild >::const_iterator aEndIter = aChildren.end();
...@@ -201,7 +201,7 @@ void SwAccessibleSelectionHelper::selectAllAccessibleChildren( ) ...@@ -201,7 +201,7 @@ void SwAccessibleSelectionHelper::selectAllAccessibleChildren( )
const SwFrm* pFrm = rChild.GetSwFrm(); const SwFrm* pFrm = rChild.GetSwFrm();
if( pObj && !(pFrm != 0 && pFEShell->IsObjSelected()) ) if( pObj && !(pFrm != 0 && pFEShell->IsObjSelected()) )
{ {
rContext.Select( const_cast< SdrObject *>( pObj ), 0==pFrm ); m_rContext.Select( const_cast< SdrObject *>( pObj ), 0==pFrm );
if( pFrm ) if( pFrm )
break; break;
} }
...@@ -232,7 +232,7 @@ sal_Int32 SwAccessibleSelectionHelper::getSelectedAccessibleChildCount( ) ...@@ -232,7 +232,7 @@ sal_Int32 SwAccessibleSelectionHelper::getSelectedAccessibleChildCount( )
if( nSelObjs > 0 ) if( nSelObjs > 0 )
{ {
::std::list< SwAccessibleChild > aChildren; ::std::list< SwAccessibleChild > aChildren;
rContext.GetChildren( *(rContext.GetMap()), aChildren ); m_rContext.GetChildren( *(m_rContext.GetMap()), aChildren );
::std::list< SwAccessibleChild >::const_iterator aIter = ::std::list< SwAccessibleChild >::const_iterator aIter =
aChildren.begin(); aChildren.begin();
...@@ -242,8 +242,8 @@ sal_Int32 SwAccessibleSelectionHelper::getSelectedAccessibleChildCount( ) ...@@ -242,8 +242,8 @@ sal_Int32 SwAccessibleSelectionHelper::getSelectedAccessibleChildCount( )
{ {
const SwAccessibleChild& rChild = *aIter; const SwAccessibleChild& rChild = *aIter;
if( rChild.GetDrawObject() && !rChild.GetSwFrm() && if( rChild.GetDrawObject() && !rChild.GetSwFrm() &&
SwAccessibleFrame::GetParent(rChild, rContext.IsInPagePreview()) SwAccessibleFrame::GetParent(rChild, m_rContext.IsInPagePreview())
== rContext.GetFrm() && == m_rContext.GetFrm() &&
pFEShell->IsObjSelected( *rChild.GetDrawObject() ) ) pFEShell->IsObjSelected( *rChild.GetDrawObject() ) )
{ {
nCount++; nCount++;
...@@ -257,7 +257,7 @@ sal_Int32 SwAccessibleSelectionHelper::getSelectedAccessibleChildCount( ) ...@@ -257,7 +257,7 @@ sal_Int32 SwAccessibleSelectionHelper::getSelectedAccessibleChildCount( )
if( nCount == 0 ) if( nCount == 0 )
{ {
::std::list< SwAccessibleChild > aChildren; ::std::list< SwAccessibleChild > aChildren;
rContext.GetChildren( *(rContext.GetMap()), aChildren ); m_rContext.GetChildren( *(m_rContext.GetMap()), aChildren );
::std::list< SwAccessibleChild >::const_iterator aIter = ::std::list< SwAccessibleChild >::const_iterator aIter =
aChildren.begin(); aChildren.begin();
::std::list< SwAccessibleChild >::const_iterator aEndIter = ::std::list< SwAccessibleChild >::const_iterator aEndIter =
...@@ -265,7 +265,7 @@ sal_Int32 SwAccessibleSelectionHelper::getSelectedAccessibleChildCount( ) ...@@ -265,7 +265,7 @@ sal_Int32 SwAccessibleSelectionHelper::getSelectedAccessibleChildCount( )
while( aIter != aEndIter ) while( aIter != aEndIter )
{ {
const SwAccessibleChild& aChild = *aIter; const SwAccessibleChild& aChild = *aIter;
if( lcl_getSelectedState( aChild, &rContext, rContext.GetMap() ) ) if( lcl_getSelectedState( aChild, &m_rContext, m_rContext.GetMap() ) )
nCount++; nCount++;
++aIter; ++aIter;
} }
...@@ -295,7 +295,7 @@ Reference<XAccessible> SwAccessibleSelectionHelper::getSelectedAccessibleChild( ...@@ -295,7 +295,7 @@ Reference<XAccessible> SwAccessibleSelectionHelper::getSelectedAccessibleChild(
{ {
if( 0 == nSelectedChildIndex ) if( 0 == nSelectedChildIndex )
{ {
if(SwAccessibleFrame::GetParent( SwAccessibleChild(pFlyFrm), rContext.IsInPagePreview()) == rContext.GetFrm() ) if(SwAccessibleFrame::GetParent( SwAccessibleChild(pFlyFrm), m_rContext.IsInPagePreview()) == m_rContext.GetFrm() )
{ {
aChild = pFlyFrm; aChild = pFlyFrm;
} }
...@@ -307,7 +307,7 @@ Reference<XAccessible> SwAccessibleSelectionHelper::getSelectedAccessibleChild( ...@@ -307,7 +307,7 @@ Reference<XAccessible> SwAccessibleSelectionHelper::getSelectedAccessibleChild(
const SwFmtAnchor& pAnchor = pFrmFmt->GetAnchor(); const SwFmtAnchor& pAnchor = pFrmFmt->GetAnchor();
if( pAnchor.GetAnchorId() == FLY_AS_CHAR ) if( pAnchor.GetAnchorId() == FLY_AS_CHAR )
{ {
const SwFrm *pParaFrm = SwAccessibleFrame::GetParent( SwAccessibleChild(pFlyFrm), rContext.IsInPagePreview() ); const SwFrm *pParaFrm = SwAccessibleFrame::GetParent( SwAccessibleChild(pFlyFrm), m_rContext.IsInPagePreview() );
aChild = pParaFrm; aChild = pParaFrm;
} }
} }
...@@ -321,7 +321,7 @@ Reference<XAccessible> SwAccessibleSelectionHelper::getSelectedAccessibleChild( ...@@ -321,7 +321,7 @@ Reference<XAccessible> SwAccessibleSelectionHelper::getSelectedAccessibleChild(
throwIndexOutOfBoundsException(); throwIndexOutOfBoundsException();
::std::list< SwAccessibleChild > aChildren; ::std::list< SwAccessibleChild > aChildren;
rContext.GetChildren( *(rContext.GetMap()), aChildren ); m_rContext.GetChildren( *(m_rContext.GetMap()), aChildren );
::std::list< SwAccessibleChild >::const_iterator aIter = aChildren.begin(); ::std::list< SwAccessibleChild >::const_iterator aIter = aChildren.begin();
::std::list< SwAccessibleChild >::const_iterator aEndIter = aChildren.end(); ::std::list< SwAccessibleChild >::const_iterator aEndIter = aChildren.end();
...@@ -329,8 +329,8 @@ Reference<XAccessible> SwAccessibleSelectionHelper::getSelectedAccessibleChild( ...@@ -329,8 +329,8 @@ Reference<XAccessible> SwAccessibleSelectionHelper::getSelectedAccessibleChild(
{ {
const SwAccessibleChild& rChild = *aIter; const SwAccessibleChild& rChild = *aIter;
if( rChild.GetDrawObject() && !rChild.GetSwFrm() && if( rChild.GetDrawObject() && !rChild.GetSwFrm() &&
SwAccessibleFrame::GetParent(rChild, rContext.IsInPagePreview()) == SwAccessibleFrame::GetParent(rChild, m_rContext.IsInPagePreview()) ==
rContext.GetFrm() && m_rContext.GetFrm() &&
pFEShell->IsObjSelected( *rChild.GetDrawObject() ) ) pFEShell->IsObjSelected( *rChild.GetDrawObject() ) )
{ {
if( 0 == nSelectedChildIndex ) if( 0 == nSelectedChildIndex )
...@@ -345,24 +345,24 @@ Reference<XAccessible> SwAccessibleSelectionHelper::getSelectedAccessibleChild( ...@@ -345,24 +345,24 @@ Reference<XAccessible> SwAccessibleSelectionHelper::getSelectedAccessibleChild(
if( !aChild.IsValid() ) if( !aChild.IsValid() )
throwIndexOutOfBoundsException(); throwIndexOutOfBoundsException();
OSL_ENSURE( rContext.GetMap() != NULL, "We need the map." ); OSL_ENSURE( m_rContext.GetMap() != NULL, "We need the map." );
Reference< XAccessible > xChild; Reference< XAccessible > xChild;
if( aChild.GetSwFrm() ) if( aChild.GetSwFrm() )
{ {
::rtl::Reference < SwAccessibleContext > xChildImpl( ::rtl::Reference < SwAccessibleContext > xChildImpl(
rContext.GetMap()->GetContextImpl( aChild.GetSwFrm(), m_rContext.GetMap()->GetContextImpl( aChild.GetSwFrm(),
true ) ); true ) );
if( xChildImpl.is() ) if( xChildImpl.is() )
{ {
xChildImpl->SetParent( &rContext ); xChildImpl->SetParent( &m_rContext );
xChild = xChildImpl.get(); xChild = xChildImpl.get();
} }
} }
else if ( aChild.GetDrawObject() ) else if ( aChild.GetDrawObject() )
{ {
::rtl::Reference < ::accessibility::AccessibleShape > xChildImpl( ::rtl::Reference < ::accessibility::AccessibleShape > xChildImpl(
rContext.GetMap()->GetContextImpl( aChild.GetDrawObject(), m_rContext.GetMap()->GetContextImpl( aChild.GetDrawObject(),
&rContext, true ) ); &m_rContext, true ) );
if( xChildImpl.is() ) if( xChildImpl.is() )
xChild = xChildImpl.get(); xChild = xChildImpl.get();
} }
...@@ -378,7 +378,7 @@ void SwAccessibleSelectionHelper::deselectAccessibleChild( ...@@ -378,7 +378,7 @@ void SwAccessibleSelectionHelper::deselectAccessibleChild(
SolarMutexGuard g; SolarMutexGuard g;
if( nChildIndex < 0 || if( nChildIndex < 0 ||
nChildIndex >= rContext.GetChildCount( *(rContext.GetMap()) ) ) nChildIndex >= m_rContext.GetChildCount( *(m_rContext.GetMap()) ) )
throwIndexOutOfBoundsException(); throwIndexOutOfBoundsException();
} }
......
...@@ -28,7 +28,7 @@ class SwFEShell; ...@@ -28,7 +28,7 @@ class SwFEShell;
class SwAccessibleSelectionHelper class SwAccessibleSelectionHelper
{ {
/// the context on which this helper works /// the context on which this helper works
SwAccessibleContext& rContext; SwAccessibleContext& m_rContext;
/// get FE-Shell /// get FE-Shell
SwFEShell* GetFEShell(); SwFEShell* GetFEShell();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment