Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(575)

Unified Diff: xfa/fwl/basewidget/fwl_listboximp.cpp

Issue 1938163002: More define cleanup. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Rebase to master Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « xfa/fwl/basewidget/fwl_editimp.cpp ('k') | xfa/fwl/basewidget/fwl_monthcalendarimp.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fwl/basewidget/fwl_listboximp.cpp
diff --git a/xfa/fwl/basewidget/fwl_listboximp.cpp b/xfa/fwl/basewidget/fwl_listboximp.cpp
index dd017e215ff5741351aa9e54ee4711ee4c2941c8..611dd272b656bfa9e85c9acb6547d02f32d91915 100644
--- a/xfa/fwl/basewidget/fwl_listboximp.cpp
+++ b/xfa/fwl/basewidget/fwl_listboximp.cpp
@@ -17,7 +17,11 @@
#include "xfa/fwl/core/fwl_widgetimp.h"
#include "xfa/fwl/core/ifwl_themeprovider.h"
-#define FWL_LISTBOX_ItemTextMargin 2
+namespace {
+
+const int kItemTextMargin = 2;
+
+} // namespace
// static
IFWL_ListBox* IFWL_ListBox::Create(const CFWL_WidgetImpProperties& properties,
@@ -702,7 +706,7 @@ void CFWL_ListBoxImp::DrawItem(CFX_Graphics* pGraphics,
return;
}
CFX_RectF rtText(rtItem);
- rtText.Deflate(FWL_LISTBOX_ItemTextMargin, FWL_LISTBOX_ItemTextMargin);
+ rtText.Deflate(kItemTextMargin, kItemTextMargin);
if (bHasIcon || bHasCheck) {
rtText.Deflate(rtItem.height, 0, 0, 0);
}
@@ -768,7 +772,7 @@ CFX_SizeF CFWL_ListBoxImp::CalcSize(FX_BOOL bAutoSize) {
}
} else {
fWidth = GetMaxTextWidth();
- fWidth += 2 * FWL_LISTBOX_ItemTextMargin;
+ fWidth += 2 * kItemTextMargin;
if (!bAutoSize) {
FX_FLOAT fActualWidth =
m_rtClient.width - rtUIMargin.left - rtUIMargin.width;
@@ -938,7 +942,7 @@ FX_FLOAT CFWL_ListBoxImp::GetItemHeigt() {
static_cast<FX_FLOAT*>(GetThemeCapacity(CFWL_WidgetCapacity::FontSize));
if (!pfFont)
return 20;
- return *pfFont + 2 * FWL_LISTBOX_ItemTextMargin;
+ return *pfFont + 2 * kItemTextMargin;
}
void CFWL_ListBoxImp::InitScrollBar(FX_BOOL bVert) {
if ((bVert && m_pVertScrollBar) || (!bVert && m_pHorzScrollBar)) {
@@ -1002,11 +1006,11 @@ int32_t CFWL_ListBoxImpDelegate::OnProcessMessage(CFWL_Message* pMessage) {
case CFWL_MessageType::Mouse: {
CFWL_MsgMouse* pMsg = static_cast<CFWL_MsgMouse*>(pMessage);
switch (pMsg->m_dwCmd) {
- case FWL_MSGMOUSECMD_LButtonDown: {
+ case FWL_MouseCommand::LeftButtonDown: {
OnLButtonDown(pMsg);
break;
}
- case FWL_MSGMOUSECMD_LButtonUp: {
+ case FWL_MouseCommand::LeftButtonUp: {
OnLButtonUp(pMsg);
break;
}
@@ -1021,7 +1025,7 @@ int32_t CFWL_ListBoxImpDelegate::OnProcessMessage(CFWL_Message* pMessage) {
}
case CFWL_MessageType::Key: {
CFWL_MsgKey* pMsg = static_cast<CFWL_MsgKey*>(pMessage);
- if (pMsg->m_dwCmd == FWL_MSGKEYCMD_KeyDown)
+ if (pMsg->m_dwCmd == FWL_KeyCommand::KeyDown)
OnKeyDown(pMsg);
break;
}
« no previous file with comments | « xfa/fwl/basewidget/fwl_editimp.cpp ('k') | xfa/fwl/basewidget/fwl_monthcalendarimp.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698