From 62dce85e692db290bb3db6312facba6b1b8a6fd3 Mon Sep 17 00:00:00 2001 From: "mjudge%netscape.com" Date: Wed, 7 Apr 1999 22:56:09 +0000 Subject: [PATCH] indexes returned from prepareunicodestring are mContentOffset based. 3641 3772 Hoffman approved git-svn-id: svn://10.0.0.236/trunk@26754 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/generic/nsTextFrame.cpp | 16 ++++++++-------- mozilla/layout/html/base/src/nsTextFrame.cpp | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/mozilla/layout/generic/nsTextFrame.cpp b/mozilla/layout/generic/nsTextFrame.cpp index 27c9349112b..ba815de68d3 100644 --- a/mozilla/layout/generic/nsTextFrame.cpp +++ b/mozilla/layout/generic/nsTextFrame.cpp @@ -839,7 +839,7 @@ TextFrame::PaintUnicodeText(nsIPresContext& aPresContext, } else { 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]++; nscoord textWidth; @@ -1325,7 +1325,7 @@ TextFrame::PaintTextSlowly(nsIPresContext& aPresContext, } else { 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]++; nscoord textWidth; if (mSelectionOffset < 0) @@ -1477,7 +1477,7 @@ TextFrame::PaintAsciiText(nsIPresContext& aPresContext, } else { 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]++; nscoord textWidth; if (mSelectionOffset < 0) @@ -1686,7 +1686,7 @@ TextFrame::GetPosition(nsIPresContext& aCX, PrepareUnicodeText(tx, ip, paintBuf, textLength, width); 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]++; PRInt32 offset = mContentOffset + mContentLength; @@ -1711,7 +1711,7 @@ TextFrame::GetPosition(nsIPresContext& aCX, index++; } - offset = 0; +/* offset = 0; PRInt32 j; PRInt32* ptr = ip; for (j=0;j<=PRInt32(mContentLength);j++) { @@ -1720,7 +1720,7 @@ TextFrame::GetPosition(nsIPresContext& aCX, break; } ptr++; - } + } */ } if (ip != indicies) { @@ -1912,7 +1912,7 @@ TextFrame::GetPointFromOffset(nsIPresContext* inPresContext, nsIRenderingContext ip, paintBuf, textLength, width); 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]++; if (inOffset > mContentLength){ NS_ASSERTION(0, "invalid offset passed to GetPointFromOffset"); @@ -2005,7 +2005,7 @@ TextFrame::PeekOffset(nsSelectionAmount aAmount, nsDirection aDirection, PRInt32 case eSelectCharacter : { PrepareUnicodeText(tx, ip, paintBuf, textLength, width); 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]++; nsIFrame *frameUsed = nsnull; PRInt32 start; diff --git a/mozilla/layout/html/base/src/nsTextFrame.cpp b/mozilla/layout/html/base/src/nsTextFrame.cpp index 27c9349112b..ba815de68d3 100644 --- a/mozilla/layout/html/base/src/nsTextFrame.cpp +++ b/mozilla/layout/html/base/src/nsTextFrame.cpp @@ -839,7 +839,7 @@ TextFrame::PaintUnicodeText(nsIPresContext& aPresContext, } else { 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]++; nscoord textWidth; @@ -1325,7 +1325,7 @@ TextFrame::PaintTextSlowly(nsIPresContext& aPresContext, } else { 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]++; nscoord textWidth; if (mSelectionOffset < 0) @@ -1477,7 +1477,7 @@ TextFrame::PaintAsciiText(nsIPresContext& aPresContext, } else { 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]++; nscoord textWidth; if (mSelectionOffset < 0) @@ -1686,7 +1686,7 @@ TextFrame::GetPosition(nsIPresContext& aCX, PrepareUnicodeText(tx, ip, paintBuf, textLength, width); 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]++; PRInt32 offset = mContentOffset + mContentLength; @@ -1711,7 +1711,7 @@ TextFrame::GetPosition(nsIPresContext& aCX, index++; } - offset = 0; +/* offset = 0; PRInt32 j; PRInt32* ptr = ip; for (j=0;j<=PRInt32(mContentLength);j++) { @@ -1720,7 +1720,7 @@ TextFrame::GetPosition(nsIPresContext& aCX, break; } ptr++; - } + } */ } if (ip != indicies) { @@ -1912,7 +1912,7 @@ TextFrame::GetPointFromOffset(nsIPresContext* inPresContext, nsIRenderingContext ip, paintBuf, textLength, width); 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]++; if (inOffset > mContentLength){ NS_ASSERTION(0, "invalid offset passed to GetPointFromOffset"); @@ -2005,7 +2005,7 @@ TextFrame::PeekOffset(nsSelectionAmount aAmount, nsDirection aDirection, PRInt32 case eSelectCharacter : { PrepareUnicodeText(tx, ip, paintBuf, textLength, width); 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]++; nsIFrame *frameUsed = nsnull; PRInt32 start;