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

Unified Diff: fpdfsdk/javascript/Field.cpp

Issue 1980973002: Convert border style defines to an enum class. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 7 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
Index: fpdfsdk/javascript/Field.cpp
diff --git a/fpdfsdk/javascript/Field.cpp b/fpdfsdk/javascript/Field.cpp
index 158d4d6a7f27a33cdd9dd932e822c79e15bbff3a..c1838332ba0d90e46964930599fbcf4ad6bd3c68 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;

Powered by Google App Engine
This is Rietveld 408576698