From ffb5bf421f5c0c565128116df40318f5b707b821 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Thu, 15 Dec 2016 23:00:25 +0100 Subject: svx: remove nonsense exception throwing code Commit 60f11adb950e4f9645cc9ecb0f5af8235cc97366 added code to AccessibleShape::getAccessibleStateSet() that tries to retrieve some state from the parent, but the implementation of the base class AccessibleContextBase::getAccessibleParent() throws if it is already disposed, which is the condition checked just before, so surely this doesn't have any other effect than throw DisposedException, except possibly in the mpText == null case which is already handled in the other branch with identical code. Change-Id: Iaf109f69036437989abbbf914ef32cca1528a97e --- svx/source/accessibility/AccessibleShape.cxx | 32 ++-------------------------- 1 file changed, 2 insertions(+), 30 deletions(-) (limited to 'svx') diff --git a/svx/source/accessibility/AccessibleShape.cxx b/svx/source/accessibility/AccessibleShape.cxx index b7a23a85aaad..8df4e044dff2 100644 --- a/svx/source/accessibility/AccessibleShape.cxx +++ b/svx/source/accessibility/AccessibleShape.cxx @@ -410,38 +410,10 @@ uno::Reference SAL_CALL ::osl::MutexGuard aGuard (maMutex); Reference xStateSet; - if (rBHelper.bDisposed || mpText == nullptr) - // Return a minimal state set that only contains the DEFUNC state. + if (IsDisposed()) { + // Return a minimal state set that only contains the DEFUNC state. xStateSet = AccessibleContextBase::getAccessibleStateSet (); - ::utl::AccessibleStateSetHelper* pStateSet = - static_cast< ::utl::AccessibleStateSetHelper*>(mxStateSet.get()); - css::uno::Reference xTempAcc = getAccessibleParent(); - if( xTempAcc.is() ) - { - css::uno::Reference - xTempAccContext = xTempAcc->getAccessibleContext(); - if( xTempAccContext.is() ) - { - css::uno::Reference rState = - xTempAccContext->getAccessibleStateSet(); - if( rState.is() ) { - css::uno::Sequence aStates = rState->getStates(); - int count = aStates.getLength(); - for( int iIndex = 0;iIndex < count;iIndex++ ) - { - if( aStates[iIndex] == AccessibleStateType::EDITABLE ) - { - pStateSet->AddState (AccessibleStateType::EDITABLE); - pStateSet->AddState (AccessibleStateType::RESIZABLE); - pStateSet->AddState (AccessibleStateType::MOVEABLE); - break; - } - } - } - } - } - xStateSet.set( new ::utl::AccessibleStateSetHelper (*pStateSet)); } else { -- cgit