From 92cb5e580cecf0412b74d51e8863ed557e2bd47a Mon Sep 17 00:00:00 2001 From: dsinclair Date: Mon, 16 May 2016 11:38:28 -0700 Subject: Convert border style defines to an enum class. There were two defines, BBS_ and PBS_ for the various border styles in the system. They were the same, except PBS_ had an extra SHADOW define which was never used. This CL combines both of those into a single BorderStyle enum class and updates the code as needed. Also, removes ADDBIT, GETBIT unused defines. Updates barcode code to use the util.h defines instead of redefinition. fsdk_baseannot names starting with _ were cleaned up and some #defines moved to constants. Review-Url: https://codereview.chromium.org/1980973002 --- fpdfsdk/formfiller/cffl_formfiller.cpp | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) (limited to 'fpdfsdk/formfiller/cffl_formfiller.cpp') diff --git a/fpdfsdk/formfiller/cffl_formfiller.cpp b/fpdfsdk/formfiller/cffl_formfiller.cpp index b6f719db99..8ee6da387d 100644 --- a/fpdfsdk/formfiller/cffl_formfiller.cpp +++ b/fpdfsdk/formfiller/cffl_formfiller.cpp @@ -323,32 +323,23 @@ PWL_CREATEPARAM CFFL_FormFiller::GetCreateParam() { cp.fFontSize = m_pWidget->GetFontSize(); cp.dwBorderWidth = m_pWidget->GetBorderWidth(); - int nBorderStyle = m_pWidget->GetBorderStyle(); - - switch (nBorderStyle) { - case BBS_SOLID: - cp.nBorderStyle = PBS_SOLID; - break; - case BBS_DASH: - cp.nBorderStyle = PBS_DASH; + cp.nBorderStyle = m_pWidget->GetBorderStyle(); + switch (cp.nBorderStyle) { + case BorderStyle::DASH: cp.sDash = CPWL_Dash(3, 3, 0); break; - case BBS_BEVELED: - cp.nBorderStyle = PBS_BEVELED; + case BorderStyle::BEVELED: cp.dwBorderWidth *= 2; break; - case BBS_INSET: - cp.nBorderStyle = PBS_INSET; + case BorderStyle::INSET: cp.dwBorderWidth *= 2; break; - case BBS_UNDERLINE: - cp.nBorderStyle = PBS_UNDERLINED; + default: break; } - if (cp.fFontSize <= 0) { + if (cp.fFontSize <= 0) dwCreateFlags |= PWS_AUTOFONTSIZE; - } cp.dwFlags = dwCreateFlags; cp.pSystemHandler = m_pApp->GetSysHandler(); -- cgit v1.2.3