indexes returned from prepareunicodestring are mContentOffset based. 3641 3772 Hoffman approved

This commit is contained in:
mjudge%netscape.com 1999-04-07 22:56:09 +00:00
Родитель 2bb61f6606
Коммит fae945861f
2 изменённых файлов: 16 добавлений и 16 удалений

Просмотреть файл

@ -839,7 +839,7 @@ TextFrame::PaintUnicodeText(nsIPresContext& aPresContext,
} }
else { else {
ip[mContentLength] = ip[mContentLength-1]; ip[mContentLength] = ip[mContentLength-1];
if (ip[mContentLength] < textLength)//must set up last one for selection beyond edge if in boundary if ((ip[mContentLength]-mContentOffset) < textLength)//must set up last one for selection beyond edge if in boundary
ip[mContentLength]++; ip[mContentLength]++;
nscoord textWidth; nscoord textWidth;
@ -1325,7 +1325,7 @@ TextFrame::PaintTextSlowly(nsIPresContext& aPresContext,
} }
else { else {
ip[mContentLength] = ip[mContentLength-1]; ip[mContentLength] = ip[mContentLength-1];
if (ip[mContentLength] < textLength)//must set up last one for selection beyond edge if in boundary if ((ip[mContentLength]-mContentOffset) < textLength)//must set up last one for selection beyond edge if in boundary
ip[mContentLength]++; ip[mContentLength]++;
nscoord textWidth; nscoord textWidth;
if (mSelectionOffset < 0) if (mSelectionOffset < 0)
@ -1477,7 +1477,7 @@ TextFrame::PaintAsciiText(nsIPresContext& aPresContext,
} }
else { else {
ip[mContentLength] = ip[mContentLength-1]; ip[mContentLength] = ip[mContentLength-1];
if (ip[mContentLength] < textLength)//must set up last one for selection beyond edge if in boundary if ((ip[mContentLength]-mContentOffset) < textLength)//must set up last one for selection beyond edge if in boundary
ip[mContentLength]++; ip[mContentLength]++;
nscoord textWidth; nscoord textWidth;
if (mSelectionOffset < 0) if (mSelectionOffset < 0)
@ -1686,7 +1686,7 @@ TextFrame::GetPosition(nsIPresContext& aCX,
PrepareUnicodeText(tx, PrepareUnicodeText(tx,
ip, paintBuf, textLength, width); ip, paintBuf, textLength, width);
ip[mContentLength] = ip[mContentLength-1]; ip[mContentLength] = ip[mContentLength-1];
if (ip[mContentLength] < textLength)//must set up last one for selection beyond edge if in boundary if ((ip[mContentLength]-mContentOffset) < textLength)//must set up last one for selection beyond edge if in boundary
ip[mContentLength]++; ip[mContentLength]++;
PRInt32 offset = mContentOffset + mContentLength; PRInt32 offset = mContentOffset + mContentLength;
@ -1711,7 +1711,7 @@ TextFrame::GetPosition(nsIPresContext& aCX,
index++; index++;
} }
offset = 0; /* offset = 0;
PRInt32 j; PRInt32 j;
PRInt32* ptr = ip; PRInt32* ptr = ip;
for (j=0;j<=PRInt32(mContentLength);j++) { for (j=0;j<=PRInt32(mContentLength);j++) {
@ -1720,7 +1720,7 @@ TextFrame::GetPosition(nsIPresContext& aCX,
break; break;
} }
ptr++; ptr++;
} } */
} }
if (ip != indicies) { if (ip != indicies) {
@ -1912,7 +1912,7 @@ TextFrame::GetPointFromOffset(nsIPresContext* inPresContext, nsIRenderingContext
ip, ip,
paintBuf, textLength, width); paintBuf, textLength, width);
ip[mContentLength] = ip[mContentLength-1]; ip[mContentLength] = ip[mContentLength-1];
if (ip[mContentLength] < textLength)//must set up last one for selection beyond edge if in boundary if ((ip[mContentLength]-mContentOffset) < textLength)//must set up last one for selection beyond edge if in boundary
ip[mContentLength]++; ip[mContentLength]++;
if (inOffset > mContentLength){ if (inOffset > mContentLength){
NS_ASSERTION(0, "invalid offset passed to GetPointFromOffset"); NS_ASSERTION(0, "invalid offset passed to GetPointFromOffset");
@ -2005,7 +2005,7 @@ TextFrame::PeekOffset(nsSelectionAmount aAmount, nsDirection aDirection, PRInt32
case eSelectCharacter : { case eSelectCharacter : {
PrepareUnicodeText(tx, ip, paintBuf, textLength, width); PrepareUnicodeText(tx, ip, paintBuf, textLength, width);
ip[mContentLength] = ip[mContentLength-1]; ip[mContentLength] = ip[mContentLength-1];
if (ip[mContentLength] < textLength)//must set up last one for selection beyond edge if in boundary if ((ip[mContentLength]-mContentOffset) < textLength)//must set up last one for selection beyond edge if in boundary
ip[mContentLength]++; ip[mContentLength]++;
nsIFrame *frameUsed = nsnull; nsIFrame *frameUsed = nsnull;
PRInt32 start; PRInt32 start;

Просмотреть файл

@ -839,7 +839,7 @@ TextFrame::PaintUnicodeText(nsIPresContext& aPresContext,
} }
else { else {
ip[mContentLength] = ip[mContentLength-1]; ip[mContentLength] = ip[mContentLength-1];
if (ip[mContentLength] < textLength)//must set up last one for selection beyond edge if in boundary if ((ip[mContentLength]-mContentOffset) < textLength)//must set up last one for selection beyond edge if in boundary
ip[mContentLength]++; ip[mContentLength]++;
nscoord textWidth; nscoord textWidth;
@ -1325,7 +1325,7 @@ TextFrame::PaintTextSlowly(nsIPresContext& aPresContext,
} }
else { else {
ip[mContentLength] = ip[mContentLength-1]; ip[mContentLength] = ip[mContentLength-1];
if (ip[mContentLength] < textLength)//must set up last one for selection beyond edge if in boundary if ((ip[mContentLength]-mContentOffset) < textLength)//must set up last one for selection beyond edge if in boundary
ip[mContentLength]++; ip[mContentLength]++;
nscoord textWidth; nscoord textWidth;
if (mSelectionOffset < 0) if (mSelectionOffset < 0)
@ -1477,7 +1477,7 @@ TextFrame::PaintAsciiText(nsIPresContext& aPresContext,
} }
else { else {
ip[mContentLength] = ip[mContentLength-1]; ip[mContentLength] = ip[mContentLength-1];
if (ip[mContentLength] < textLength)//must set up last one for selection beyond edge if in boundary if ((ip[mContentLength]-mContentOffset) < textLength)//must set up last one for selection beyond edge if in boundary
ip[mContentLength]++; ip[mContentLength]++;
nscoord textWidth; nscoord textWidth;
if (mSelectionOffset < 0) if (mSelectionOffset < 0)
@ -1686,7 +1686,7 @@ TextFrame::GetPosition(nsIPresContext& aCX,
PrepareUnicodeText(tx, PrepareUnicodeText(tx,
ip, paintBuf, textLength, width); ip, paintBuf, textLength, width);
ip[mContentLength] = ip[mContentLength-1]; ip[mContentLength] = ip[mContentLength-1];
if (ip[mContentLength] < textLength)//must set up last one for selection beyond edge if in boundary if ((ip[mContentLength]-mContentOffset) < textLength)//must set up last one for selection beyond edge if in boundary
ip[mContentLength]++; ip[mContentLength]++;
PRInt32 offset = mContentOffset + mContentLength; PRInt32 offset = mContentOffset + mContentLength;
@ -1711,7 +1711,7 @@ TextFrame::GetPosition(nsIPresContext& aCX,
index++; index++;
} }
offset = 0; /* offset = 0;
PRInt32 j; PRInt32 j;
PRInt32* ptr = ip; PRInt32* ptr = ip;
for (j=0;j<=PRInt32(mContentLength);j++) { for (j=0;j<=PRInt32(mContentLength);j++) {
@ -1720,7 +1720,7 @@ TextFrame::GetPosition(nsIPresContext& aCX,
break; break;
} }
ptr++; ptr++;
} } */
} }
if (ip != indicies) { if (ip != indicies) {
@ -1912,7 +1912,7 @@ TextFrame::GetPointFromOffset(nsIPresContext* inPresContext, nsIRenderingContext
ip, ip,
paintBuf, textLength, width); paintBuf, textLength, width);
ip[mContentLength] = ip[mContentLength-1]; ip[mContentLength] = ip[mContentLength-1];
if (ip[mContentLength] < textLength)//must set up last one for selection beyond edge if in boundary if ((ip[mContentLength]-mContentOffset) < textLength)//must set up last one for selection beyond edge if in boundary
ip[mContentLength]++; ip[mContentLength]++;
if (inOffset > mContentLength){ if (inOffset > mContentLength){
NS_ASSERTION(0, "invalid offset passed to GetPointFromOffset"); NS_ASSERTION(0, "invalid offset passed to GetPointFromOffset");
@ -2005,7 +2005,7 @@ TextFrame::PeekOffset(nsSelectionAmount aAmount, nsDirection aDirection, PRInt32
case eSelectCharacter : { case eSelectCharacter : {
PrepareUnicodeText(tx, ip, paintBuf, textLength, width); PrepareUnicodeText(tx, ip, paintBuf, textLength, width);
ip[mContentLength] = ip[mContentLength-1]; ip[mContentLength] = ip[mContentLength-1];
if (ip[mContentLength] < textLength)//must set up last one for selection beyond edge if in boundary if ((ip[mContentLength]-mContentOffset) < textLength)//must set up last one for selection beyond edge if in boundary
ip[mContentLength]++; ip[mContentLength]++;
nsIFrame *frameUsed = nsnull; nsIFrame *frameUsed = nsnull;
PRInt32 start; PRInt32 start;