From 951b1119d4c7487364bee4c5124b36453e00130d Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Mon, 2 Oct 2017 10:38:55 -0400 Subject: 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 Reviewed-by: Ryan Harrison Commit-Queue: dsinclair --- xfa/fwl/cfwl_caret.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'xfa/fwl/cfwl_caret.cpp') 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(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(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)); -- cgit v1.2.3