From 6a65d2857f92391a1ee9bffdadf627ad41b5d71f Mon Sep 17 00:00:00 2001 From: "sfraser%netscape.com" Date: Mon, 9 Aug 1999 19:15:04 +0000 Subject: [PATCH] Optimization so that moving a collapsed selection does not cause the frame to redraw. git-svn-id: svn://10.0.0.236/trunk@42782 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/generic/nsTextFrame.cpp | 12 +++++------- mozilla/layout/html/base/src/nsTextFrame.cpp | 12 +++++------- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/mozilla/layout/generic/nsTextFrame.cpp b/mozilla/layout/generic/nsTextFrame.cpp index d210357a6f0..ec28da3ec08 100644 --- a/mozilla/layout/generic/nsTextFrame.cpp +++ b/mozilla/layout/generic/nsTextFrame.cpp @@ -995,7 +995,7 @@ nsTextFrame::PaintUnicodeText(nsIPresContext* aPresContext, aTextStyle, dx, dy, width, text, details,0,(PRUint32)textLength); sdptr = details; if (details){ - while(sdptr = details->mNext){ + while ((sdptr = details->mNext) != nsnull) { delete details; details = sdptr; } @@ -1448,7 +1448,7 @@ nsTextFrame::PaintTextSlowly(nsIPresContext* aPresContext, PRUint32(textLength), dx, dy, width, details); sdptr = details; if (details){ - while(sdptr = details->mNext){ + while ((sdptr = details->mNext) != nsnull) { delete details; details = sdptr; } @@ -1564,7 +1564,7 @@ nsTextFrame::PaintAsciiText(nsIPresContext* aPresContext, aTextStyle, dx, dy, width, rawPaintBuf, details,0,textLength); sdptr = details; if (details){ - while(sdptr = details->mNext){ + while ((sdptr = details->mNext) != nsnull) { delete details; details = sdptr; } @@ -1826,11 +1826,9 @@ nsTextFrame::SetSelected(nsIDOMRange *aRange,PRBool aSelected, nsSpread aSpread) if ((mContentOffset + mContentLength) >= startOffset){ found = PR_TRUE; if (thisNode == endNode){ //special case - /*#ifndef SHOW_SELECTION_CURSOR - if (aSelected && (endOffset == startOffset)) //no need to redraw since drawing takes place with cursor + if (endOffset == startOffset) //no need to redraw since drawing takes place with cursor found = PR_FALSE; - #endif - */ + if (mContentOffset > endOffset) found = PR_FALSE; } diff --git a/mozilla/layout/html/base/src/nsTextFrame.cpp b/mozilla/layout/html/base/src/nsTextFrame.cpp index d210357a6f0..ec28da3ec08 100644 --- a/mozilla/layout/html/base/src/nsTextFrame.cpp +++ b/mozilla/layout/html/base/src/nsTextFrame.cpp @@ -995,7 +995,7 @@ nsTextFrame::PaintUnicodeText(nsIPresContext* aPresContext, aTextStyle, dx, dy, width, text, details,0,(PRUint32)textLength); sdptr = details; if (details){ - while(sdptr = details->mNext){ + while ((sdptr = details->mNext) != nsnull) { delete details; details = sdptr; } @@ -1448,7 +1448,7 @@ nsTextFrame::PaintTextSlowly(nsIPresContext* aPresContext, PRUint32(textLength), dx, dy, width, details); sdptr = details; if (details){ - while(sdptr = details->mNext){ + while ((sdptr = details->mNext) != nsnull) { delete details; details = sdptr; } @@ -1564,7 +1564,7 @@ nsTextFrame::PaintAsciiText(nsIPresContext* aPresContext, aTextStyle, dx, dy, width, rawPaintBuf, details,0,textLength); sdptr = details; if (details){ - while(sdptr = details->mNext){ + while ((sdptr = details->mNext) != nsnull) { delete details; details = sdptr; } @@ -1826,11 +1826,9 @@ nsTextFrame::SetSelected(nsIDOMRange *aRange,PRBool aSelected, nsSpread aSpread) if ((mContentOffset + mContentLength) >= startOffset){ found = PR_TRUE; if (thisNode == endNode){ //special case - /*#ifndef SHOW_SELECTION_CURSOR - if (aSelected && (endOffset == startOffset)) //no need to redraw since drawing takes place with cursor + if (endOffset == startOffset) //no need to redraw since drawing takes place with cursor found = PR_FALSE; - #endif - */ + if (mContentOffset > endOffset) found = PR_FALSE; }