Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2360)

Unified Diff: printing/print_settings_initializer_win.cc

Issue 8224008: Merge 104615 - Sanity check the printable area returned by windows. (Closed) Base URL: svn://svn.chromium.org/chrome/branches/874/src/
Patch Set: Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « printing/page_setup.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: printing/print_settings_initializer_win.cc
===================================================================
--- printing/print_settings_initializer_win.cc (revision 104741)
+++ printing/print_settings_initializer_win.cc (working copy)
@@ -49,6 +49,14 @@
GetDeviceCaps(hdc, HORZRES),
GetDeviceCaps(hdc, VERTRES));
+ // Sanity check the printable_area: we've seen crashes caused by a printable
+ // area rect of 0, 0, 0, 0, so it seems some drivers don't set it.
+ if (printable_area_device_units.IsEmpty() ||
+ !gfx::Rect(physical_size_device_units).Contains(
+ printable_area_device_units)) {
+ printable_area_device_units = gfx::Rect(physical_size_device_units);
+ }
+
print_settings->SetPrinterPrintableArea(physical_size_device_units,
printable_area_device_units,
dpi);
« no previous file with comments | « printing/page_setup.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698