diff options
author | Michael Stahl <mstahl@redhat.com> | 2016-12-02 11:59:39 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2016-12-07 14:46:06 +0100 |
commit | 025f1c8d53b5f89777b016c48f8dad4e38294efc (patch) | |
tree | f2d9fcd058b80100c34ca58c48ef766ecbbfec63 /sw | |
parent | 3de93c85c7d7a0cf47000311757265c9bb7acd9d (diff) |
simplify SwAccessibleMap::GetContext()
Change-Id: I78e7e25c12181fb854134d92059ddd083261be1e
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/access/accmap.cxx | 94 |
1 files changed, 43 insertions, 51 deletions
diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx index 22fa43fb9658..d2090e0d9ff8 100644 --- a/sw/source/core/access/accmap.cxx +++ b/sw/source/core/access/accmap.cxx @@ -1914,43 +1914,40 @@ uno::Reference< XAccessible> SwAccessibleMap::GetContext( const SwFrame *pFrame, default: break; } xAcc = pAcc; + assert(xAcc.is()); - OSL_ENSURE( xAcc.is(), "unknown frame type" ); - if( xAcc.is() ) + if( aIter != mpFrameMap->end() ) { - if( aIter != mpFrameMap->end() ) - { - (*aIter).second = xAcc; - } - else - { - SwAccessibleContextMap_Impl::value_type aEntry( pFrame, xAcc ); - mpFrameMap->insert( aEntry ); - } + (*aIter).second = xAcc; + } + else + { + SwAccessibleContextMap_Impl::value_type aEntry( pFrame, xAcc ); + mpFrameMap->insert( aEntry ); + } - if( pAcc->HasCursor() && - !AreInSameTable( mxCursorContext, pFrame ) ) - { - // If the new context has the focus, and if we know - // another context that had the focus, then the focus - // just moves from the old context to the new one. We - // then have to send a focus event and a caret event for - // the old context. We have to do that now, - // because after we have left this method, anyone might - // call getStates for the new context and will get a - // focused state then. Sending the focus changes event - // after that seems to be strange. However, we cannot - // send a focus event for the new context now, because - // no one except us knows it. In any case, we remember - // the new context as the one that has the focus - // currently. - - xOldCursorAcc = mxCursorContext; - mxCursorContext = xAcc; - - bOldShapeSelected = mbShapeSelected; - mbShapeSelected = false; - } + if( pAcc->HasCursor() && + !AreInSameTable( mxCursorContext, pFrame ) ) + { + // If the new context has the focus, and if we know + // another context that had the focus, then the focus + // just moves from the old context to the new one. We + // then have to send a focus event and a caret event for + // the old context. We have to do that now, + // because after we have left this method, anyone might + // call getStates for the new context and will get a + // focused state then. Sending the focus changes event + // after that seems to be strange. However, we cannot + // send a focus event for the new context now, because + // no one except us knows it. In any case, we remember + // the new context as the one that has the focus + // currently. + + xOldCursorAcc = mxCursorContext; + mxCursorContext = xAcc; + + bOldShapeSelected = mbShapeSelected; + mbShapeSelected = false; } } } @@ -2014,25 +2011,20 @@ uno::Reference< XAccessible> SwAccessibleMap::GetContext( aShapeInfo, mpShapeMap->GetInfo() ); } xAcc = pAcc.get(); - - OSL_ENSURE( xAcc.is(), "unknown shape type" ); - if( xAcc.is() ) + assert(xAcc.is()); + pAcc->Init(); + if( aIter != mpShapeMap->end() ) { - pAcc->Init(); - if( aIter != mpShapeMap->end() ) - { - (*aIter).second = xAcc; - } - else - { - SwAccessibleShapeMap_Impl::value_type aEntry( pObj, - xAcc ); - mpShapeMap->insert( aEntry ); - } - // TODO: focus!!! + (*aIter).second = xAcc; + } + else + { + SwAccessibleShapeMap_Impl::value_type aEntry( pObj, + xAcc ); + mpShapeMap->insert( aEntry ); } - if (xAcc.is()) - AddGroupContext(pObj, xAcc); + // TODO: focus!!! + AddGroupContext(pObj, xAcc); } } } |