Bug 1353625 - detect zero (0) as invalid resolution. r=bobowen a=tomcat
authorJorg K <jorgk@jorgk.com>
Tue, 30 May 2017 23:44:00 +0200
changeset 361409 06d83f260f410f125847e95618b6f8b9e83e9a2f
parent 361408 925230851743b9a969a3142f00aea5014a33cb02
child 361457 23243677c7dd56781ccccb70b748cec412780516
push id31929
push usercbook@mozilla.com
push dateWed, 31 May 2017 09:21:30 +0000
treeherdermozilla-central@06d83f260f41 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbobowen, tomcat
bugs1353625
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1353625 - detect zero (0) as invalid resolution. r=bobowen a=tomcat
widget/nsPrintOptionsImpl.cpp
--- a/widget/nsPrintOptionsImpl.cpp
+++ b/widget/nsPrintOptionsImpl.cpp
@@ -507,17 +507,17 @@ nsPrintOptions::ReadPrefs(nsIPrintSettin
       // ones for letter. See bug 1276717.
       if (sizeUnit == nsIPrintSettings::kPaperSizeMillimeters &&
           height == 11L && width == 8.5L) {
 
         // As an extra precaution only override, when the resolution is also
         // set to the legacy invalid, uninitialized value. We'll just broadly
         // assume that anything outside of a million DPI is invalid.
         if (GETINTPREF(kPrintResolution, &iVal) &&
-            (iVal < 0 || iVal > 1000000)) {
+            (iVal <= 0 || iVal > 1000000)) {
           height = -1L;
           width = -1L;
         }
       }
 #endif
     }
 
     if (success) {