Bug 369834: Get rid of SetAltDevice and friends (and fix print preview). r+sr=roc.
git-svn-id: svn://10.0.0.236/trunk@220085 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -794,13 +794,6 @@ DocumentViewerImpl::InitInternal(nsIWidget* aParentWidget,
|
||||
|
||||
mDeviceContext = aDeviceContext;
|
||||
|
||||
#if defined(NS_PRINTING) && defined(NS_PRINT_PREVIEW)
|
||||
// Clear PrintPreview Alternate Device
|
||||
if (mDeviceContext) {
|
||||
mDeviceContext->SetAltDevice(nsnull);
|
||||
}
|
||||
#endif
|
||||
|
||||
PRBool makeCX = PR_FALSE;
|
||||
if (aDoCreation) {
|
||||
if (aParentWidget && !mPresContext) {
|
||||
@@ -857,9 +850,10 @@ DocumentViewerImpl::InitInternal(nsIWidget* aParentWidget,
|
||||
// In fact I'm just adding a line that makes this block
|
||||
// get compiled *less* often.
|
||||
mDeviceContext->GetDeviceContextFor(devspec, *getter_AddRefs(devctx));
|
||||
mDeviceContext->SetAltDevice(devctx);
|
||||
mDeviceContext->SetUseAltDC(kUseAltDCFor_SURFACE_DIM, PR_TRUE);
|
||||
//Get paper dims:
|
||||
// XXX I'm breaking this code; I'm not sure I really want to mess with
|
||||
// the document viewer at the moment to get the right device context
|
||||
// (this won't break anyone, since page layout mode was never really
|
||||
// usable)
|
||||
PRInt32 pageWidth, pageHeight;
|
||||
devctx->GetDeviceSurfaceDimensions(pageWidth, pageHeight);
|
||||
mPresContext->SetPageSize(nsSize(pageWidth, pageHeight));
|
||||
@@ -1980,13 +1974,6 @@ DocumentViewerImpl::Show(void)
|
||||
|
||||
mDeviceContext = mParentWidget->GetDeviceContext();
|
||||
|
||||
#if defined(NS_PRINTING) && defined(NS_PRINT_PREVIEW)
|
||||
// Clear PrintPreview Alternate Device
|
||||
if (mDeviceContext) {
|
||||
mDeviceContext->SetAltDevice(nsnull);
|
||||
}
|
||||
#endif
|
||||
|
||||
// Create presentation context
|
||||
NS_ASSERTION(!mPresContext, "Shouldn't have a prescontext if we have no shell!");
|
||||
mPresContext = new nsPresContext(mDocument, nsPresContext::eContext_Galley);
|
||||
|
||||
Reference in New Issue
Block a user