Replace XFA_FWL_PSBSTYLEEXT defines with an enum class.

Convert the three pushbutton highlight-mode bits to a scoped enum
HighlightStyle nested in CXFA_FFPushButton, unwrapping to uint32_t via
fxcrt::to_underlying() only at the ModifyStyleExts/GetStyleExts
boundary.

Bug: 42270078
Change-Id: I46a424e1302d7c47b16cd07dca2a960f419920ec
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/148813
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Helmut Januschka <helmut@januschka.com>
Reviewed-by: Nicolás Peña <npm@chromium.org>
diff --git a/xfa/fxfa/cxfa_ffpushbutton.cpp b/xfa/fxfa/cxfa_ffpushbutton.cpp
index 6e33d9b..e8c47b8 100644
--- a/xfa/fxfa/cxfa_ffpushbutton.cpp
+++ b/xfa/fxfa/cxfa_ffpushbutton.cpp
@@ -7,6 +7,7 @@
 #include "xfa/fxfa/cxfa_ffpushbutton.h"
 
 #include "core/fxcrt/check.h"
+#include "core/fxcrt/to_underlying.h"
 #include "v8/include/cppgc/visitor.h"
 #include "xfa/fgas/graphics/cfgas_gecolor.h"
 #include "xfa/fgas/graphics/cfgas_gepath.h"
@@ -82,21 +83,22 @@
 }
 
 void CXFA_FFPushButton::UpdateWidgetProperty() {
-  uint32_t dwStyleEx = 0;
+  HighlightStyle highlight = HighlightStyle::kNone;
   switch (button_->GetHighlight()) {
     case XFA_AttributeValue::Inverted:
-      dwStyleEx = XFA_FWL_PSBSTYLEEXT_HiliteInverted;
+      highlight = HighlightStyle::kInverted;
       break;
     case XFA_AttributeValue::Outline:
-      dwStyleEx = XFA_FWL_PSBSTYLEEXT_HiliteOutLine;
+      highlight = HighlightStyle::kOutline;
       break;
     case XFA_AttributeValue::Push:
-      dwStyleEx = XFA_FWL_PSBSTYLEEXT_HilitePush;
+      highlight = HighlightStyle::kPush;
       break;
     default:
       break;
   }
-  GetNormalWidget()->ModifyStyleExts(dwStyleEx, 0xFFFFFFFF);
+  GetNormalWidget()->ModifyStyleExts(fxcrt::to_underlying(highlight),
+                                     0xFFFFFFFF);
 }
 
 void CXFA_FFPushButton::PerformLayout() {
@@ -220,7 +222,8 @@
 void CXFA_FFPushButton::OnDrawWidget(CFGAS_GEGraphics* pGraphics,
                                      const CFX_Matrix& matrix) {
   auto* pWidget = GetNormalWidget();
-  if (pWidget->GetStyleExts() & XFA_FWL_PSBSTYLEEXT_HiliteInverted) {
+  if (pWidget->GetStyleExts() &
+      fxcrt::to_underlying(HighlightStyle::kInverted)) {
     if ((pWidget->GetStates() & FWL_STATE_PSB_Pressed) &&
         (pWidget->GetStates() & FWL_STATE_PSB_Hovered)) {
       CFX_RectF rtFill(0, 0, pWidget->GetWidgetRect().Size());
@@ -235,7 +238,8 @@
     return;
   }
 
-  if (pWidget->GetStyleExts() & XFA_FWL_PSBSTYLEEXT_HiliteOutLine) {
+  if (pWidget->GetStyleExts() &
+      fxcrt::to_underlying(HighlightStyle::kOutline)) {
     if ((pWidget->GetStates() & FWL_STATE_PSB_Pressed) &&
         (pWidget->GetStates() & FWL_STATE_PSB_Hovered)) {
       float fLineWidth = GetLineWidth();
diff --git a/xfa/fxfa/cxfa_ffpushbutton.h b/xfa/fxfa/cxfa_ffpushbutton.h
index 938ef42..ddc27d9 100644
--- a/xfa/fxfa/cxfa_ffpushbutton.h
+++ b/xfa/fxfa/cxfa_ffpushbutton.h
@@ -7,19 +7,24 @@
 #ifndef XFA_FXFA_CXFA_FFPUSHBUTTON_H_
 #define XFA_FXFA_CXFA_FFPUSHBUTTON_H_
 
+#include <stdint.h>
+
 #include "v8/include/cppgc/member.h"
 #include "xfa/fxfa/cxfa_fffield.h"
 
-#define XFA_FWL_PSBSTYLEEXT_HiliteInverted (1L << 0)
-#define XFA_FWL_PSBSTYLEEXT_HilitePush (1L << 1)
-#define XFA_FWL_PSBSTYLEEXT_HiliteOutLine (1L << 2)
-
 class CXFA_Button;
 class CXFA_TextLayout;
 class CXFA_TextProvider;
 
 class CXFA_FFPushButton final : public CXFA_FFField {
  public:
+  enum class HighlightStyle : uint32_t {
+    kNone = 0,
+    kInverted = 1L << 0,
+    kPush = 1L << 1,
+    kOutline = 1L << 2,
+  };
+
   CONSTRUCT_VIA_MAKE_GARBAGE_COLLECTED;
   ~CXFA_FFPushButton() override;