зеркало из https://github.com/mozilla/pjs.git
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:
Родитель
31f6fe5b14
Коммит
63bf52851b
|
@ -3772,20 +3772,22 @@ nsPrintEngine::FindFrameByType(nsIPresContext* aPresContext,
|
|||
/** ---------------------------------------------------
|
||||
* Find by checking frames type
|
||||
*/
|
||||
static nsresult FindSelectionBounds(nsIPresContext* aPresContext,
|
||||
nsIRenderingContext& aRC,
|
||||
nsIFrame * aParentFrame,
|
||||
nsRect& aRect,
|
||||
nsIFrame *& aStartFrame,
|
||||
nsRect& aStartRect,
|
||||
nsIFrame *& aEndFrame,
|
||||
nsRect& aEndRect)
|
||||
nsresult
|
||||
nsPrintEngine::FindSelectionBoundsWithList(nsIPresContext* aPresContext,
|
||||
nsIRenderingContext& aRC,
|
||||
nsIAtom* aList,
|
||||
nsIFrame * aParentFrame,
|
||||
nsRect& aRect,
|
||||
nsIFrame *& aStartFrame,
|
||||
nsRect& aStartRect,
|
||||
nsIFrame *& aEndFrame,
|
||||
nsRect& aEndRect)
|
||||
{
|
||||
NS_ASSERTION(aPresContext, "Pointer is null!");
|
||||
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,20 +3772,22 @@ nsPrintEngine::FindFrameByType(nsIPresContext* aPresContext,
|
|||
/** ---------------------------------------------------
|
||||
* Find by checking frames type
|
||||
*/
|
||||
static nsresult FindSelectionBounds(nsIPresContext* aPresContext,
|
||||
nsIRenderingContext& aRC,
|
||||
nsIFrame * aParentFrame,
|
||||
nsRect& aRect,
|
||||
nsIFrame *& aStartFrame,
|
||||
nsRect& aStartRect,
|
||||
nsIFrame *& aEndFrame,
|
||||
nsRect& aEndRect)
|
||||
nsresult
|
||||
nsPrintEngine::FindSelectionBoundsWithList(nsIPresContext* aPresContext,
|
||||
nsIRenderingContext& aRC,
|
||||
nsIAtom* aList,
|
||||
nsIFrame * aParentFrame,
|
||||
nsRect& aRect,
|
||||
nsIFrame *& aStartFrame,
|
||||
nsRect& aStartRect,
|
||||
nsIFrame *& aEndFrame,
|
||||
nsRect& aEndRect)
|
||||
{
|
||||
NS_ASSERTION(aPresContext, "Pointer is null!");
|
||||
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___ */
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче