Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(576)

Unified Diff: fpdfsdk/cpdfsdk_widget.cpp

Issue 2343693002: Replace FX_UINT with unsigned int (Closed)
Patch Set: Remove #s Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « fpdfsdk/cpdfsdk_pageview.cpp ('k') | fpdfsdk/formfiller/cffl_checkbox.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/cpdfsdk_widget.cpp
diff --git a/fpdfsdk/cpdfsdk_widget.cpp b/fpdfsdk/cpdfsdk_widget.cpp
index 9bc18fae04694628981c91fca0d82f847052afbc..d4fc5c790022acc04fb23fa21deb8f5ee9b45d76 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;
}
« no previous file with comments | « fpdfsdk/cpdfsdk_pageview.cpp ('k') | fpdfsdk/formfiller/cffl_checkbox.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698