Kaydet (Commit) 4966b1d4 authored tarafından Michael Stahl's avatar Michael Stahl

sw_redlinehide: fix SwCursorShell::GetContentAtPos() redline code

This calls SwTextFrame::GetCharRect() on the frame where the mouse
cursor is, with SwPositions that may be in a unrelated SwTextNode.

Bogus positions now triggers asserts, so let's fix it.

Change-Id: Idedb335ffd79c299976ad91b683dfb30cd0ceac2
üst e26b6a3a
......@@ -1518,11 +1518,17 @@ bool SwCursorShell::GetContentAtPos( const Point& rPt,
if( pFieldRect && nullptr != ( pFrame = pTextNd->getLayoutFrame( GetLayout(), &aPt ) ) )
{
// not sure if this should be limited to one
// paragraph, or mark the entire redline; let's
// leave it limited to one for now...
sal_Int32 nStart;
sal_Int32 nEnd;
pRedl->CalcStartEnd(pTextNd->GetIndex(), nStart, nEnd);
//get bounding box of range
SwRect aStart;
pFrame->GetCharRect(aStart, *pRedl->Start(), &aTmpState);
pFrame->GetCharRect(aStart, SwPosition(*pTextNd, nStart), &aTmpState);
SwRect aEnd;
pFrame->GetCharRect(aEnd, *pRedl->End(), &aTmpState);
pFrame->GetCharRect(aEnd, SwPosition(*pTextNd, nEnd), &aTmpState);
if (aStart.Top() != aEnd.Top() || aStart.Bottom() != aEnd.Bottom())
{
aStart.Left(pFrame->getFrameArea().Left());
......
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