From e876217e24209fd2ded0ecb3043a149f1412cfdd Mon Sep 17 00:00:00 2001 From: Alex Maitland Date: Tue, 21 Apr 2020 18:44:52 +0000 Subject: [PATCH] Change cef_pdf_print_settings_t custom margins from double to int (fixes issue #2694) --- include/internal/cef_types.h | 10 +++++----- libcef/browser/printing/print_view_manager.cc | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/include/internal/cef_types.h b/include/internal/cef_types.h index dded757bc..15dcd39c5 100644 --- a/include/internal/cef_types.h +++ b/include/internal/cef_types.h @@ -2430,13 +2430,13 @@ typedef struct _cef_pdf_print_settings_t { 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. /// - double margin_top; - double margin_right; - double margin_bottom; - double margin_left; + int margin_top; + int margin_right; + int margin_bottom; + int margin_left; /// // Margin type. diff --git a/libcef/browser/printing/print_view_manager.cc b/libcef/browser/printing/print_view_manager.cc index a3da3fc03..396d1b49d 100644 --- a/libcef/browser/printing/print_view_manager.cc +++ b/libcef/browser/printing/print_view_manager.cc @@ -116,10 +116,10 @@ void FillInDictionaryFromPdfPrintSettings( print_settings.SetInteger(kSettingMarginsType, margin_type); if (margin_type == CUSTOM_MARGINS) { std::unique_ptr dict(new base::DictionaryValue); - dict->SetDouble(kSettingMarginTop, pdf_settings.margin_top); - dict->SetDouble(kSettingMarginRight, pdf_settings.margin_right); - dict->SetDouble(kSettingMarginBottom, pdf_settings.margin_bottom); - dict->SetDouble(kSettingMarginLeft, pdf_settings.margin_left); + dict->SetInteger(kSettingMarginTop, pdf_settings.margin_top); + dict->SetInteger(kSettingMarginRight, pdf_settings.margin_right); + dict->SetInteger(kSettingMarginBottom, pdf_settings.margin_bottom); + dict->SetInteger(kSettingMarginLeft, pdf_settings.margin_left); print_settings.Set(kSettingMarginsCustom, std::move(dict)); }