diff options
Diffstat (limited to 'editeng/source/uno/unoedprx.cxx')
-rw-r--r-- | editeng/source/uno/unoedprx.cxx | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/editeng/source/uno/unoedprx.cxx b/editeng/source/uno/unoedprx.cxx index a0eb64a93224..91a4ac15b600 100644 --- a/editeng/source/uno/unoedprx.cxx +++ b/editeng/source/uno/unoedprx.cxx @@ -815,32 +815,30 @@ bool SvxAccessibleTextAdapter::GetIndexAtPoint( const Point& rPoint, sal_Int32& } } - if( aIndex.InField() ) - { - OutputDevice* pOutDev = GetRefDevice(); + if( !aIndex.InField() ) + return true; - DBG_ASSERT(pOutDev!=nullptr, "SvxAccessibleTextAdapter::GetIndexAtPoint: No ref device"); + OutputDevice* pOutDev = GetRefDevice(); - if( !pOutDev ) - return false; + DBG_ASSERT(pOutDev!=nullptr, "SvxAccessibleTextAdapter::GetIndexAtPoint: No ref device"); - ESelection aSelection = MakeEESelection( aIndex ); - SvxFont aFont = EditEngine::CreateSvxFontFromItemSet( mpTextForwarder->GetAttribs( aSelection ) ); - AccessibleStringWrap aStringWrap( *pOutDev, - aFont, - mpTextForwarder->GetText( aSelection ) ); + if( !pOutDev ) + return false; - tools::Rectangle aRect = mpTextForwarder->GetCharBounds( nPara, aIndex.GetEEIndex() ); - Point aPoint = rPoint; - aPoint.Move( -aRect.Left(), -aRect.Top() ); + ESelection aSelection = MakeEESelection( aIndex ); + SvxFont aFont = EditEngine::CreateSvxFontFromItemSet( mpTextForwarder->GetAttribs( aSelection ) ); + AccessibleStringWrap aStringWrap( *pOutDev, + aFont, + mpTextForwarder->GetText( aSelection ) ); - DBG_ASSERT(aIndex.GetIndex() + aStringWrap.GetIndexAtPoint( rPoint ) >= 0, - "SvxAccessibleTextIndex::SetIndex: index value overflow"); + tools::Rectangle aRect = mpTextForwarder->GetCharBounds( nPara, aIndex.GetEEIndex() ); + Point aPoint = rPoint; + aPoint.Move( -aRect.Left(), -aRect.Top() ); - nIndex = (aIndex.GetIndex() + aStringWrap.GetIndexAtPoint( aPoint )); - return true; - } + DBG_ASSERT(aIndex.GetIndex() + aStringWrap.GetIndexAtPoint( rPoint ) >= 0, + "SvxAccessibleTextIndex::SetIndex: index value overflow"); + nIndex = (aIndex.GetIndex() + aStringWrap.GetIndexAtPoint( aPoint )); return true; } |