Remove some #defines from cxfa_fffield.h.
Used only in the .cpp file. Replaced with k-constants.
Change-Id: I7d9b3cb3692251823176552a4c125628efcb7e36
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/83152
Auto-Submit: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
diff --git a/xfa/fxfa/cxfa_fffield.cpp b/xfa/fxfa/cxfa_fffield.cpp
index 525d1df..84b6c56 100644
--- a/xfa/fxfa/cxfa_fffield.cpp
+++ b/xfa/fxfa/cxfa_fffield.cpp
@@ -36,6 +36,13 @@
#include "xfa/fxfa/parser/cxfa_node.h"
#include "xfa/fxfa/parser/cxfa_script.h"
+namespace {
+
+constexpr float kMinUIHeight = 4.32f;
+constexpr float kDefaultUIHeight = 2.0f;
+
+} // namespace
+
CXFA_FFField::CXFA_FFField(CXFA_Node* pNode) : CXFA_FFWidget(pNode) {}
CXFA_FFField::~CXFA_FFField() = default;
@@ -295,8 +302,8 @@
if (fWidth > rtWidget.width)
m_UIRect.width += fWidth - rtWidget.width;
- if (fHeight == XFA_DEFAULTUI_HEIGHT && m_UIRect.height < XFA_MINUI_HEIGHT) {
- m_UIRect.height = XFA_MINUI_HEIGHT;
+ if (fHeight == kDefaultUIHeight && m_UIRect.height < kMinUIHeight) {
+ m_UIRect.height = kMinUIHeight;
m_CaptionRect.top += rtUIMargin.top + rtUIMargin.height;
} else if (fHeight > rtWidget.height) {
m_UIRect.height += fHeight - rtWidget.height;
@@ -325,8 +332,8 @@
m_CaptionRect.left += fWidth - rtWidget.width;
}
- if (fHeight == XFA_DEFAULTUI_HEIGHT && m_UIRect.height < XFA_MINUI_HEIGHT) {
- m_UIRect.height = XFA_MINUI_HEIGHT;
+ if (fHeight == kDefaultUIHeight && m_UIRect.height < kMinUIHeight) {
+ m_UIRect.height = kMinUIHeight;
m_CaptionRect.top += rtUIMargin.top + rtUIMargin.height;
} else if (fHeight > rtWidget.height) {
m_UIRect.height += fHeight - rtWidget.height;
diff --git a/xfa/fxfa/cxfa_fffield.h b/xfa/fxfa/cxfa_fffield.h
index efe06ea..57ce008 100644
--- a/xfa/fxfa/cxfa_fffield.h
+++ b/xfa/fxfa/cxfa_fffield.h
@@ -15,9 +15,6 @@
class CXFA_FFDropDown;
class CXFA_Node;
-#define XFA_MINUI_HEIGHT 4.32f
-#define XFA_DEFAULTUI_HEIGHT 2.0f
-
class CXFA_FFField : public CXFA_FFWidget, public IFWL_WidgetDelegate {
public:
enum ShapeOption { kSquareShape = 0, kRoundShape };