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

git-svn-id: svn://10.0.0.236/trunk@81476 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
dcone%netscape.com
2000-10-19 21:49:12 +00:00
parent 582ae0f42e
commit 72d034b146
3 changed files with 60 additions and 0 deletions

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;