summaryrefslogtreecommitdiff
path: root/xfa/fwl/cfwl_caret.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-10-02 10:38:55 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-10-02 18:43:08 +0000
commit951b1119d4c7487364bee4c5124b36453e00130d (patch)
treea128c8a30be2c1b74d3ac3f135dc0522b862cf83 /xfa/fwl/cfwl_caret.cpp
parentc065d883d995700b6cb5a00bd027232afded7ae5 (diff)
downloadpdfium-951b1119d4c7487364bee4c5124b36453e00130d.tar.xz
More define cleanup
Remove unused defines; Move to .cpp files where possible; Fixup values. Change-Id: I88cd5deb04b14ab8e9f8097a695c3d0b52d64b4c Reviewed-on: https://pdfium-review.googlesource.com/15130 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fwl/cfwl_caret.cpp')
-rw-r--r--xfa/fwl/cfwl_caret.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/xfa/fwl/cfwl_caret.cpp b/xfa/fwl/cfwl_caret.cpp
index 1cef4f673a..cd85041d92 100644
--- a/xfa/fwl/cfwl_caret.cpp
+++ b/xfa/fwl/cfwl_caret.cpp
@@ -19,6 +19,8 @@ namespace {
const uint32_t kFrequency = 400;
+constexpr int kStateHighlight = (1 << 0);
+
} // namespace
CFWL_Caret::CFWL_Caret(const CFWL_App* app,
@@ -27,7 +29,7 @@ CFWL_Caret::CFWL_Caret(const CFWL_App* app,
: CFWL_Widget(app, std::move(properties), pOuter),
m_pTimer(pdfium::MakeUnique<CFWL_Caret::Timer>(this)),
m_pTimerInfo(nullptr) {
- SetStates(FWL_STATE_CAT_HightLight);
+ SetStates(kStateHighlight);
}
CFWL_Caret::~CFWL_Caret() {
@@ -73,7 +75,7 @@ void CFWL_Caret::HideCaret() {
void CFWL_Caret::DrawCaretBK(CXFA_Graphics* pGraphics,
IFWL_ThemeProvider* pTheme,
const CFX_Matrix* pMatrix) {
- if (!(m_pProperties->m_dwStates & FWL_STATE_CAT_HightLight))
+ if (!(m_pProperties->m_dwStates & kStateHighlight))
return;
CFWL_ThemeBackground param;
@@ -98,10 +100,10 @@ CFWL_Caret::Timer::Timer(CFWL_Caret* pCaret) : CFWL_Timer(pCaret) {}
void CFWL_Caret::Timer::Run(CFWL_TimerInfo* pTimerInfo) {
CFWL_Caret* pCaret = static_cast<CFWL_Caret*>(m_pWidget.Get());
- if (!(pCaret->GetStates() & FWL_STATE_CAT_HightLight))
- pCaret->SetStates(FWL_STATE_CAT_HightLight);
+ if (!(pCaret->GetStates() & kStateHighlight))
+ pCaret->SetStates(kStateHighlight);
else
- pCaret->RemoveStates(FWL_STATE_CAT_HightLight);
+ pCaret->RemoveStates(kStateHighlight);
CFX_RectF rt = pCaret->GetWidgetRect();
pCaret->RepaintRect(CFX_RectF(0, 0, rt.width + 1, rt.height));