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

Unified Diff: printing/print_settings.cc

Issue 8328001: For no margins, or printable area margins, don't factor in the header/footer size. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address comment 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.cc
diff --git a/printing/print_settings.cc b/printing/print_settings.cc
index 0e1a74304a965d5a9c7501eee06d0290c3b0c602..d5a0a78a80badc59118390f5a9d413dcdb2d1fc0 100644
--- a/printing/print_settings.cc
+++ b/printing/print_settings.cc
@@ -158,13 +158,13 @@ void PrintSettings::SetPrinterPrintableArea(
header_footer_text_height);
PageMargins margins;
- margins.header = header_footer_text_height;
- margins.footer = header_footer_text_height;
switch (margin_type) {
case DEFAULT_MARGINS: {
// Default margins 1.0cm = ~2/5 of an inch.
int margin_printer_units = ConvertUnit(1000, kHundrethsMMPerInch,
units_per_inch);
+ margins.header = header_footer_text_height;
+ margins.footer = header_footer_text_height;
margins.top = margin_printer_units;
margins.bottom = margin_printer_units;
margins.left = margin_printer_units;
@@ -173,6 +173,8 @@ void PrintSettings::SetPrinterPrintableArea(
}
case NO_MARGINS:
case PRINTABLE_AREA_MARGINS: {
+ margins.header = 0;
+ margins.footer = 0;
margins.top = 0;
margins.bottom = 0;
margins.left = 0;
@@ -180,6 +182,8 @@ void PrintSettings::SetPrinterPrintableArea(
break;
}
case CUSTOM_MARGINS: {
+ margins.header = 0;
+ margins.footer = 0;
margins.top = ConvertUnitDouble(custom_margins_in_points_.top,
printing::kPointsPerInch,
units_per_inch);
« 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