Kaydet (Commit) 3fa4b0a0 authored tarafından Niklas Johansson's avatar Niklas Johansson Kaydeden (comit) Caolán McNamara

fdo#74983: Instability in A11y after integration of IA2-branch

The IA2-integration added some special cases for calculating textbounds for
attributeruns when automatic spellchecking is active. This does not seem to
effect linux but messes up accessibility on mac. This patch removes the special
cases avoids the problem on Mac. When daily builds gets available for Windows
I will do some testing there to see if I can find any problems.

Change-Id: I203da4fe1c6e5d4915d19e1704073e58f8aa88c9
Reviewed-on: https://gerrit.libreoffice.org/8591Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 4999a739
...@@ -916,65 +916,6 @@ sal_Bool SwAccessibleParagraph::GetTextBoundary( ...@@ -916,65 +916,6 @@ sal_Bool SwAccessibleParagraph::GetTextBoundary(
case AccessibleTextType::ATTRIBUTE_RUN: case AccessibleTextType::ATTRIBUTE_RUN:
bRet = GetAttributeBoundary( rBound, rText, nPos ); bRet = GetAttributeBoundary( rBound, rText, nPos );
if(bRet)
{
SwCrsrShell* pCrsrShell = GetCrsrShell();
if( pCrsrShell != NULL && pCrsrShell->GetViewOptions() && pCrsrShell->GetViewOptions()->IsOnlineSpell())
{
SwTxtNode* pTxtNode = const_cast<SwTxtNode*>( GetTxtNode() );
if(pTxtNode)
{
const SwWrongList* pWrongList = pTxtNode->GetWrong();
if( NULL != pWrongList )
{
sal_Int32 nBegin = nPos;
sal_Int32 nLen = 1;
const sal_Int32 nNext = pWrongList->NextWrong(nBegin);
sal_Int32 nLast = 0;
sal_uInt16 nWrongPos = pWrongList->GetWrongPos( nBegin );
if ( nWrongPos >= pWrongList->Count() ||
( nLast = pWrongList->Pos( nWrongPos ) ) >= nBegin )
{
nLast = nWrongPos
? pWrongList->Pos( --nWrongPos )
: COMPLETE_STRING;
}
if ( nBegin > pWrongList->GetBeginInv() &&
( nLast == COMPLETE_STRING || nLast < pWrongList->GetEndInv() ) )
{
nLast = min(nBegin, pWrongList->GetEndInv());
}
else if ( nLast < COMPLETE_STRING )
{
nLast += pWrongList->Len( nWrongPos );
}
const bool bIn = pWrongList->InWrongWord(nBegin, nLen); // && !pTxtNode->IsSymbol(nBegin) )
if(bIn)
{
rBound.startPos = max(nNext, rBound.startPos);
rBound.endPos = min(nNext+nLen, rBound.endPos);
}
else
{
if (COMPLETE_STRING == nLast)//first
{
rBound.endPos = min(nNext, rBound.endPos);
}
else if(COMPLETE_STRING == nNext)
{
rBound.startPos = max(nLast, rBound.startPos);
}
else
{
rBound.startPos = max(nLast, rBound.startPos);
rBound.endPos = min(nNext, rBound.endPos);
}
}
}
}
}
}
break; break;
case AccessibleTextType::GLYPH: case AccessibleTextType::GLYPH:
......
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