mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-09 08:48:07 +00:00
Bug 371332: Remove nsIDocumentViewer::CreateDocumentViewer. r+sr=roc
This commit is contained in:
parent
af043fbb9a
commit
ff35b63e67
@ -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
|
||||
* ======================================================================================== */
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user