From 3a7ddd351a27e19b58f466fd3e6140129624c6ff Mon Sep 17 00:00:00 2001 From: "mjudge%netscape.com" Date: Tue, 18 Dec 2001 21:05:55 +0000 Subject: [PATCH] smoketest fix 115791 --- layout/base/nsPresShell.cpp | 9 +++++---- layout/generic/nsFrame.cpp | 4 ++-- layout/html/base/src/nsFrame.cpp | 4 ++-- layout/html/base/src/nsPresShell.cpp | 9 +++++---- 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/layout/base/nsPresShell.cpp b/layout/base/nsPresShell.cpp index 751dcd5389c1..11af06b03ba2 100644 --- a/layout/base/nsPresShell.cpp +++ b/layout/base/nsPresShell.cpp @@ -1199,7 +1199,7 @@ protected: nsCOMPtr mSelection; nsCOMPtr mCaret; - PRPackedBool mDisplayNonTextSelection; + PRInt16 mSelectionFlags; PRPackedBool mScrollingEnabled; //used to disable programmable scrolling from outside PRPackedBool mPendingReflowEvent; PRPackedBool mBatchReflows; // When set to true, the pres shell batches reflow commands. @@ -1452,6 +1452,7 @@ PresShell::PresShell(): if (! gLog) gLog = PR_NewLogModule("PresShell"); #endif + mSelectionFlags = nsISelectionDisplay::DISPLAY_TEXT; } NS_IMPL_ADDREF(PresShell) @@ -3059,7 +3060,7 @@ NS_IMETHODIMP PresShell::GetCaretEnabled(PRBool *aOutEnabled) NS_IMETHODIMP PresShell::SetSelectionFlags(PRInt16 aInEnable) { - mDisplayNonTextSelection = aInEnable; + mSelectionFlags = aInEnable; return NS_OK; } @@ -3067,7 +3068,7 @@ NS_IMETHODIMP PresShell::GetSelectionFlags(PRInt16 *aOutEnable) { if (!aOutEnable) return NS_ERROR_INVALID_ARG; - *aOutEnable = mDisplayNonTextSelection; + *aOutEnable = mSelectionFlags; return NS_OK; } @@ -5842,7 +5843,7 @@ PresShell::HandleEvent(nsIView *aView, /* if (mSelection && aEvent->eventStructType == NS_KEY_EVENT) {//KEY HANDLERS WILL GET RID OF THIS - if (mDisplayNonTextSelection && NS_SUCCEEDED(mSelection->HandleKeyEvent(mPresContext, aEvent))) + if (mSelectionFlags && NS_SUCCEEDED(mSelection->HandleKeyEvent(mPresContext, aEvent))) { return NS_OK; } diff --git a/layout/generic/nsFrame.cpp b/layout/generic/nsFrame.cpp index 7d7972f560b0..97b9acb525f5 100644 --- a/layout/generic/nsFrame.cpp +++ b/layout/generic/nsFrame.cpp @@ -612,12 +612,12 @@ nsFrame::Paint(nsIPresContext* aPresContext, return result; PRInt16 displaySelection = nsISelectionDisplay::DISPLAY_ALL; - if (aFlags != nsISelectionDisplay::DISPLAY_IMAGES) + if (!(aFlags & nsISelectionDisplay::DISPLAY_IMAGES)) { result = shell->GetSelectionFlags(&displaySelection); if (NS_FAILED(result)) return result; - if (!(displaySelection == nsISelectionDisplay::DISPLAY_FRAMES)) + if (!(displaySelection &= nsISelectionDisplay::DISPLAY_FRAMES)) return NS_OK; } diff --git a/layout/html/base/src/nsFrame.cpp b/layout/html/base/src/nsFrame.cpp index 7d7972f560b0..97b9acb525f5 100644 --- a/layout/html/base/src/nsFrame.cpp +++ b/layout/html/base/src/nsFrame.cpp @@ -612,12 +612,12 @@ nsFrame::Paint(nsIPresContext* aPresContext, return result; PRInt16 displaySelection = nsISelectionDisplay::DISPLAY_ALL; - if (aFlags != nsISelectionDisplay::DISPLAY_IMAGES) + if (!(aFlags & nsISelectionDisplay::DISPLAY_IMAGES)) { result = shell->GetSelectionFlags(&displaySelection); if (NS_FAILED(result)) return result; - if (!(displaySelection == nsISelectionDisplay::DISPLAY_FRAMES)) + if (!(displaySelection &= nsISelectionDisplay::DISPLAY_FRAMES)) return NS_OK; } diff --git a/layout/html/base/src/nsPresShell.cpp b/layout/html/base/src/nsPresShell.cpp index 751dcd5389c1..11af06b03ba2 100644 --- a/layout/html/base/src/nsPresShell.cpp +++ b/layout/html/base/src/nsPresShell.cpp @@ -1199,7 +1199,7 @@ protected: nsCOMPtr mSelection; nsCOMPtr mCaret; - PRPackedBool mDisplayNonTextSelection; + PRInt16 mSelectionFlags; PRPackedBool mScrollingEnabled; //used to disable programmable scrolling from outside PRPackedBool mPendingReflowEvent; PRPackedBool mBatchReflows; // When set to true, the pres shell batches reflow commands. @@ -1452,6 +1452,7 @@ PresShell::PresShell(): if (! gLog) gLog = PR_NewLogModule("PresShell"); #endif + mSelectionFlags = nsISelectionDisplay::DISPLAY_TEXT; } NS_IMPL_ADDREF(PresShell) @@ -3059,7 +3060,7 @@ NS_IMETHODIMP PresShell::GetCaretEnabled(PRBool *aOutEnabled) NS_IMETHODIMP PresShell::SetSelectionFlags(PRInt16 aInEnable) { - mDisplayNonTextSelection = aInEnable; + mSelectionFlags = aInEnable; return NS_OK; } @@ -3067,7 +3068,7 @@ NS_IMETHODIMP PresShell::GetSelectionFlags(PRInt16 *aOutEnable) { if (!aOutEnable) return NS_ERROR_INVALID_ARG; - *aOutEnable = mDisplayNonTextSelection; + *aOutEnable = mSelectionFlags; return NS_OK; } @@ -5842,7 +5843,7 @@ PresShell::HandleEvent(nsIView *aView, /* if (mSelection && aEvent->eventStructType == NS_KEY_EVENT) {//KEY HANDLERS WILL GET RID OF THIS - if (mDisplayNonTextSelection && NS_SUCCEEDED(mSelection->HandleKeyEvent(mPresContext, aEvent))) + if (mSelectionFlags && NS_SUCCEEDED(mSelection->HandleKeyEvent(mPresContext, aEvent))) { return NS_OK; }