summaryrefslogtreecommitdiff
path: root/fpdfsdk/javascript/Field.cpp
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-05-16 11:38:28 -0700
committerCommit bot <commit-bot@chromium.org>2016-05-16 11:38:28 -0700
commit92cb5e580cecf0412b74d51e8863ed557e2bd47a (patch)
treeacdc33aa1bd876742ae62bd5901183413b2ead1b /fpdfsdk/javascript/Field.cpp
parent719a7a71d4cf1b714ad7f76e5f9ca28cfd5b74d3 (diff)
downloadpdfium-92cb5e580cecf0412b74d51e8863ed557e2bd47a.tar.xz
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
Diffstat (limited to 'fpdfsdk/javascript/Field.cpp')
-rw-r--r--fpdfsdk/javascript/Field.cpp27
1 files changed, 12 insertions, 15 deletions
diff --git a/fpdfsdk/javascript/Field.cpp b/fpdfsdk/javascript/Field.cpp
index 158d4d6a7f..c1838332ba 100644
--- a/fpdfsdk/javascript/Field.cpp
+++ b/fpdfsdk/javascript/Field.cpp
@@ -395,22 +395,20 @@ FX_BOOL Field::borderStyle(IJS_Context* cc,
if (!pWidget)
return FALSE;
- int nBorderstyle = pWidget->GetBorderStyle();
-
- switch (nBorderstyle) {
- case BBS_SOLID:
+ switch (pWidget->GetBorderStyle()) {
+ case BorderStyle::SOLID:
vp << L"solid";
break;
- case BBS_DASH:
+ case BorderStyle::DASH:
vp << L"dashed";
break;
- case BBS_BEVELED:
+ case BorderStyle::BEVELED:
vp << L"beveled";
break;
- case BBS_INSET:
+ case BorderStyle::INSET:
vp << L"inset";
break;
- case BBS_UNDERLINE:
+ case BorderStyle::UNDERLINE:
vp << L"underline";
break;
default:
@@ -428,18 +426,17 @@ void Field::SetBorderStyle(CPDFSDK_Document* pDocument,
const CFX_ByteString& string) {
ASSERT(pDocument);
- int nBorderStyle = 0;
-
+ BorderStyle nBorderStyle = BorderStyle::SOLID;
if (string == "solid")
- nBorderStyle = BBS_SOLID;
+ nBorderStyle = BorderStyle::SOLID;
else if (string == "beveled")
- nBorderStyle = BBS_BEVELED;
+ nBorderStyle = BorderStyle::BEVELED;
else if (string == "dashed")
- nBorderStyle = BBS_DASH;
+ nBorderStyle = BorderStyle::DASH;
else if (string == "inset")
- nBorderStyle = BBS_INSET;
+ nBorderStyle = BorderStyle::INSET;
else if (string == "underline")
- nBorderStyle = BBS_UNDERLINE;
+ nBorderStyle = BorderStyle::UNDERLINE;
else
return;