Back out patch for bug 332640 to fix regression bug 333051. r+sr+a=bzbarsky
git-svn-id: svn://10.0.0.236/branches/MOZILLA_1_8_BRANCH@193902 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -42,11 +42,11 @@
|
||||
#include "nsIScriptGlobalObject.h"
|
||||
#include "nsIDocShell.h"
|
||||
#include "nsIDeviceContext.h"
|
||||
#include "nsPresContext.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsIDocumentViewer.h"
|
||||
#include "nsIDocumentLoader.h"
|
||||
#include "nsDOMClassInfo.h"
|
||||
#include "nsIBaseWindow.h"
|
||||
#include "nsIWidget.h"
|
||||
|
||||
|
||||
//
|
||||
@@ -202,23 +202,21 @@ nsScreen::GetDeviceContext()
|
||||
if(!mDocShell)
|
||||
return nsnull;
|
||||
|
||||
nsCOMPtr<nsIBaseWindow> baseWindow = do_QueryInterface(mDocShell);
|
||||
if (!baseWindow)
|
||||
nsCOMPtr<nsIContentViewer> contentViewer;
|
||||
mDocShell->GetContentViewer(getter_AddRefs(contentViewer));
|
||||
|
||||
nsCOMPtr<nsIDocumentViewer> docViewer(do_QueryInterface(contentViewer));
|
||||
if(!docViewer)
|
||||
return nsnull;
|
||||
|
||||
nsCOMPtr<nsIWidget> widget;
|
||||
baseWindow->GetMainWidget(getter_AddRefs(widget));
|
||||
if (!widget)
|
||||
return nsnull;
|
||||
nsCOMPtr<nsPresContext> presContext;
|
||||
docViewer->GetPresContext(getter_AddRefs(presContext));
|
||||
|
||||
// nsIWidget::GetDeviceContext addrefs, this method doesn't.
|
||||
// Release before returning the pointer.
|
||||
nsIDeviceContext *dc = widget->GetDeviceContext();
|
||||
if (!dc)
|
||||
return nsnull;
|
||||
nsIDeviceContext* context = nsnull;
|
||||
if(presContext)
|
||||
context = presContext->DeviceContext();
|
||||
|
||||
dc->Release();
|
||||
return dc;
|
||||
return context;
|
||||
}
|
||||
|
||||
nsresult
|
||||
|
||||
Reference in New Issue
Block a user