summaryrefslogtreecommitdiff
path: root/fpdfsdk/cpdfsdk_widget.cpp
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-09-15 12:07:23 -0700
committerCommit bot <commit-bot@chromium.org>2016-09-15 12:07:23 -0700
commit72177dadac8f9765440b3aa01e2668f60a8b3f43 (patch)
treee7f5fb70bd9b228b66c7a5a4a874577528e27207 /fpdfsdk/cpdfsdk_widget.cpp
parent8f53f54a9ccada2ea8651f2786f1bbee323f09b7 (diff)
downloadpdfium-72177dadac8f9765440b3aa01e2668f60a8b3f43.tar.xz
Replace FX_UINT with unsigned int
Remove the FX_UINT typedef and update to use the actual unsigned int type. Review-Url: https://codereview.chromium.org/2343693002
Diffstat (limited to 'fpdfsdk/cpdfsdk_widget.cpp')
-rw-r--r--fpdfsdk/cpdfsdk_widget.cpp20
1 files changed, 14 insertions, 6 deletions
diff --git a/fpdfsdk/cpdfsdk_widget.cpp b/fpdfsdk/cpdfsdk_widget.cpp
index 9bc18fae04..d4fc5c7900 100644
--- a/fpdfsdk/cpdfsdk_widget.cpp
+++ b/fpdfsdk/cpdfsdk_widget.cpp
@@ -39,6 +39,17 @@
#include "xfa/fxfa/include/xfa_ffwidgethandler.h"
#endif // PDF_ENABLE_XFA
+namespace {
+
+// Convert a FX_ARGB to a FX_COLORREF.
+FX_COLORREF ARGBToColorRef(FX_ARGB argb) {
+ return (((static_cast<uint32_t>(argb) & 0x00FF0000) >> 16) |
+ (static_cast<uint32_t>(argb) & 0x0000FF00) |
+ ((static_cast<uint32_t>(argb) & 0x000000FF) << 16));
+}
+
+} // namespace
+
CPDFSDK_Widget::CPDFSDK_Widget(CPDF_Annot* pAnnot,
CPDFSDK_PageView* pPageView,
CPDFSDK_InterForm* pInterForm)
@@ -555,16 +566,14 @@ CFX_WideString CPDFSDK_Widget::GetName() const {
FX_BOOL CPDFSDK_Widget::GetFillColor(FX_COLORREF& color) const {
CPDF_FormControl* pFormCtrl = GetFormControl();
int iColorType = 0;
- color = FX_ARGBTOCOLORREF(pFormCtrl->GetBackgroundColor(iColorType));
-
+ color = ARGBToColorRef(pFormCtrl->GetBackgroundColor(iColorType));
return iColorType != COLORTYPE_TRANSPARENT;
}
FX_BOOL CPDFSDK_Widget::GetBorderColor(FX_COLORREF& color) const {
CPDF_FormControl* pFormCtrl = GetFormControl();
int iColorType = 0;
- color = FX_ARGBTOCOLORREF(pFormCtrl->GetBorderColor(iColorType));
-
+ color = ARGBToColorRef(pFormCtrl->GetBorderColor(iColorType));
return iColorType != COLORTYPE_TRANSPARENT;
}
@@ -577,8 +586,7 @@ FX_BOOL CPDFSDK_Widget::GetTextColor(FX_COLORREF& color) const {
FX_ARGB argb;
int iColorType = COLORTYPE_TRANSPARENT;
da.GetColor(argb, iColorType);
- color = FX_ARGBTOCOLORREF(argb);
-
+ color = ARGBToColorRef(argb);
return iColorType != COLORTYPE_TRANSPARENT;
}