selection should work now more or less

git-svn-id: svn://10.0.0.236/trunk@18003 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
mjudge%netscape.com
1999-01-19 06:42:39 +00:00
parent 7936b86b4a
commit 2434c90ca2
7 changed files with 114 additions and 64 deletions

View File

@@ -1618,12 +1618,15 @@ NS_IMETHODIMP
TextFrame::SetSelected(PRBool aSelected, PRInt32 aBeginOffset, PRInt32 aEndOffset, PRBool aForceRedraw)
{
if (aSelected){
if (aBeginOffset < 0)
aBeginOffset = 0;
aEndOffset = PR_MIN(aEndOffset,mContentLength);
aBeginOffset = PR_MIN(aBeginOffset,mContentLength);
if (aEndOffset < 0)
aEndOffset = mContentLength;
if ((PRInt32)aBeginOffset >= mContentLength)
if (aBeginOffset < 0)
aBeginOffset = mContentLength;
if (mSelectionOffset != aBeginOffset || mSelectionEnd != aEndOffset) {
mSelectionOffset = aBeginOffset;
mSelectionEnd = aEndOffset;