From 6bc947f3c9332935a6ad4c96820fad59c1191ada Mon Sep 17 00:00:00 2001 From: "kin%netscape.com" Date: Thu, 29 Nov 2001 22:54:15 +0000 Subject: [PATCH] Fix for bug 111264: nsTextFrame::SetSelected() calls Invalidate() with empty rect. Prevent SetSelected() from generating invalidate warnings by preventing calls to Invalidate with an empty rect. r=jfrancis@netscape.com sr=attinasi@netscape.com --- layout/generic/nsTextFrame.cpp | 3 ++- layout/html/base/src/nsTextFrame.cpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/layout/generic/nsTextFrame.cpp b/layout/generic/nsTextFrame.cpp index 5a8304a8f0a..26f02a9e004 100644 --- a/layout/generic/nsTextFrame.cpp +++ b/layout/generic/nsTextFrame.cpp @@ -3587,7 +3587,8 @@ nsTextFrame::SetSelected(nsIPresContext* aPresContext, nsRect frameRect; GetRect(frameRect); nsRect rect(0, 0, frameRect.width, frameRect.height); - Invalidate(aPresContext, rect, PR_FALSE); + if (!rect.IsEmpty()) + Invalidate(aPresContext, rect, PR_FALSE); // ForceDrawFrame(this); } if (aSpread == eSpreadDown) diff --git a/layout/html/base/src/nsTextFrame.cpp b/layout/html/base/src/nsTextFrame.cpp index 5a8304a8f0a..26f02a9e004 100644 --- a/layout/html/base/src/nsTextFrame.cpp +++ b/layout/html/base/src/nsTextFrame.cpp @@ -3587,7 +3587,8 @@ nsTextFrame::SetSelected(nsIPresContext* aPresContext, nsRect frameRect; GetRect(frameRect); nsRect rect(0, 0, frameRect.width, frameRect.height); - Invalidate(aPresContext, rect, PR_FALSE); + if (!rect.IsEmpty()) + Invalidate(aPresContext, rect, PR_FALSE); // ForceDrawFrame(this); } if (aSpread == eSpreadDown)