From eefec1d22c17f2e16d17a862990c762e44841d5c Mon Sep 17 00:00:00 2001 From: "rods%netscape.com" Date: Tue, 7 Feb 2006 01:13:06 +0000 Subject: [PATCH] pass back the proper errors codes, instead of just a null devspec Bug 101514 r=karnazr sr=kin --- widget/src/windows/nsDeviceContextSpecFactoryW.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/widget/src/windows/nsDeviceContextSpecFactoryW.cpp b/widget/src/windows/nsDeviceContextSpecFactoryW.cpp index 15280ced8c8..570f42b4118 100644 --- a/widget/src/windows/nsDeviceContextSpecFactoryW.cpp +++ b/widget/src/windows/nsDeviceContextSpecFactoryW.cpp @@ -573,6 +573,8 @@ NS_IMETHODIMP nsDeviceContextSpecFactoryWin :: CreateDeviceContextSpec(nsIWidget prntdlg.Flags = PD_ALLPAGES | PD_RETURNDEFAULT | PD_RETURNIC | PD_USEDEVMODECOPIESANDCOLLATE; } + rv = NS_ERROR_FAILURE; // reset + BOOL result = ::PrintDlg(&prntdlg); if (TRUE == result){ @@ -670,6 +672,9 @@ NS_IMETHODIMP nsDeviceContextSpecFactoryWin :: CreateDeviceContextSpec(nsIWidget ::GlobalUnlock(prntdlg.hDevNames); ::GlobalFree(prntdlg.hDevNames); } + } else { + // print dialog aborted + rv = NS_ERROR_ABORT; } return rv;