| Index: printing/printing_context.cc
|
| ===================================================================
|
| --- printing/printing_context.cc (revision 110039)
|
| +++ printing/printing_context.cc (working copy)
|
| @@ -7,7 +7,6 @@
|
| #include "base/logging.h"
|
| #include "base/values.h"
|
| #include "printing/page_setup.h"
|
| -#include "printing/page_size_margins.h"
|
| #include "printing/print_settings_initializer.h"
|
|
|
| namespace printing {
|
| @@ -63,15 +62,27 @@
|
| settings_.margin_type = static_cast<MarginType>(margin_type);
|
|
|
| if (margin_type == CUSTOM_MARGINS) {
|
| - printing::PageSizeMargins page_size_margins;
|
| - getCustomMarginsFromJobSettings(job_settings, &page_size_margins);
|
| -
|
| + double top_margin_in_points = 0;
|
| + double bottom_margin_in_points = 0;
|
| + double left_margin_in_points = 0;
|
| + double right_margin_in_points = 0;
|
| + DictionaryValue* custom_margins;
|
| + if (!job_settings.GetDictionary(kSettingMarginsCustom, &custom_margins) ||
|
| + !custom_margins->GetDouble(kSettingMarginTop, &top_margin_in_points) ||
|
| + !custom_margins->GetDouble(kSettingMarginBottom,
|
| + &bottom_margin_in_points) ||
|
| + !custom_margins->GetDouble(kSettingMarginLeft,
|
| + &left_margin_in_points) ||
|
| + !custom_margins->GetDouble(kSettingMarginRight,
|
| + &right_margin_in_points)) {
|
| + NOTREACHED();
|
| + }
|
| PageMargins margins_in_points;
|
| margins_in_points.Clear();
|
| - margins_in_points.top = page_size_margins.margin_top;
|
| - margins_in_points.bottom = page_size_margins.margin_bottom;
|
| - margins_in_points.left = page_size_margins.margin_left;
|
| - margins_in_points.right = page_size_margins.margin_right;
|
| + margins_in_points.top = top_margin_in_points;
|
| + margins_in_points.bottom = bottom_margin_in_points;
|
| + margins_in_points.left = left_margin_in_points;
|
| + margins_in_points.right = right_margin_in_points;
|
|
|
| settings_.SetCustomMargins(margins_in_points);
|
| }
|
|
|