Change cef_pdf_print_settings_t custom margins from double to int (fixes issue #2694)

This commit is contained in:
Alex Maitland 2020-04-21 18:44:52 +00:00 committed by Marshall Greenblatt
parent ec0c57d0e1
commit e876217e24
2 changed files with 9 additions and 9 deletions

View File

@ -2430,13 +2430,13 @@ typedef struct _cef_pdf_print_settings_t {
int scale_factor; int scale_factor;
/// ///
// Margins in millimeters. Only used if |margin_type| is set to // Margins in points. Only used if |margin_type| is set to
// PDF_PRINT_MARGIN_CUSTOM. // PDF_PRINT_MARGIN_CUSTOM.
/// ///
double margin_top; int margin_top;
double margin_right; int margin_right;
double margin_bottom; int margin_bottom;
double margin_left; int margin_left;
/// ///
// Margin type. // Margin type.

View File

@ -116,10 +116,10 @@ void FillInDictionaryFromPdfPrintSettings(
print_settings.SetInteger(kSettingMarginsType, margin_type); print_settings.SetInteger(kSettingMarginsType, margin_type);
if (margin_type == CUSTOM_MARGINS) { if (margin_type == CUSTOM_MARGINS) {
std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue); std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue);
dict->SetDouble(kSettingMarginTop, pdf_settings.margin_top); dict->SetInteger(kSettingMarginTop, pdf_settings.margin_top);
dict->SetDouble(kSettingMarginRight, pdf_settings.margin_right); dict->SetInteger(kSettingMarginRight, pdf_settings.margin_right);
dict->SetDouble(kSettingMarginBottom, pdf_settings.margin_bottom); dict->SetInteger(kSettingMarginBottom, pdf_settings.margin_bottom);
dict->SetDouble(kSettingMarginLeft, pdf_settings.margin_left); dict->SetInteger(kSettingMarginLeft, pdf_settings.margin_left);
print_settings.Set(kSettingMarginsCustom, std::move(dict)); print_settings.Set(kSettingMarginsCustom, std::move(dict));
} }