Rename enum CPDF_FormControl::HighlightingMode values.
Rename them to kFoo.
Bug: pdfium:547
Change-Id: I97a16736a7d44c8147ce0bf16cc41128d3ba66d9
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/81771
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
diff --git a/core/fpdfdoc/cpdf_formcontrol.cpp b/core/fpdfdoc/cpdf_formcontrol.cpp
index d181bab..da4b425 100644
--- a/core/fpdfdoc/cpdf_formcontrol.cpp
+++ b/core/fpdfdoc/cpdf_formcontrol.cpp
@@ -23,15 +23,15 @@
constexpr char kHighlightModes[] = {'N', 'I', 'O', 'P', 'T'};
// Order of |kHighlightModes| must match order of HighlightingMode enum.
-static_assert(kHighlightModes[CPDF_FormControl::None] == 'N',
+static_assert(kHighlightModes[CPDF_FormControl::kNone] == 'N',
"HighlightingMode mismatch");
-static_assert(kHighlightModes[CPDF_FormControl::Invert] == 'I',
+static_assert(kHighlightModes[CPDF_FormControl::kInvert] == 'I',
"HighlightingMode mismatch");
-static_assert(kHighlightModes[CPDF_FormControl::Outline] == 'O',
+static_assert(kHighlightModes[CPDF_FormControl::kOutline] == 'O',
"HighlightingMode mismatch");
-static_assert(kHighlightModes[CPDF_FormControl::Push] == 'P',
+static_assert(kHighlightModes[CPDF_FormControl::kPush] == 'P',
"HighlightingMode mismatch");
-static_assert(kHighlightModes[CPDF_FormControl::Toggle] == 'T',
+static_assert(kHighlightModes[CPDF_FormControl::kToggle] == 'T',
"HighlightingMode mismatch");
} // namespace
@@ -132,7 +132,7 @@
if (csH == kHighlightModes[i])
return static_cast<HighlightingMode>(i);
}
- return Invert;
+ return kInvert;
}
CPDF_ApSettings CPDF_FormControl::GetMK() const {
diff --git a/core/fpdfdoc/cpdf_formcontrol.h b/core/fpdfdoc/cpdf_formcontrol.h
index ead337b..fbdfed1 100644
--- a/core/fpdfdoc/cpdf_formcontrol.h
+++ b/core/fpdfdoc/cpdf_formcontrol.h
@@ -35,7 +35,7 @@
class CPDF_FormControl {
public:
- enum HighlightingMode { None = 0, Invert, Outline, Push, Toggle };
+ enum HighlightingMode { kNone = 0, kInvert, kOutline, kPush, kToggle };
CPDF_FormControl(CPDF_FormField* pField, CPDF_Dictionary* pWidgetDict);
~CPDF_FormControl();
diff --git a/fpdfsdk/cpdfsdk_appstream.cpp b/fpdfsdk/cpdfsdk_appstream.cpp
index 74de5ac..c1b34b8 100644
--- a/fpdfsdk/cpdfsdk_appstream.cpp
+++ b/fpdfsdk/cpdfsdk_appstream.cpp
@@ -1259,7 +1259,7 @@
AddImage("N", pNormalIcon);
CPDF_FormControl::HighlightingMode eHLM = pControl->GetHighlightingMode();
- if (eHLM != CPDF_FormControl::Push && eHLM != CPDF_FormControl::Toggle) {
+ if (eHLM != CPDF_FormControl::kPush && eHLM != CPDF_FormControl::kToggle) {
Remove("D");
Remove("R");
return;
diff --git a/fpdfsdk/formfiller/cffl_button.cpp b/fpdfsdk/formfiller/cffl_button.cpp
index acfcbe9..c02d9d6 100644
--- a/fpdfsdk/formfiller/cffl_button.cpp
+++ b/fpdfsdk/formfiller/cffl_button.cpp
@@ -65,7 +65,7 @@
DCHECK(pPageView);
CPDFSDK_Widget* pWidget = ToCPDFSDKWidget(pAnnot);
CPDF_FormControl* pCtrl = pWidget->GetFormControl();
- if (pCtrl->GetHighlightingMode() != CPDF_FormControl::Push) {
+ if (pCtrl->GetHighlightingMode() != CPDF_FormControl::kPush) {
pWidget->DrawAppearance(pDevice, mtUser2Device, CPDF_Annot::Normal,
nullptr);
return;
diff --git a/fxjs/cjs_field.cpp b/fxjs/cjs_field.cpp
index aa55c7d..ffe3070 100644
--- a/fxjs/cjs_field.cpp
+++ b/fxjs/cjs_field.cpp
@@ -1380,15 +1380,15 @@
int eHM = pFormControl->GetHighlightingMode();
switch (eHM) {
- case CPDF_FormControl::None:
+ case CPDF_FormControl::kNone:
return CJS_Result::Success(pRuntime->NewString("none"));
- case CPDF_FormControl::Push:
+ case CPDF_FormControl::kPush:
return CJS_Result::Success(pRuntime->NewString("push"));
- case CPDF_FormControl::Invert:
+ case CPDF_FormControl::kInvert:
return CJS_Result::Success(pRuntime->NewString("invert"));
- case CPDF_FormControl::Outline:
+ case CPDF_FormControl::kOutline:
return CJS_Result::Success(pRuntime->NewString("outline"));
- case CPDF_FormControl::Toggle:
+ case CPDF_FormControl::kToggle:
return CJS_Result::Success(pRuntime->NewString("toggle"));
}
return CJS_Result::Success();