Have fix for bug 24406. r=kmmclusk sr=buster

This commit is contained in:
dcone%netscape.com 2000-10-19 21:49:12 +00:00
Родитель dd4f96c8d0
Коммит dd11969fb9
3 изменённых файлов: 60 добавлений и 0 удалений

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

@ -51,6 +51,7 @@
#include "nsIDOMHTMLElement.h"
#include "nsIDOMRange.h"
#include "nsLayoutCID.h"
#include "nsHTMLParts.h"
#include "nsViewsCID.h"
#include "nsWidgetsCID.h"
@ -74,6 +75,7 @@
#include "nsIDocShellTreeOwner.h"
#include "nsIDocShell.h"
#include "nsIFrameDebug.h"
#include "nsILayoutHistoryState.h"
#include "nsLayoutAtoms.h"
#include "nsIDOMHTMLFrameSetElement.h"
#include "nsIFrameManager.h"
@ -1003,9 +1005,27 @@ DocumentViewerImpl::PrintContent(nsIWebShell * aParent,
cx->SetCompatibilityMode(mode);
cx->SetContainer(aParent);
// get the old history
nsCOMPtr<nsIPresShell> presShell;
nsCOMPtr<nsILayoutHistoryState> layoutState;
NS_ENSURE_SUCCESS(GetPresShell(*(getter_AddRefs(presShell))), NS_ERROR_FAILURE);
presShell->CaptureHistoryState(getter_AddRefs(layoutState),PR_TRUE);
ps->BeginObservingDocument();
//lay it out...
ps->InitialReflow(width, height);
// update the history from the old presentation shell
nsCOMPtr<nsIFrameManager> fm;
rv = ps->GetFrameManager(getter_AddRefs(fm));
if(NS_SUCCEEDED(rv) && fm) {
nsIFrame* root;
ps->GetRootFrame(&root);
fm->RestoreFrameState(cx, root, layoutState);
}
ps->EndObservingDocument();
// Ask the page sequence frame to print all the pages
nsIPageSequenceFrame* pageSequence;
nsPrintOptions options;

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

@ -51,6 +51,7 @@
#include "nsIDOMHTMLElement.h"
#include "nsIDOMRange.h"
#include "nsLayoutCID.h"
#include "nsHTMLParts.h"
#include "nsViewsCID.h"
#include "nsWidgetsCID.h"
@ -74,6 +75,7 @@
#include "nsIDocShellTreeOwner.h"
#include "nsIDocShell.h"
#include "nsIFrameDebug.h"
#include "nsILayoutHistoryState.h"
#include "nsLayoutAtoms.h"
#include "nsIDOMHTMLFrameSetElement.h"
#include "nsIFrameManager.h"
@ -1003,9 +1005,27 @@ DocumentViewerImpl::PrintContent(nsIWebShell * aParent,
cx->SetCompatibilityMode(mode);
cx->SetContainer(aParent);
// get the old history
nsCOMPtr<nsIPresShell> presShell;
nsCOMPtr<nsILayoutHistoryState> layoutState;
NS_ENSURE_SUCCESS(GetPresShell(*(getter_AddRefs(presShell))), NS_ERROR_FAILURE);
presShell->CaptureHistoryState(getter_AddRefs(layoutState),PR_TRUE);
ps->BeginObservingDocument();
//lay it out...
ps->InitialReflow(width, height);
// update the history from the old presentation shell
nsCOMPtr<nsIFrameManager> fm;
rv = ps->GetFrameManager(getter_AddRefs(fm));
if(NS_SUCCEEDED(rv) && fm) {
nsIFrame* root;
ps->GetRootFrame(&root);
fm->RestoreFrameState(cx, root, layoutState);
}
ps->EndObservingDocument();
// Ask the page sequence frame to print all the pages
nsIPageSequenceFrame* pageSequence;
nsPrintOptions options;

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

@ -51,6 +51,7 @@
#include "nsIDOMHTMLElement.h"
#include "nsIDOMRange.h"
#include "nsLayoutCID.h"
#include "nsHTMLParts.h"
#include "nsViewsCID.h"
#include "nsWidgetsCID.h"
@ -74,6 +75,7 @@
#include "nsIDocShellTreeOwner.h"
#include "nsIDocShell.h"
#include "nsIFrameDebug.h"
#include "nsILayoutHistoryState.h"
#include "nsLayoutAtoms.h"
#include "nsIDOMHTMLFrameSetElement.h"
#include "nsIFrameManager.h"
@ -1003,9 +1005,27 @@ DocumentViewerImpl::PrintContent(nsIWebShell * aParent,
cx->SetCompatibilityMode(mode);
cx->SetContainer(aParent);
// get the old history
nsCOMPtr<nsIPresShell> presShell;
nsCOMPtr<nsILayoutHistoryState> layoutState;
NS_ENSURE_SUCCESS(GetPresShell(*(getter_AddRefs(presShell))), NS_ERROR_FAILURE);
presShell->CaptureHistoryState(getter_AddRefs(layoutState),PR_TRUE);
ps->BeginObservingDocument();
//lay it out...
ps->InitialReflow(width, height);
// update the history from the old presentation shell
nsCOMPtr<nsIFrameManager> fm;
rv = ps->GetFrameManager(getter_AddRefs(fm));
if(NS_SUCCEEDED(rv) && fm) {
nsIFrame* root;
ps->GetRootFrame(&root);
fm->RestoreFrameState(cx, root, layoutState);
}
ps->EndObservingDocument();
// Ask the page sequence frame to print all the pages
nsIPageSequenceFrame* pageSequence;
nsPrintOptions options;