Checking in scc's fix for blocker bug 62818, nsSlidingSubstring::GetReadableFragment(..., kFragmentAt, ...) wasn't implemented and that caused a crash when serializing HTML to plain text. r=me.

This commit is contained in:
jst%netscape.com 2000-12-14 22:16:10 +00:00
parent de8a090ca0
commit c5961226d7
3 changed files with 36 additions and 3 deletions

View File

@ -233,7 +233,18 @@ nsSlidingSubstring::GetReadableFragment( nsReadableFragment<PRUnichar>& aFragmen
break;
case kFragmentAt:
// ...work...
{
// kFragmentAt is going away; we hate this linear search
PRUint32 N;
result_buffer = mStart.mBuffer;
while ( result_buffer && (N = PRUint32(result_buffer->DataLength())) < aOffset )
{
aOffset -= N;
result_buffer = result_buffer->mNext;
}
}
break;
}

View File

@ -233,7 +233,18 @@ nsSlidingSubstring::GetReadableFragment( nsReadableFragment<PRUnichar>& aFragmen
break;
case kFragmentAt:
// ...work...
{
// kFragmentAt is going away; we hate this linear search
PRUint32 N;
result_buffer = mStart.mBuffer;
while ( result_buffer && (N = PRUint32(result_buffer->DataLength())) < aOffset )
{
aOffset -= N;
result_buffer = result_buffer->mNext;
}
}
break;
}

View File

@ -233,7 +233,18 @@ nsSlidingSubstring::GetReadableFragment( nsReadableFragment<PRUnichar>& aFragmen
break;
case kFragmentAt:
// ...work...
{
// kFragmentAt is going away; we hate this linear search
PRUint32 N;
result_buffer = mStart.mBuffer;
while ( result_buffer && (N = PRUint32(result_buffer->DataLength())) < aOffset )
{
aOffset -= N;
result_buffer = result_buffer->mNext;
}
}
break;
}