diff --git a/layout/base/nsDocumentViewer.cpp b/layout/base/nsDocumentViewer.cpp index afdf214f48bd..69e3a0a43a3f 100644 --- a/layout/base/nsDocumentViewer.cpp +++ b/layout/base/nsDocumentViewer.cpp @@ -309,7 +309,7 @@ class DocumentViewerImpl : public nsIDocumentViewer, friend class nsPrintEngine; public: - DocumentViewerImpl(nsPresContext* aPresContext); + DocumentViewerImpl(); NS_DECL_AND_IMPL_ZEROING_OPERATOR_NEW @@ -324,8 +324,6 @@ public: NS_IMETHOD GetDocument(nsIDocument** aResult); NS_IMETHOD GetPresShell(nsIPresShell** aResult); NS_IMETHOD GetPresContext(nsPresContext** aResult); - NS_IMETHOD CreateDocumentViewerUsing(nsPresContext* aPresContext, - nsIDocumentViewer** aResult); // nsIContentViewerEdit NS_DECL_NSICONTENTVIEWEREDIT @@ -468,7 +466,7 @@ static NS_DEFINE_CID(kWidgetCID, NS_CHILD_CID); nsresult NS_NewDocumentViewer(nsIDocumentViewer** aResult) { - *aResult = new DocumentViewerImpl(nsnull); + *aResult = new DocumentViewerImpl(); if (!*aResult) { return NS_ERROR_OUT_OF_MEMORY; } @@ -508,9 +506,8 @@ void DocumentViewerImpl::PrepareToStartLoad() } // Note: operator new zeros our memory, so no need to init things to null. -DocumentViewerImpl::DocumentViewerImpl(nsPresContext* aPresContext) - : mPresContext(aPresContext), - mTextZoom(1.0), +DocumentViewerImpl::DocumentViewerImpl() + : mTextZoom(1.0), mIsSticky(PR_TRUE), mHintCharsetSource(kCharsetUninitialized) { @@ -2388,41 +2385,6 @@ nsresult DocumentViewerImpl::GetDocumentSelection(nsISelection **aSelection) return NS_ERROR_FAILURE; } -NS_IMETHODIMP -DocumentViewerImpl::CreateDocumentViewerUsing(nsPresContext* aPresContext, - nsIDocumentViewer** aResult) -{ - if (!mDocument) { - // XXX better error - return NS_ERROR_NULL_POINTER; - } - if (!aPresContext) { - return NS_ERROR_NULL_POINTER; - } - - // Create new viewer - DocumentViewerImpl* viewer = new DocumentViewerImpl(aPresContext); - if (!viewer) { - return NS_ERROR_OUT_OF_MEMORY; - } - NS_ADDREF(viewer); - - // XXX make sure the ua style sheet is used (for now; need to be - // able to specify an alternate) - viewer->SetUAStyleSheet(mUAStyleSheet); - - // Bind the new viewer to the old document - nsresult rv = viewer->LoadStart(mDocument); - - *aResult = viewer; - - return rv; -} - -#ifdef XP_MAC -#pragma mark - -#endif - /* ======================================================================================== * nsIContentViewerEdit * ======================================================================================== */ diff --git a/layout/base/nsIDocumentViewer.h b/layout/base/nsIDocumentViewer.h index a6080b37f551..7603d9c04211 100644 --- a/layout/base/nsIDocumentViewer.h +++ b/layout/base/nsIDocumentViewer.h @@ -66,9 +66,6 @@ public: NS_IMETHOD GetPresShell(nsIPresShell** aResult) = 0; NS_IMETHOD GetPresContext(nsPresContext** aResult) = 0; - - NS_IMETHOD CreateDocumentViewerUsing(nsPresContext* aPresContext, - nsIDocumentViewer** aResult) = 0; }; NS_DEFINE_STATIC_IID_ACCESSOR(nsIDocumentViewer, NS_IDOCUMENT_VIEWER_IID)