Bug 297669. Don't specially avoid reflowing/printing zero-size subdocuments when printing. Fixes a hang. r+sr=me,a=chofmann,patch by Martijn Wargers

This commit is contained in:
roc+%cs.cmu.edu 2005-06-24 02:10:58 +00:00
Родитель bd92a072a7
Коммит b943b4e17b
2 изменённых файлов: 0 добавлений и 21 удалений

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

@ -669,8 +669,6 @@ nsPrintEngine::Print(nsIPrintSettings* aPrintSettings,
// is a child of this docshell
mPrt->mIsIFrameSelected = IsThereAnIFrameSelected(webContainer, mPrt->mCurrentFocusWin, mPrt->mIsParentAFrameSet);
CheckForHiddenFrameSetFrames();
DUMP_DOC_LIST("\nAfter Mapping------------------------------------------");
rv = NS_ERROR_FAILURE;
@ -1133,7 +1131,6 @@ nsPrintEngine::PrintPreview(nsIPrintSettings* aPrintSettings,
// is a child of this docshell
mPrt->mIsIFrameSelected = IsThereAnIFrameSelected(webContainer, mPrt->mCurrentFocusWin, mPrt->mIsParentAFrameSet);
CheckForHiddenFrameSetFrames();
DUMP_DOC_LIST("\nAfter Mapping------------------------------------------");
@ -2034,23 +2031,6 @@ nsPrintEngine::IsThereAnIFrameSelected(nsIDocShell* aDocShell,
return iFrameIsSelected;
}
/** ---------------------------------------------------
* Check to see if the FrameSet Frame is Hidden
* if it is then don't let it be reflowed, printed, or shown
*/
void nsPrintEngine::CheckForHiddenFrameSetFrames()
{
for (PRInt32 i=0;i<mPrt->mPrintDocList->Count();i++) {
nsPrintObject* po = (nsPrintObject*)mPrt->mPrintDocList->ElementAt(i);
NS_ASSERTION(po, "nsPrintObject can't be null!");
nsIFrame* frame = po->mDisplayPresShell->FrameManager()->GetRootFrame();
if (frame && frame->GetSize().height == 0) {
// set this PO and its children to not print and be hidden
SetPrintPO(po, PR_FALSE, PR_TRUE, eSetPrintFlag | eSetHiddenFlag);
}
}
}
//---------------------------------------------------------------------
// Recursively sets all the PO items to be printed
// from the given item down into the tree

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

@ -201,7 +201,6 @@ public:
nsresult CheckForPrinters(nsIPrintOptions* aPrintOptions,
nsIPrintSettings* aPrintSettings);
void CleanupDocTitleArray(PRUnichar**& aArray, PRInt32& aCount);
void CheckForHiddenFrameSetFrames();
PRBool IsThereARangeSelection(nsIDOMWindow * aDOMWin);