зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1257825: Remove checks for paper height and width <= 0 in nsPrintSettings. r=dvander
Also added the check for invalid width / height into nsDeviceContextSpecProxy that was added into nsDeviceContextSpecWin.
This commit is contained in:
Родитель
0640767db4
Коммит
1f36475812
|
@ -69,8 +69,8 @@ nsDeviceContextSpecProxy::GetSurfaceForPrinter(gfxASurface** aSurface)
|
|||
|
||||
double width, height;
|
||||
nsresult rv = mPrintSettings->GetEffectivePageSize(&width, &height);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return rv;
|
||||
if (NS_WARN_IF(NS_FAILED(rv)) || width <= 0 || height <= 0) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
// convert twips to points
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
#include "nsReadableUtils.h"
|
||||
#include "nsIPrintSession.h"
|
||||
#include "mozilla/RefPtr.h"
|
||||
#include "mozilla/gfx/Logging.h"
|
||||
|
||||
#define DEFAULT_MARGIN_WIDTH 0.5
|
||||
|
||||
|
@ -812,9 +811,6 @@ NS_IMETHODIMP nsPrintSettings::GetPaperWidth(double *aPaperWidth)
|
|||
NS_IMETHODIMP nsPrintSettings::SetPaperWidth(double aPaperWidth)
|
||||
{
|
||||
mPaperWidth = aPaperWidth;
|
||||
if (mPaperWidth <= 0) {
|
||||
gfxCriticalError(gfxCriticalError::DefaultOptions(false)) << "Setting paper width to bad value " << mPaperWidth;
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -827,9 +823,6 @@ NS_IMETHODIMP nsPrintSettings::GetPaperHeight(double *aPaperHeight)
|
|||
NS_IMETHODIMP nsPrintSettings::SetPaperHeight(double aPaperHeight)
|
||||
{
|
||||
mPaperHeight = aPaperHeight;
|
||||
if (mPaperHeight <= 0) {
|
||||
gfxCriticalError(gfxCriticalError::DefaultOptions(false)) << "Setting paper height to bad value " << mPaperHeight;
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче