diff options
author | John Abd-El-Malek <jam@chromium.org> | 2015-02-25 11:05:30 -0800 |
---|---|---|
committer | John Abd-El-Malek <jam@chromium.org> | 2015-02-25 11:05:30 -0800 |
commit | 4351ac28111b7c74c397fee606260ced4de228b8 (patch) | |
tree | 2c703251064b772085cc5fbf31f85c7ab3d151e0 /samples | |
parent | f9cfdda45319f7c0d5f6337661562fd3a6dc0f57 (diff) | |
download | pdfium-4351ac28111b7c74c397fee606260ced4de228b8.tar.xz |
Fix compilation error on Windows.
The build fails due to implicit double to integer conversion warning on width *= scale line
and warnings being treated as errors.
TEST= ninja
BUG= none
R=jam@chromium.org
Review URL: https://codereview.chromium.org/935663003
Diffstat (limited to 'samples')
-rw-r--r-- | samples/pdfium_test.cc | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/samples/pdfium_test.cc b/samples/pdfium_test.cc index e3ad47ac15..068dbaa767 100644 --- a/samples/pdfium_test.cc +++ b/samples/pdfium_test.cc @@ -497,14 +497,12 @@ void RenderPdf(const std::string& name, const char* pBuf, size_t len, FORM_OnAfterLoadPage(page, form); FORM_DoPageAAction(page, form, FPDFPAGE_AACTION_OPEN); - int width = static_cast<int>(FPDF_GetPageWidth(page)); - int height = static_cast<int>(FPDF_GetPageHeight(page)); + double scale = 1.0; if (!options.scale_factor_as_string.empty()) { - double scale = 1.0; std::stringstream(options.scale_factor_as_string) >> scale; - width *= scale; - height *= scale; } + int width = static_cast<int>(FPDF_GetPageWidth(page) * scale); + int height = static_cast<int>(FPDF_GetPageHeight(page) * scale); FPDF_BITMAP bitmap = FPDFBitmap_Create(width, height, 0); FPDFBitmap_FillRect(bitmap, 0, 0, width, height, 0xFFFFFFFF); |