summaryrefslogtreecommitdiff
path: root/fpdfsdk/src
diff options
context:
space:
mode:
authorBruce Dawson <brucedawson@google.com>2015-01-08 11:47:49 -0800
committerBruce Dawson <brucedawson@google.com>2015-01-08 11:47:49 -0800
commit3f49aa3ba3e8ba2fcedc8e2e2a88f3b06efd52b9 (patch)
tree02773586b1bb5372282bc0c30e31e7aedbb4f9a5 /fpdfsdk/src
parent5d3a4c83fc0a41b6b04d8f7022a9db3bc04ba73e (diff)
downloadpdfium-3f49aa3ba3e8ba2fcedc8e2e2a88f3b06efd52b9.tar.xz
XFA: merge patch from CL 792953005, fix most warnings
Includes fixes to XFA specific warnings -- benign truncations. Bug https://code.google.com/p/pdfium/issues/detail?id=104 was filed to track changing types to avoid some truncations. Resolve all but two VC++ build warnings in pdfium. pdfium builds on Win32 have about 85 warnings (250 in the XFA branch, totaling over 480 lines!), mostly from four lines in a header file and a warning that should be disabled. This change resolves all but two of them and turns on warning-as-errors. Bugs have been filed for the two remaining warnings: https://code.google.com/p/pdfium/issues/detail?id=100 the 64-bit warnings: https://code.google.com/p/pdfium/issues/detail?id=101 and the Linux warnings: https://code.google.com/p/pdfium/issues/detail?id=102 The fix to the double->float truncation bugs will also improve code-generation. R=bo_xu@foxitsoftware.com, tsepez@chromium.org Review URL: https://codereview.chromium.org/792953005 BUG= https://code.google.com/p/pdfium/issues/detail?id=100 Review URL: https://codereview.chromium.org/834413002
Diffstat (limited to 'fpdfsdk/src')
-rw-r--r--fpdfsdk/src/fpdfformfill.cpp3
-rw-r--r--fpdfsdk/src/fsdk_mgr.cpp5
2 files changed, 6 insertions, 2 deletions
diff --git a/fpdfsdk/src/fpdfformfill.cpp b/fpdfsdk/src/fpdfformfill.cpp
index 0fb32919e1..ea94925d63 100644
--- a/fpdfsdk/src/fpdfformfill.cpp
+++ b/fpdfsdk/src/fpdfformfill.cpp
@@ -71,7 +71,8 @@ DLLEXPORT int STDCALL FPDPage_HasFormFieldAtPoint(FPDF_FORMHANDLE hHandle, FPDF_
rcWidget.bottom -= 1.0f;
rcWidget.top += 1.0f;
- if (rcWidget.Contains(page_x, page_y)) {
+ if (rcWidget.Contains(static_cast<FX_FLOAT>(page_x),
+ static_cast<FX_FLOAT>(page_y))) {
pWidgetIterator->Release();
return FPDF_FORMFIELD_XFA;
}
diff --git a/fpdfsdk/src/fsdk_mgr.cpp b/fpdfsdk/src/fsdk_mgr.cpp
index c4cee6f4d8..f134b790a9 100644
--- a/fpdfsdk/src/fsdk_mgr.cpp
+++ b/fpdfsdk/src/fsdk_mgr.cpp
@@ -678,7 +678,10 @@ void CPDFSDK_PageView::PageView_OnDraw(CFX_RenderDevice* pDevice, CPDF_Matrix* p
gs.Create(pDevice);
if (pClip) {
CFX_RectF rectClip;
- rectClip.Set(pClip->left, pClip->top, pClip->Width(), pClip->Height());
+ rectClip.Set(static_cast<FX_FLOAT>(pClip->left),
+ static_cast<FX_FLOAT>(pClip->top),
+ static_cast<FX_FLOAT>(pClip->Width()),
+ static_cast<FX_FLOAT>(pClip->Height()));
gs.SetClipRect(rectClip);
}
IXFA_RenderContext* pRenderContext = XFA_RenderContext_Create();