Kaydet (Commit) eb433f83 authored tarafından Caolán McNamara's avatar Caolán McNamara

Resolves: tdf#106078 get bounding box of commented region for gtk3 tooltips

Change-Id: I4fdc1f471c6c191be9c7c611926bd2b5b2b41308
üst 94e6a847
...@@ -1439,12 +1439,18 @@ bool SwCursorShell::GetContentAtPos( const Point& rPt, ...@@ -1439,12 +1439,18 @@ bool SwCursorShell::GetContentAtPos( const Point& rPt,
if( pFieldRect && nullptr != ( pFrame = pTextNd->getLayoutFrame( GetLayout(), &aPt ) ) ) if( pFieldRect && nullptr != ( pFrame = pTextNd->getLayoutFrame( GetLayout(), &aPt ) ) )
{ {
//get bounding box of range
SwRect aStart; SwRect aStart;
SwPosition aStartPos(*pTextNd, nSt); SwPosition aStartPos(*pTextNd, nSt);
pFrame->GetCharRect(aStart, aStartPos, &aTmpState); pFrame->GetCharRect(aStart, aStartPos, &aTmpState);
SwRect aEnd; SwRect aEnd;
SwPosition aEndPos(*pTextNd, nEnd); SwPosition aEndPos(*pTextNd, nEnd);
pFrame->GetCharRect(aEnd, aEndPos, &aTmpState); pFrame->GetCharRect(aEnd, aEndPos, &aTmpState);
if (aStart.Top() != aEnd.Top() || aStart.Bottom() != aEnd.Bottom())
{
aStart.Left(pFrame->Frame().Left());
aEnd.Right(pFrame->Frame().Right());
}
*pFieldRect = aStart.Union(aEnd); *pFieldRect = aStart.Union(aEnd);
} }
} }
...@@ -1462,7 +1468,19 @@ bool SwCursorShell::GetContentAtPos( const Point& rPt, ...@@ -1462,7 +1468,19 @@ bool SwCursorShell::GetContentAtPos( const Point& rPt,
bRet = true; bRet = true;
if( pFieldRect && nullptr != ( pFrame = pTextNd->getLayoutFrame( GetLayout(), &aPt ) ) ) if( pFieldRect && nullptr != ( pFrame = pTextNd->getLayoutFrame( GetLayout(), &aPt ) ) )
pFrame->GetCharRect( *pFieldRect, aPos, &aTmpState ); {
//get bounding box of range
SwRect aStart;
pFrame->GetCharRect(aStart, *pRedl->Start(), &aTmpState);
SwRect aEnd;
pFrame->GetCharRect(aEnd, *pRedl->End(), &aTmpState);
if (aStart.Top() != aEnd.Top() || aStart.Bottom() != aEnd.Bottom())
{
aStart.Left(pFrame->Frame().Left());
aEnd.Right(pFrame->Frame().Right());
}
*pFieldRect = aStart.Union(aEnd);
}
} }
} }
} }
......
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