Kaydet (Commit) 2bdb926b authored tarafından Michael Stahl's avatar Michael Stahl

tdf#118219 sw: fix SwCursorShell::GetContentAtPos() redline crash

The problem is that CalcStartEnd() will not return the length of the
node, but COMPLETE_STRING if the redline ends in a subsequent node.

(regression from 4966b1d4)

Change-Id: Ic0a27f87b79f68417777842c611c2129fdc9b1f9
Reviewed-on: https://gerrit.libreoffice.org/56402
Tested-by: Jenkins
Reviewed-by: 's avatarMichael Stahl <Michael.Stahl@cib.de>
üst 276b2f53
...@@ -1556,6 +1556,17 @@ bool SwCursorShell::GetContentAtPos( const Point& rPt, ...@@ -1556,6 +1556,17 @@ bool SwCursorShell::GetContentAtPos( const Point& rPt,
sal_Int32 nStart; sal_Int32 nStart;
sal_Int32 nEnd; sal_Int32 nEnd;
pRedl->CalcStartEnd(pTextNd->GetIndex(), nStart, nEnd); pRedl->CalcStartEnd(pTextNd->GetIndex(), nStart, nEnd);
if (nStart == COMPLETE_STRING)
{
// consistency: found pRedl, so there must be
// something in pTextNd
assert(nEnd != COMPLETE_STRING);
nStart = 0;
}
if (nEnd == COMPLETE_STRING)
{
nEnd = pTextNd->Len();
}
//get bounding box of range //get bounding box of range
SwRect aStart; SwRect aStart;
pFrame->GetCharRect(aStart, SwPosition(*pTextNd, nStart), &aTmpState); pFrame->GetCharRect(aStart, SwPosition(*pTextNd, nStart), &aTmpState);
......
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