The search for the selected frames was not looking in all the child lisst for each frame

Bug 181228 r=dcone sr=jst
This commit is contained in:
rods%netscape.com 2002-11-22 13:02:05 +00:00
Родитель 31f6fe5b14
Коммит 63bf52851b
4 изменённых файлов: 114 добавлений и 20 удалений

Просмотреть файл

@ -3772,8 +3772,10 @@ nsPrintEngine::FindFrameByType(nsIPresContext* aPresContext,
/** ---------------------------------------------------
* Find by checking frames type
*/
static nsresult FindSelectionBounds(nsIPresContext* aPresContext,
nsresult
nsPrintEngine::FindSelectionBoundsWithList(nsIPresContext* aPresContext,
nsIRenderingContext& aRC,
nsIAtom* aList,
nsIFrame * aParentFrame,
nsRect& aRect,
nsIFrame *& aStartFrame,
@ -3785,7 +3787,7 @@ static nsresult FindSelectionBounds(nsIPresContext* aPresContext,
NS_ASSERTION(aParentFrame, "Pointer is null!");
nsIFrame * child;
aParentFrame->FirstChild(aPresContext, nsnull, &child);
aParentFrame->FirstChild(aPresContext, aList, &child);
nsRect rect;
aParentFrame->GetRect(rect);
aRect.x += rect.x;
@ -3822,6 +3824,33 @@ static nsresult FindSelectionBounds(nsIPresContext* aPresContext,
return NS_OK;
}
//-------------------------------------------------------
// Find the Frame that is XMost
nsresult
nsPrintEngine::FindSelectionBounds(nsIPresContext* aPresContext,
nsIRenderingContext& aRC,
nsIFrame * aParentFrame,
nsRect& aRect,
nsIFrame *& aStartFrame,
nsRect& aStartRect,
nsIFrame *& aEndFrame,
nsRect& aEndRect)
{
NS_ASSERTION(aPresContext, "Pointer is null!");
NS_ASSERTION(aParentFrame, "Pointer is null!");
// loop thru named child lists
nsIAtom* childListName = nsnull;
PRInt32 childListIndex = 0;
do {
nsresult rv = FindSelectionBoundsWithList(aPresContext, aRC, childListName, aParentFrame, aRect, aStartFrame, aStartRect, aEndFrame, aEndRect);
NS_IF_RELEASE(childListName);
NS_ENSURE_SUCCESS(rv, rv);
aParentFrame->GetAdditionalChildListName(childListIndex++, &childListName);
} while (childListName);
return NS_OK;
}
/** ---------------------------------------------------
* This method finds the starting and ending page numbers
* of the selection and also returns rect for each where

Просмотреть файл

@ -291,6 +291,25 @@ protected:
nsIFrame*& aSeqFrame,
PRInt32& aCount);
static nsresult FindSelectionBoundsWithList(nsIPresContext* aPresContext,
nsIRenderingContext& aRC,
nsIAtom* aList,
nsIFrame * aParentFrame,
nsRect& aRect,
nsIFrame *& aStartFrame,
nsRect& aStartRect,
nsIFrame *& aEndFrame,
nsRect& aEndRect);
static nsresult FindSelectionBounds(nsIPresContext* aPresContext,
nsIRenderingContext& aRC,
nsIFrame * aParentFrame,
nsRect& aRect,
nsIFrame *& aStartFrame,
nsRect& aStartRect,
nsIFrame *& aEndFrame,
nsRect& aEndRect);
static nsresult GetPageRangeForSelection(nsIPresShell * aPresShell,
nsIPresContext* aPresContext,
nsIRenderingContext& aRC,
@ -354,4 +373,3 @@ private:
#endif
#endif /* nsPrintEngine_h___ */

Просмотреть файл

@ -3772,8 +3772,10 @@ nsPrintEngine::FindFrameByType(nsIPresContext* aPresContext,
/** ---------------------------------------------------
* Find by checking frames type
*/
static nsresult FindSelectionBounds(nsIPresContext* aPresContext,
nsresult
nsPrintEngine::FindSelectionBoundsWithList(nsIPresContext* aPresContext,
nsIRenderingContext& aRC,
nsIAtom* aList,
nsIFrame * aParentFrame,
nsRect& aRect,
nsIFrame *& aStartFrame,
@ -3785,7 +3787,7 @@ static nsresult FindSelectionBounds(nsIPresContext* aPresContext,
NS_ASSERTION(aParentFrame, "Pointer is null!");
nsIFrame * child;
aParentFrame->FirstChild(aPresContext, nsnull, &child);
aParentFrame->FirstChild(aPresContext, aList, &child);
nsRect rect;
aParentFrame->GetRect(rect);
aRect.x += rect.x;
@ -3822,6 +3824,33 @@ static nsresult FindSelectionBounds(nsIPresContext* aPresContext,
return NS_OK;
}
//-------------------------------------------------------
// Find the Frame that is XMost
nsresult
nsPrintEngine::FindSelectionBounds(nsIPresContext* aPresContext,
nsIRenderingContext& aRC,
nsIFrame * aParentFrame,
nsRect& aRect,
nsIFrame *& aStartFrame,
nsRect& aStartRect,
nsIFrame *& aEndFrame,
nsRect& aEndRect)
{
NS_ASSERTION(aPresContext, "Pointer is null!");
NS_ASSERTION(aParentFrame, "Pointer is null!");
// loop thru named child lists
nsIAtom* childListName = nsnull;
PRInt32 childListIndex = 0;
do {
nsresult rv = FindSelectionBoundsWithList(aPresContext, aRC, childListName, aParentFrame, aRect, aStartFrame, aStartRect, aEndFrame, aEndRect);
NS_IF_RELEASE(childListName);
NS_ENSURE_SUCCESS(rv, rv);
aParentFrame->GetAdditionalChildListName(childListIndex++, &childListName);
} while (childListName);
return NS_OK;
}
/** ---------------------------------------------------
* This method finds the starting and ending page numbers
* of the selection and also returns rect for each where

Просмотреть файл

@ -291,6 +291,25 @@ protected:
nsIFrame*& aSeqFrame,
PRInt32& aCount);
static nsresult FindSelectionBoundsWithList(nsIPresContext* aPresContext,
nsIRenderingContext& aRC,
nsIAtom* aList,
nsIFrame * aParentFrame,
nsRect& aRect,
nsIFrame *& aStartFrame,
nsRect& aStartRect,
nsIFrame *& aEndFrame,
nsRect& aEndRect);
static nsresult FindSelectionBounds(nsIPresContext* aPresContext,
nsIRenderingContext& aRC,
nsIFrame * aParentFrame,
nsRect& aRect,
nsIFrame *& aStartFrame,
nsRect& aStartRect,
nsIFrame *& aEndFrame,
nsRect& aEndRect);
static nsresult GetPageRangeForSelection(nsIPresShell * aPresShell,
nsIPresContext* aPresContext,
nsIRenderingContext& aRC,
@ -354,4 +373,3 @@ private:
#endif
#endif /* nsPrintEngine_h___ */