From b476111e672766250fa211598df1305ff35dc20e Mon Sep 17 00:00:00 2001 From: "mjudge%netscape.com" Date: Fri, 5 Nov 1999 22:09:16 +0000 Subject: [PATCH] fix review by sfrasier, approved choffman. simple fix to get first letter style frames/paragraphs to show their selection. simply notifies children that the selection bit should be "on" git-svn-id: svn://10.0.0.236/trunk@52870 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/generic/nsFirstLetterFrame.cpp | 18 ++++++++++++++++++ .../html/base/src/nsFirstLetterFrame.cpp | 18 ++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/mozilla/layout/generic/nsFirstLetterFrame.cpp b/mozilla/layout/generic/nsFirstLetterFrame.cpp index de17a908382..ae5c81afa91 100644 --- a/mozilla/layout/generic/nsFirstLetterFrame.cpp +++ b/mozilla/layout/generic/nsFirstLetterFrame.cpp @@ -49,6 +49,9 @@ public: nsHTMLReflowMetrics& aDesiredSize, const nsHTMLReflowState& aReflowState, nsReflowStatus& aStatus); + + NS_IMETHOD SetSelected(nsIPresContext* aPresContext, nsIDOMRange *aRange,PRBool aSelected, nsSpread aSpread); + NS_IMETHOD FindTextRuns(nsLineLayout& aLineLayout); protected: @@ -152,6 +155,21 @@ nsFirstLetterFrame::SetInitialChildList(nsIPresContext& aPresContext, return NS_OK; } +NS_IMETHODIMP +nsFirstLetterFrame::SetSelected(nsIPresContext* aPresContext, nsIDOMRange *aRange,PRBool aSelected, nsSpread aSpread) +{ + if (aSelected && ParentDisablesSelection()) + return NS_OK; + nsIFrame *child; + nsresult result = FirstChild(nsnull, &child); + while (NS_SUCCEEDED(result) && child) + { + child->SetSelected(aPresContext,aRange, aSelected,aSpread);//dont worry about result. there are more frames to come + result = child->GetNextSibling(&child); + } + return NS_OK; +} + NS_IMETHODIMP nsFirstLetterFrame::FindTextRuns(nsLineLayout& aLineLayout) { diff --git a/mozilla/layout/html/base/src/nsFirstLetterFrame.cpp b/mozilla/layout/html/base/src/nsFirstLetterFrame.cpp index de17a908382..ae5c81afa91 100644 --- a/mozilla/layout/html/base/src/nsFirstLetterFrame.cpp +++ b/mozilla/layout/html/base/src/nsFirstLetterFrame.cpp @@ -49,6 +49,9 @@ public: nsHTMLReflowMetrics& aDesiredSize, const nsHTMLReflowState& aReflowState, nsReflowStatus& aStatus); + + NS_IMETHOD SetSelected(nsIPresContext* aPresContext, nsIDOMRange *aRange,PRBool aSelected, nsSpread aSpread); + NS_IMETHOD FindTextRuns(nsLineLayout& aLineLayout); protected: @@ -152,6 +155,21 @@ nsFirstLetterFrame::SetInitialChildList(nsIPresContext& aPresContext, return NS_OK; } +NS_IMETHODIMP +nsFirstLetterFrame::SetSelected(nsIPresContext* aPresContext, nsIDOMRange *aRange,PRBool aSelected, nsSpread aSpread) +{ + if (aSelected && ParentDisablesSelection()) + return NS_OK; + nsIFrame *child; + nsresult result = FirstChild(nsnull, &child); + while (NS_SUCCEEDED(result) && child) + { + child->SetSelected(aPresContext,aRange, aSelected,aSpread);//dont worry about result. there are more frames to come + result = child->GetNextSibling(&child); + } + return NS_OK; +} + NS_IMETHODIMP nsFirstLetterFrame::FindTextRuns(nsLineLayout& aLineLayout) {