Change several enums to follow the style guide.
Bug: pdfium:547
Change-Id: If457d4f967ed368ab6fdd8c704cfc7c101864844
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/70691
Reviewed-by: Daniel Hosseinian <dhoss@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
diff --git a/core/fpdfapi/parser/cpdf_syntax_parser.cpp b/core/fpdfapi/parser/cpdf_syntax_parser.cpp
index 0e07c3d..0fc3e96 100644
--- a/core/fpdfapi/parser/cpdf_syntax_parser.cpp
+++ b/core/fpdfapi/parser/cpdf_syntax_parser.cpp
@@ -30,7 +30,13 @@
namespace {
-enum class ReadStatus { Normal, Backslash, Octal, FinishOctal, CarriageReturn };
+enum class ReadStatus {
+ kNormal,
+ kBackslash,
+ kOctal,
+ kFinishOctal,
+ kCarriageReturn
+};
class ReadableSubStream final : public IFX_SeekableReadStream {
public:
@@ -236,11 +242,11 @@
std::ostringstream buf;
int32_t parlevel = 0;
- ReadStatus status = ReadStatus::Normal;
+ ReadStatus status = ReadStatus::kNormal;
int32_t iEscCode = 0;
while (1) {
switch (status) {
- case ReadStatus::Normal:
+ case ReadStatus::kNormal:
if (ch == ')') {
if (parlevel == 0)
return ByteString(buf);
@@ -249,19 +255,19 @@
parlevel++;
}
if (ch == '\\')
- status = ReadStatus::Backslash;
+ status = ReadStatus::kBackslash;
else
buf << static_cast<char>(ch);
break;
- case ReadStatus::Backslash:
+ case ReadStatus::kBackslash:
if (FXSYS_IsOctalDigit(ch)) {
iEscCode = FXSYS_DecimalCharToInt(static_cast<wchar_t>(ch));
- status = ReadStatus::Octal;
+ status = ReadStatus::kOctal;
break;
}
if (ch == '\r') {
- status = ReadStatus::CarriageReturn;
+ status = ReadStatus::kCarriageReturn;
break;
}
if (ch == 'n') {
@@ -277,21 +283,21 @@
} else if (ch != '\n') {
buf << static_cast<char>(ch);
}
- status = ReadStatus::Normal;
+ status = ReadStatus::kNormal;
break;
- case ReadStatus::Octal:
+ case ReadStatus::kOctal:
if (FXSYS_IsOctalDigit(ch)) {
iEscCode =
iEscCode * 8 + FXSYS_DecimalCharToInt(static_cast<wchar_t>(ch));
- status = ReadStatus::FinishOctal;
+ status = ReadStatus::kFinishOctal;
} else {
buf << static_cast<char>(iEscCode);
- status = ReadStatus::Normal;
+ status = ReadStatus::kNormal;
continue;
}
break;
- case ReadStatus::FinishOctal:
- status = ReadStatus::Normal;
+ case ReadStatus::kFinishOctal:
+ status = ReadStatus::kNormal;
if (FXSYS_IsOctalDigit(ch)) {
iEscCode =
iEscCode * 8 + FXSYS_DecimalCharToInt(static_cast<wchar_t>(ch));
@@ -301,8 +307,8 @@
continue;
}
break;
- case ReadStatus::CarriageReturn:
- status = ReadStatus::Normal;
+ case ReadStatus::kCarriageReturn:
+ status = ReadStatus::kNormal;
if (ch != '\n')
continue;
break;
diff --git a/core/fpdfdoc/cpvt_generateap.cpp b/core/fpdfdoc/cpvt_generateap.cpp
index f6a4b52..cd88f3d 100644
--- a/core/fpdfdoc/cpvt_generateap.cpp
+++ b/core/fpdfdoc/cpvt_generateap.cpp
@@ -46,7 +46,7 @@
int32_t nPhase;
};
-enum class PaintOperation { STROKE, FILL };
+enum class PaintOperation { kStroke, kFill };
ByteString GetPDFWordString(IPVT_FontMap* pFontMap,
int32_t nFontIndex,
@@ -181,18 +181,18 @@
case CFX_Color::kRGB:
sColorStream << color.fColor1 << " " << color.fColor2 << " "
<< color.fColor3 << " "
- << (nOperation == PaintOperation::STROKE ? "RG" : "rg")
+ << (nOperation == PaintOperation::kStroke ? "RG" : "rg")
<< "\n";
break;
case CFX_Color::kGray:
sColorStream << color.fColor1 << " "
- << (nOperation == PaintOperation::STROKE ? "G" : "g")
+ << (nOperation == PaintOperation::kStroke ? "G" : "g")
<< "\n";
break;
case CFX_Color::kCMYK:
sColorStream << color.fColor1 << " " << color.fColor2 << " "
<< color.fColor3 << " " << color.fColor4 << " "
- << (nOperation == PaintOperation::STROKE ? "K" : "k")
+ << (nOperation == PaintOperation::kStroke ? "K" : "k")
<< "\n";
break;
case CFX_Color::kTransparent:
@@ -218,8 +218,8 @@
float fHalfWidth = fWidth / 2.0f;
switch (nStyle) {
default:
- case BorderStyle::SOLID:
- sColor = GenerateColorAP(color, PaintOperation::FILL);
+ case BorderStyle::kSolid:
+ sColor = GenerateColorAP(color, PaintOperation::kFill);
if (sColor.GetLength() > 0) {
sAppStream << sColor;
sAppStream << fLeft << " " << fBottom << " " << fRight - fLeft << " "
@@ -230,8 +230,8 @@
sAppStream << "f*\n";
}
break;
- case BorderStyle::DASH:
- sColor = GenerateColorAP(color, PaintOperation::STROKE);
+ case BorderStyle::kDash:
+ sColor = GenerateColorAP(color, PaintOperation::kStroke);
if (sColor.GetLength() > 0) {
sAppStream << sColor;
sAppStream << fWidth << " w"
@@ -249,9 +249,9 @@
<< " l S\n";
}
break;
- case BorderStyle::BEVELED:
- case BorderStyle::INSET:
- sColor = GenerateColorAP(crLeftTop, PaintOperation::FILL);
+ case BorderStyle::kBeveled:
+ case BorderStyle::kInset:
+ sColor = GenerateColorAP(crLeftTop, PaintOperation::kFill);
if (sColor.GetLength() > 0) {
sAppStream << sColor;
sAppStream << fLeft + fHalfWidth << " " << fBottom + fHalfWidth
@@ -267,7 +267,7 @@
sAppStream << fLeft + fHalfWidth * 2 << " "
<< fBottom + fHalfWidth * 2 << " l f\n";
}
- sColor = GenerateColorAP(crRightBottom, PaintOperation::FILL);
+ sColor = GenerateColorAP(crRightBottom, PaintOperation::kFill);
if (sColor.GetLength() > 0) {
sAppStream << sColor;
sAppStream << fRight - fHalfWidth << " " << fTop - fHalfWidth
@@ -283,7 +283,7 @@
sAppStream << fRight - fHalfWidth * 2 << " " << fTop - fHalfWidth * 2
<< " l f\n";
}
- sColor = GenerateColorAP(color, PaintOperation::FILL);
+ sColor = GenerateColorAP(color, PaintOperation::kFill);
if (sColor.GetLength() > 0) {
sAppStream << sColor;
sAppStream << fLeft << " " << fBottom << " " << fRight - fLeft << " "
@@ -293,8 +293,8 @@
<< fTop - fBottom - fHalfWidth * 2 << " re f*\n";
}
break;
- case BorderStyle::UNDERLINE:
- sColor = GenerateColorAP(color, PaintOperation::STROKE);
+ case BorderStyle::kUnderline:
+ sColor = GenerateColorAP(color, PaintOperation::kStroke);
if (sColor.GetLength() > 0) {
sAppStream << sColor;
sAppStream << fWidth << " w\n";
@@ -395,7 +395,7 @@
std::ostringstream sAppStream;
sAppStream << "BT\n"
<< GenerateColorAP(CFX_Color(CFX_Color::kRGB, 0, 0, 0),
- PaintOperation::FILL)
+ PaintOperation::kFill)
<< sContent << "ET\n"
<< "Q\n";
return ByteString(sAppStream);
@@ -425,9 +425,9 @@
ByteString GenerateTextSymbolAP(const CFX_FloatRect& rect) {
std::ostringstream sAppStream;
sAppStream << GenerateColorAP(CFX_Color(CFX_Color::kRGB, 1, 1, 0),
- PaintOperation::FILL);
+ PaintOperation::kFill);
sAppStream << GenerateColorAP(CFX_Color(CFX_Color::kRGB, 0, 0, 0),
- PaintOperation::STROKE);
+ PaintOperation::kStroke);
const float fBorderWidth = 1;
sAppStream << fBorderWidth << " w\n";
@@ -538,12 +538,13 @@
sAppStream << "/" << sExtGSDictName << " gs ";
CPDF_Array* pInteriorColor = pAnnotDict->GetArrayFor("IC");
- sAppStream << GetColorStringWithDefault(
- pInteriorColor, CFX_Color(CFX_Color::kTransparent), PaintOperation::FILL);
+ sAppStream << GetColorStringWithDefault(pInteriorColor,
+ CFX_Color(CFX_Color::kTransparent),
+ PaintOperation::kFill);
sAppStream << GetColorStringWithDefault(
pAnnotDict->GetArrayFor(pdfium::annotation::kC),
- CFX_Color(CFX_Color::kRGB, 0, 0, 0), PaintOperation::STROKE);
+ CFX_Color(CFX_Color::kRGB, 0, 0, 0), PaintOperation::kStroke);
float fBorderWidth = GetBorderWidth(*pAnnotDict);
bool bIsStrokeRect = fBorderWidth > 0;
@@ -611,7 +612,7 @@
sAppStream << GetColorStringWithDefault(
pAnnotDict->GetArrayFor(pdfium::annotation::kC),
- CFX_Color(CFX_Color::kRGB, 1, 1, 0), PaintOperation::FILL);
+ CFX_Color(CFX_Color::kRGB, 1, 1, 0), PaintOperation::kFill);
CPDF_Array* pArray = pAnnotDict->GetArrayFor("QuadPoints");
if (pArray) {
@@ -653,7 +654,7 @@
sAppStream << GetColorStringWithDefault(
pAnnotDict->GetArrayFor(pdfium::annotation::kC),
- CFX_Color(CFX_Color::kRGB, 0, 0, 0), PaintOperation::STROKE);
+ CFX_Color(CFX_Color::kRGB, 0, 0, 0), PaintOperation::kStroke);
sAppStream << fBorderWidth << " w ";
sAppStream << GetDashPatternString(*pAnnotDict);
@@ -718,7 +719,7 @@
sAppStream << GetColorStringWithDefault(
pAnnotDict->GetArrayFor(pdfium::annotation::kC),
- CFX_Color(CFX_Color::kRGB, 0, 0, 0), PaintOperation::STROKE);
+ CFX_Color(CFX_Color::kRGB, 0, 0, 0), PaintOperation::kStroke);
CPDF_Array* pArray = pAnnotDict->GetArrayFor("QuadPoints");
if (pArray) {
@@ -748,9 +749,9 @@
sAppStream << "/" << sExtGSDictName << " gs\n";
sAppStream << GenerateColorAP(CFX_Color(CFX_Color::kRGB, 1, 1, 0),
- PaintOperation::FILL);
+ PaintOperation::kFill);
sAppStream << GenerateColorAP(CFX_Color(CFX_Color::kRGB, 0, 0, 0),
- PaintOperation::STROKE);
+ PaintOperation::kStroke);
const float fBorderWidth = 1;
sAppStream << fBorderWidth << " w\n";
@@ -788,12 +789,13 @@
sAppStream << "/" << sExtGSDictName << " gs ";
CPDF_Array* pInteriorColor = pAnnotDict->GetArrayFor("IC");
- sAppStream << GetColorStringWithDefault(
- pInteriorColor, CFX_Color(CFX_Color::kTransparent), PaintOperation::FILL);
+ sAppStream << GetColorStringWithDefault(pInteriorColor,
+ CFX_Color(CFX_Color::kTransparent),
+ PaintOperation::kFill);
sAppStream << GetColorStringWithDefault(
pAnnotDict->GetArrayFor(pdfium::annotation::kC),
- CFX_Color(CFX_Color::kRGB, 0, 0, 0), PaintOperation::STROKE);
+ CFX_Color(CFX_Color::kRGB, 0, 0, 0), PaintOperation::kStroke);
float fBorderWidth = GetBorderWidth(*pAnnotDict);
bool bIsStrokeRect = fBorderWidth > 0;
@@ -835,7 +837,7 @@
sAppStream << GetColorStringWithDefault(
pAnnotDict->GetArrayFor(pdfium::annotation::kC),
- CFX_Color(CFX_Color::kRGB, 0, 0, 0), PaintOperation::STROKE);
+ CFX_Color(CFX_Color::kRGB, 0, 0, 0), PaintOperation::kStroke);
CPDF_Array* pArray = pAnnotDict->GetArrayFor("QuadPoints");
if (pArray) {
@@ -885,7 +887,7 @@
sAppStream << GetColorStringWithDefault(
pAnnotDict->GetArrayFor(pdfium::annotation::kC),
- CFX_Color(CFX_Color::kRGB, 0, 0, 0), PaintOperation::STROKE);
+ CFX_Color(CFX_Color::kRGB, 0, 0, 0), PaintOperation::kStroke);
CPDF_Array* pArray = pAnnotDict->GetArrayFor("QuadPoints");
if (pArray) {
@@ -993,7 +995,7 @@
break;
}
- BorderStyle nBorderStyle = BorderStyle::SOLID;
+ BorderStyle nBorderStyle = BorderStyle::kSolid;
float fBorderWidth = 1;
CPVT_Dash dsBorder(3, 0, 0);
CFX_Color crLeftTop;
@@ -1009,25 +1011,25 @@
if (pBSDict->GetStringFor("S").GetLength()) {
switch (pBSDict->GetStringFor("S")[0]) {
case 'S':
- nBorderStyle = BorderStyle::SOLID;
+ nBorderStyle = BorderStyle::kSolid;
break;
case 'D':
- nBorderStyle = BorderStyle::DASH;
+ nBorderStyle = BorderStyle::kDash;
break;
case 'B':
- nBorderStyle = BorderStyle::BEVELED;
+ nBorderStyle = BorderStyle::kBeveled;
fBorderWidth *= 2;
crLeftTop = CFX_Color(CFX_Color::kGray, 1);
crRightBottom = CFX_Color(CFX_Color::kGray, 0.5);
break;
case 'I':
- nBorderStyle = BorderStyle::INSET;
+ nBorderStyle = BorderStyle::kInset;
fBorderWidth *= 2;
crLeftTop = CFX_Color(CFX_Color::kGray, 0.5);
crRightBottom = CFX_Color(CFX_Color::kGray, 0.75);
break;
case 'U':
- nBorderStyle = BorderStyle::UNDERLINE;
+ nBorderStyle = BorderStyle::kUnderline;
break;
}
}
@@ -1041,7 +1043,7 @@
crBG = fpdfdoc::CFXColorFromArray(*pArray);
}
std::ostringstream sAppStream;
- ByteString sBG = GenerateColorAP(crBG, PaintOperation::FILL);
+ ByteString sBG = GenerateColorAP(crBG, PaintOperation::kFill);
if (sBG.GetLength() > 0) {
sAppStream << "q\n"
<< sBG << rcBBox.left << " " << rcBBox.bottom << " "
@@ -1152,7 +1154,7 @@
<< " re\nW\nn\n";
}
sAppStream << "BT\n"
- << GenerateColorAP(crText, PaintOperation::FILL) << sBody
+ << GenerateColorAP(crText, PaintOperation::kFill) << sBody
<< "ET\n"
<< "Q\nEMC\n";
}
@@ -1194,14 +1196,14 @@
sAppStream << rcEdit.left << " " << rcEdit.bottom << " "
<< rcEdit.Width() << " " << rcEdit.Height() << " re\nW\nn\n";
sAppStream << "BT\n"
- << GenerateColorAP(crText, PaintOperation::FILL) << sEdit
+ << GenerateColorAP(crText, PaintOperation::kFill) << sEdit
<< "ET\n"
<< "Q\nEMC\n";
}
ByteString sButton =
GenerateColorAP(CFX_Color(CFX_Color::kRGB, 220.0f / 255.0f,
220.0f / 255.0f, 220.0f / 255.0f),
- PaintOperation::FILL);
+ PaintOperation::kFill);
if (sButton.GetLength() > 0 && !rcButton.IsEmpty()) {
sAppStream << "q\n" << sButton;
sAppStream << rcButton.left << " " << rcButton.bottom << " "
@@ -1210,7 +1212,7 @@
ByteString sButtonBorder = GenerateBorderAP(
rcButton, 2, CFX_Color(CFX_Color::kGray, 0),
CFX_Color(CFX_Color::kGray, 1), CFX_Color(CFX_Color::kGray, 0.5),
- BorderStyle::BEVELED, CPVT_Dash(3, 0, 0));
+ BorderStyle::kBeveled, CPVT_Dash(3, 0, 0));
if (sButtonBorder.GetLength() > 0)
sAppStream << "q\n" << sButtonBorder << "Q\n";
@@ -1283,19 +1285,19 @@
<< GenerateColorAP(
CFX_Color(CFX_Color::kRGB, 0, 51.0f / 255.0f,
113.0f / 255.0f),
- PaintOperation::FILL)
+ PaintOperation::kFill)
<< rcItem.left << " " << rcItem.bottom << " "
<< rcItem.Width() << " " << rcItem.Height() << " re f\n"
<< "Q\n";
sBody << "BT\n"
<< GenerateColorAP(CFX_Color(CFX_Color::kGray, 1),
- PaintOperation::FILL)
+ PaintOperation::kFill)
<< GenerateEditAP(&map, vt.GetIterator(),
CFX_PointF(0.0f, fy), true, 0)
<< "ET\n";
} else {
sBody << "BT\n"
- << GenerateColorAP(crText, PaintOperation::FILL)
+ << GenerateColorAP(crText, PaintOperation::kFill)
<< GenerateEditAP(&map, vt.GetIterator(),
CFX_PointF(0.0f, fy), true, 0)
<< "ET\n";
diff --git a/core/fxge/cfx_renderdevice.cpp b/core/fxge/cfx_renderdevice.cpp
index 49ff7ca..e37b662 100644
--- a/core/fxge/cfx_renderdevice.cpp
+++ b/core/fxge/cfx_renderdevice.cpp
@@ -1202,7 +1202,7 @@
switch (nStyle) {
default:
- case BorderStyle::SOLID: {
+ case BorderStyle::kSolid: {
CFX_PathData path;
path.AppendRect(fLeft, fBottom, fRight, fTop);
path.AppendRect(fLeft + fWidth, fBottom + fWidth, fRight - fWidth,
@@ -1211,7 +1211,7 @@
FXFILL_ALTERNATE);
break;
}
- case BorderStyle::DASH: {
+ case BorderStyle::kDash: {
CFX_GraphStateData gsd;
gsd.m_DashArray = {3.0f, 3.0f};
gsd.m_DashPhase = 0;
@@ -1232,8 +1232,8 @@
FXFILL_WINDING);
break;
}
- case BorderStyle::BEVELED:
- case BorderStyle::INSET: {
+ case BorderStyle::kBeveled:
+ case BorderStyle::kInset: {
CFX_GraphStateData gsd;
gsd.m_LineWidth = fHalfWidth;
@@ -1288,7 +1288,7 @@
FXFILL_ALTERNATE);
break;
}
- case BorderStyle::UNDERLINE: {
+ case BorderStyle::kUnderline: {
CFX_GraphStateData gsd;
gsd.m_LineWidth = fWidth;
diff --git a/core/fxge/cfx_renderdevice.h b/core/fxge/cfx_renderdevice.h
index 84c2e03..20aa16b 100644
--- a/core/fxge/cfx_renderdevice.h
+++ b/core/fxge/cfx_renderdevice.h
@@ -28,7 +28,7 @@
struct CFX_Color;
struct CFX_TextRenderOptions;
-enum class BorderStyle { SOLID, DASH, BEVELED, INSET, UNDERLINE };
+enum class BorderStyle { kSolid, kDash, kBeveled, kInset, kUnderline };
// Base class for all render devices. Derived classes must call
// SetDeviceDriver() to fully initialize the class. Until then, class methods
diff --git a/fpdfsdk/cpdfsdk_appstream.cpp b/fpdfsdk/cpdfsdk_appstream.cpp
index 0c94dc1..66e8768 100644
--- a/fpdfsdk/cpdfsdk_appstream.cpp
+++ b/fpdfsdk/cpdfsdk_appstream.cpp
@@ -434,8 +434,8 @@
CFX_FloatRect rect_by_75 = rect.GetDeflated(div, div);
switch (nStyle) {
default:
- case BorderStyle::SOLID:
- case BorderStyle::UNDERLINE: {
+ case BorderStyle::kSolid:
+ case BorderStyle::kUnderline: {
sColor = GetColorAppStream(color, false);
if (sColor.GetLength() > 0) {
AutoClosedQCommand q2(&sAppStream);
@@ -444,7 +444,7 @@
<< kStrokeOperator << "\n";
}
} break;
- case BorderStyle::DASH: {
+ case BorderStyle::kDash: {
sColor = GetColorAppStream(color, false);
if (sColor.GetLength() > 0) {
AutoClosedQCommand q2(&sAppStream);
@@ -455,7 +455,7 @@
<< kStrokeOperator << "\n";
}
} break;
- case BorderStyle::BEVELED: {
+ case BorderStyle::kBeveled: {
sColor = GetColorAppStream(color, false);
if (sColor.GetLength() > 0) {
AutoClosedQCommand q2(&sAppStream);
@@ -480,7 +480,7 @@
<< " " << kStrokeOperator << "\n";
}
} break;
- case BorderStyle::INSET: {
+ case BorderStyle::kInset: {
sColor = GetColorAppStream(color, false);
if (sColor.GetLength() > 0) {
AutoClosedQCommand q2(&sAppStream);
@@ -945,7 +945,7 @@
switch (nStyle) {
default:
- case BorderStyle::SOLID:
+ case BorderStyle::kSolid:
sColor = GetColorAppStream(color, true);
if (sColor.GetLength() > 0) {
sAppStream << sColor;
@@ -958,7 +958,7 @@
sAppStream << kFillEvenOddOperator << "\n";
}
break;
- case BorderStyle::DASH:
+ case BorderStyle::kDash:
sColor = GetColorAppStream(color, false);
if (sColor.GetLength() > 0) {
sAppStream << sColor;
@@ -977,8 +977,8 @@
<< kLineToOperator << " " << kStrokeOperator << "\n";
}
break;
- case BorderStyle::BEVELED:
- case BorderStyle::INSET:
+ case BorderStyle::kBeveled:
+ case BorderStyle::kInset:
sColor = GetColorAppStream(crLeftTop, true);
if (sColor.GetLength() > 0) {
sAppStream << sColor;
@@ -1028,7 +1028,7 @@
<< "\n";
}
break;
- case BorderStyle::UNDERLINE:
+ case BorderStyle::kUnderline:
sColor = GetColorAppStream(color, false);
if (sColor.GetLength() > 0) {
sAppStream << sColor;
@@ -1066,7 +1066,7 @@
sAppStream << GetBorderAppStreamInternal(
rcBBox, 2, CFX_Color(CFX_Color::kGray, 0),
CFX_Color(CFX_Color::kGray, 1), CFX_Color(CFX_Color::kGray, 0.5),
- BorderStyle::BEVELED, CPWL_Dash(3, 0, 0));
+ BorderStyle::kBeveled, CPWL_Dash(3, 0, 0));
}
CFX_PointF ptCenter = CFX_PointF((rcBBox.left + rcBBox.right) / 2,
@@ -1194,15 +1194,15 @@
BorderStyle nBorderStyle = widget_->GetBorderStyle();
switch (nBorderStyle) {
- case BorderStyle::DASH:
+ case BorderStyle::kDash:
dsBorder = CPWL_Dash(3, 3, 0);
break;
- case BorderStyle::BEVELED:
+ case BorderStyle::kBeveled:
fBorderWidth *= 2;
crLeftTop = CFX_Color(CFX_Color::kGray, 1);
crRightBottom = crBackground / 2.0f;
break;
- case BorderStyle::INSET:
+ case BorderStyle::kInset:
fBorderWidth *= 2;
crLeftTop = CFX_Color(CFX_Color::kGray, 0.5);
crRightBottom = CFX_Color(CFX_Color::kGray, 0.75);
@@ -1301,13 +1301,13 @@
}
switch (nBorderStyle) {
- case BorderStyle::BEVELED: {
+ case BorderStyle::kBeveled: {
CFX_Color crTemp = crLeftTop;
crLeftTop = crRightBottom;
crRightBottom = crTemp;
break;
}
- case BorderStyle::INSET: {
+ case BorderStyle::kInset: {
crLeftTop = CFX_Color(CFX_Color::kGray, 0);
crRightBottom = CFX_Color(CFX_Color::kGray, 1);
break;
@@ -1355,15 +1355,15 @@
BorderStyle nBorderStyle = widget_->GetBorderStyle();
switch (nBorderStyle) {
- case BorderStyle::DASH:
+ case BorderStyle::kDash:
dsBorder = CPWL_Dash(3, 3, 0);
break;
- case BorderStyle::BEVELED:
+ case BorderStyle::kBeveled:
fBorderWidth *= 2;
crLeftTop = CFX_Color(CFX_Color::kGray, 1);
crRightBottom = crBackground / 2.0f;
break;
- case BorderStyle::INSET:
+ case BorderStyle::kInset:
fBorderWidth *= 2;
crLeftTop = CFX_Color(CFX_Color::kGray, 0.5);
crRightBottom = CFX_Color(CFX_Color::kGray, 0.75);
@@ -1391,13 +1391,13 @@
ByteString csAP_N_OFF = csAP_N_ON;
switch (nBorderStyle) {
- case BorderStyle::BEVELED: {
+ case BorderStyle::kBeveled: {
CFX_Color crTemp = crLeftTop;
crLeftTop = crRightBottom;
crRightBottom = crTemp;
break;
}
- case BorderStyle::INSET: {
+ case BorderStyle::kInset: {
crLeftTop = CFX_Color(CFX_Color::kGray, 0);
crRightBottom = CFX_Color(CFX_Color::kGray, 1);
break;
@@ -1449,15 +1449,15 @@
CFX_Color crRightBottom;
BorderStyle nBorderStyle = widget_->GetBorderStyle();
switch (nBorderStyle) {
- case BorderStyle::DASH:
+ case BorderStyle::kDash:
dsBorder = CPWL_Dash(3, 3, 0);
break;
- case BorderStyle::BEVELED:
+ case BorderStyle::kBeveled:
fBorderWidth *= 2;
crLeftTop = CFX_Color(CFX_Color::kGray, 1);
crRightBottom = crBackground / 2.0f;
break;
- case BorderStyle::INSET:
+ case BorderStyle::kInset:
fBorderWidth *= 2;
crLeftTop = CFX_Color(CFX_Color::kGray, 0.5);
crRightBottom = CFX_Color(CFX_Color::kGray, 0.75);
@@ -1481,10 +1481,10 @@
ByteString csAP_N_ON;
CFX_FloatRect rcCenter = rcWindow.GetCenterSquare().GetDeflated(1.0f, 1.0f);
if (nStyle == CheckStyle::kCircle) {
- if (nBorderStyle == BorderStyle::BEVELED) {
+ if (nBorderStyle == BorderStyle::kBeveled) {
crLeftTop = CFX_Color(CFX_Color::kGray, 1);
crRightBottom = crBackground - 0.25f;
- } else if (nBorderStyle == BorderStyle::INSET) {
+ } else if (nBorderStyle == BorderStyle::kInset) {
crLeftTop = CFX_Color(CFX_Color::kGray, 0.5f);
crRightBottom = CFX_Color(CFX_Color::kGray, 0.75f);
}
@@ -1503,13 +1503,13 @@
ByteString csAP_N_OFF = csAP_N_ON;
switch (nBorderStyle) {
- case BorderStyle::BEVELED: {
+ case BorderStyle::kBeveled: {
CFX_Color crTemp = crLeftTop;
crLeftTop = crRightBottom;
crRightBottom = crTemp;
break;
}
- case BorderStyle::INSET: {
+ case BorderStyle::kInset: {
crLeftTop = CFX_Color(CFX_Color::kGray, 0);
crRightBottom = CFX_Color(CFX_Color::kGray, 1);
break;
@@ -1522,11 +1522,11 @@
if (nStyle == CheckStyle::kCircle) {
CFX_Color crBK = crBackground - 0.25f;
- if (nBorderStyle == BorderStyle::BEVELED) {
+ if (nBorderStyle == BorderStyle::kBeveled) {
crLeftTop = crBackground - 0.25f;
crRightBottom = CFX_Color(CFX_Color::kGray, 1);
crBK = crBackground;
- } else if (nBorderStyle == BorderStyle::INSET) {
+ } else if (nBorderStyle == BorderStyle::kInset) {
crLeftTop = CFX_Color(CFX_Color::kGray, 0);
crRightBottom = CFX_Color(CFX_Color::kGray, 1);
}
@@ -1803,7 +1803,7 @@
if (bCharArray) {
switch (widget_->GetBorderStyle()) {
- case BorderStyle::SOLID: {
+ case BorderStyle::kSolid: {
ByteString sColor =
GetColorAppStream(widget_->GetBorderPWLColor(), false);
if (sColor.GetLength() > 0) {
@@ -1826,7 +1826,7 @@
}
break;
}
- case BorderStyle::DASH: {
+ case BorderStyle::kDash: {
ByteString sColor =
GetColorAppStream(widget_->GetBorderPWLColor(), false);
if (sColor.GetLength() > 0) {
@@ -1946,15 +1946,15 @@
BorderStyle nBorderStyle = widget_->GetBorderStyle();
switch (nBorderStyle) {
- case BorderStyle::DASH:
+ case BorderStyle::kDash:
dsBorder = CPWL_Dash(3, 3, 0);
break;
- case BorderStyle::BEVELED:
+ case BorderStyle::kBeveled:
fBorderWidth *= 2;
crLeftTop = CFX_Color(CFX_Color::kGray, 1);
crRightBottom = crBackground / 2.0f;
break;
- case BorderStyle::INSET:
+ case BorderStyle::kInset:
fBorderWidth *= 2;
crLeftTop = CFX_Color(CFX_Color::kGray, 0.5);
crRightBottom = CFX_Color(CFX_Color::kGray, 0.75);
diff --git a/fpdfsdk/cpdfsdk_baannot.cpp b/fpdfsdk/cpdfsdk_baannot.cpp
index 4609f28..4133b36 100644
--- a/fpdfsdk/cpdfsdk_baannot.cpp
+++ b/fpdfsdk/cpdfsdk_baannot.cpp
@@ -142,19 +142,19 @@
const char* name = nullptr;
switch (nStyle) {
- case BorderStyle::SOLID:
+ case BorderStyle::kSolid:
name = "S";
break;
- case BorderStyle::DASH:
+ case BorderStyle::kDash:
name = "D";
break;
- case BorderStyle::BEVELED:
+ case BorderStyle::kBeveled:
name = "B";
break;
- case BorderStyle::INSET:
+ case BorderStyle::kInset:
name = "I";
break;
- case BorderStyle::UNDERLINE:
+ case BorderStyle::kUnderline:
name = "U";
break;
default:
@@ -168,15 +168,15 @@
if (pBSDict) {
ByteString sBorderStyle = pBSDict->GetStringFor("S", "S");
if (sBorderStyle == "S")
- return BorderStyle::SOLID;
+ return BorderStyle::kSolid;
if (sBorderStyle == "D")
- return BorderStyle::DASH;
+ return BorderStyle::kDash;
if (sBorderStyle == "B")
- return BorderStyle::BEVELED;
+ return BorderStyle::kBeveled;
if (sBorderStyle == "I")
- return BorderStyle::INSET;
+ return BorderStyle::kInset;
if (sBorderStyle == "U")
- return BorderStyle::UNDERLINE;
+ return BorderStyle::kUnderline;
}
const CPDF_Array* pBorder =
@@ -185,11 +185,11 @@
if (pBorder->size() >= 4) {
const CPDF_Array* pDP = pBorder->GetArrayAt(3);
if (pDP && pDP->size() > 0)
- return BorderStyle::DASH;
+ return BorderStyle::kDash;
}
}
- return BorderStyle::SOLID;
+ return BorderStyle::kSolid;
}
bool CPDFSDK_BAAnnot::IsVisible() const {
diff --git a/fpdfsdk/cpdfsdk_widget.cpp b/fpdfsdk/cpdfsdk_widget.cpp
index fd7801d..7b25d62 100644
--- a/fpdfsdk/cpdfsdk_widget.cpp
+++ b/fpdfsdk/cpdfsdk_widget.cpp
@@ -698,8 +698,8 @@
CFX_FloatRect rcWindow = GetRotatedRect();
float fBorderWidth = GetBorderWidth();
switch (GetBorderStyle()) {
- case BorderStyle::BEVELED:
- case BorderStyle::INSET:
+ case BorderStyle::kBeveled:
+ case BorderStyle::kInset:
fBorderWidth *= 2.0f;
break;
default:
diff --git a/fpdfsdk/formfiller/cffl_formfiller.cpp b/fpdfsdk/formfiller/cffl_formfiller.cpp
index 41a6447..3f095bb 100644
--- a/fpdfsdk/formfiller/cffl_formfiller.cpp
+++ b/fpdfsdk/formfiller/cffl_formfiller.cpp
@@ -313,11 +313,11 @@
cp.nBorderStyle = m_pWidget->GetBorderStyle();
switch (cp.nBorderStyle) {
- case BorderStyle::DASH:
+ case BorderStyle::kDash:
cp.sDash = CPWL_Dash(3, 3, 0);
break;
- case BorderStyle::BEVELED:
- case BorderStyle::INSET:
+ case BorderStyle::kBeveled:
+ case BorderStyle::kInset:
cp.dwBorderWidth *= 2;
break;
default:
diff --git a/fpdfsdk/pwl/cpwl_combo_box.cpp b/fpdfsdk/pwl/cpwl_combo_box.cpp
index d23a905..e364650 100644
--- a/fpdfsdk/pwl/cpwl_combo_box.cpp
+++ b/fpdfsdk/pwl/cpwl_combo_box.cpp
@@ -285,7 +285,7 @@
ecp.rcRectWnd = CFX_FloatRect();
ecp.dwBorderWidth = 0;
- ecp.nBorderStyle = BorderStyle::SOLID;
+ ecp.nBorderStyle = BorderStyle::kSolid;
auto pEdit = std::make_unique<CPWL_Edit>(ecp, CloneAttachedData());
m_pEdit = pEdit.get();
@@ -304,7 +304,7 @@
220.0f / 255.0f, 220.0f / 255.0f);
bcp.sBorderColor = PWL_DEFAULT_BLACKCOLOR;
bcp.dwBorderWidth = 2;
- bcp.nBorderStyle = BorderStyle::BEVELED;
+ bcp.nBorderStyle = BorderStyle::kBeveled;
bcp.eCursorType = FXCT_ARROW;
auto pButton = std::make_unique<CPWL_CBButton>(bcp, CloneAttachedData());
@@ -320,7 +320,7 @@
CreateParams lcp = cp;
lcp.dwFlags =
PWS_CHILD | PWS_BORDER | PWS_BACKGROUND | PLBS_HOVERSEL | PWS_VSCROLL;
- lcp.nBorderStyle = BorderStyle::SOLID;
+ lcp.nBorderStyle = BorderStyle::kSolid;
lcp.dwBorderWidth = 1;
lcp.eCursorType = FXCT_ARROW;
lcp.rcRectWnd = CFX_FloatRect();
diff --git a/fpdfsdk/pwl/cpwl_edit.cpp b/fpdfsdk/pwl/cpwl_edit.cpp
index 3d8e61d..43bcd53 100644
--- a/fpdfsdk/pwl/cpwl_edit.cpp
+++ b/fpdfsdk/pwl/cpwl_edit.cpp
@@ -164,8 +164,8 @@
const CFX_FloatRect rcClient = GetClientRect();
const BorderStyle border_style = GetBorderStyle();
const int32_t nCharArray = m_pEdit->GetCharArray();
- bool draw_border = nCharArray > 0 && (border_style == BorderStyle::SOLID ||
- border_style == BorderStyle::DASH);
+ bool draw_border = nCharArray > 0 && (border_style == BorderStyle::kSolid ||
+ border_style == BorderStyle::kDash);
if (draw_border) {
FX_SAFE_INT32 nCharArraySafe = nCharArray;
nCharArraySafe -= 1;
@@ -176,7 +176,7 @@
if (draw_border) {
CFX_GraphStateData gsd;
gsd.m_LineWidth = GetBorderWidth();
- if (border_style == BorderStyle::DASH) {
+ if (border_style == BorderStyle::kDash) {
gsd.m_DashArray = {static_cast<float>(GetBorderDash().nDash),
static_cast<float>(GetBorderDash().nGap)};
gsd.m_DashPhase = GetBorderDash().nPhase;
diff --git a/fpdfsdk/pwl/cpwl_edit_ctrl.cpp b/fpdfsdk/pwl/cpwl_edit_ctrl.cpp
index 701f4a3..e4482a1 100644
--- a/fpdfsdk/pwl/cpwl_edit_ctrl.cpp
+++ b/fpdfsdk/pwl/cpwl_edit_ctrl.cpp
@@ -82,7 +82,7 @@
CreateParams ecp = cp;
ecp.dwFlags = PWS_CHILD | PWS_NOREFRESHCLIP;
ecp.dwBorderWidth = 0;
- ecp.nBorderStyle = BorderStyle::SOLID;
+ ecp.nBorderStyle = BorderStyle::kSolid;
ecp.rcRectWnd = CFX_FloatRect();
auto pCaret = std::make_unique<CPWL_Caret>(ecp, CloneAttachedData());
diff --git a/fpdfsdk/pwl/cpwl_scroll_bar.cpp b/fpdfsdk/pwl/cpwl_scroll_bar.cpp
index 0b08bb8..1241445 100644
--- a/fpdfsdk/pwl/cpwl_scroll_bar.cpp
+++ b/fpdfsdk/pwl/cpwl_scroll_bar.cpp
@@ -533,7 +533,7 @@
void CPWL_ScrollBar::CreateButtons(const CreateParams& cp) {
CreateParams scp = cp;
scp.dwBorderWidth = 2;
- scp.nBorderStyle = BorderStyle::BEVELED;
+ scp.nBorderStyle = BorderStyle::kBeveled;
scp.dwFlags =
PWS_VISIBLE | PWS_CHILD | PWS_BORDER | PWS_BACKGROUND | PWS_NOREFRESHCLIP;
diff --git a/fpdfsdk/pwl/cpwl_wnd.cpp b/fpdfsdk/pwl/cpwl_wnd.cpp
index 28bade8..a2379f9 100644
--- a/fpdfsdk/pwl/cpwl_wnd.cpp
+++ b/fpdfsdk/pwl/cpwl_wnd.cpp
@@ -657,9 +657,9 @@
CFX_Color CPWL_Wnd::GetBorderLeftTopColor(BorderStyle nBorderStyle) const {
switch (nBorderStyle) {
- case BorderStyle::BEVELED:
+ case BorderStyle::kBeveled:
return CFX_Color(CFX_Color::kGray, 1);
- case BorderStyle::INSET:
+ case BorderStyle::kInset:
return CFX_Color(CFX_Color::kGray, 0.5f);
default:
return CFX_Color();
@@ -668,9 +668,9 @@
CFX_Color CPWL_Wnd::GetBorderRightBottomColor(BorderStyle nBorderStyle) const {
switch (nBorderStyle) {
- case BorderStyle::BEVELED:
+ case BorderStyle::kBeveled:
return GetBackgroundColor() / 2.0f;
- case BorderStyle::INSET:
+ case BorderStyle::kInset:
return CFX_Color(CFX_Color::kGray, 0.75f);
default:
return CFX_Color();
diff --git a/fpdfsdk/pwl/cpwl_wnd.h b/fpdfsdk/pwl/cpwl_wnd.h
index 3523f87..917e018 100644
--- a/fpdfsdk/pwl/cpwl_wnd.h
+++ b/fpdfsdk/pwl/cpwl_wnd.h
@@ -112,24 +112,27 @@
CreateParams(const CreateParams& other);
~CreateParams();
- CFX_FloatRect rcRectWnd; // required
- UnownedPtr<TimerHandlerIface> pTimerHandler; // required
- UnownedPtr<IPWL_SystemHandler> pSystemHandler; // required
- UnownedPtr<IPVT_FontMap> pFontMap; // required
- ObservedPtr<ProviderIface> pProvider; // required
- UnownedPtr<FocusHandlerIface> pFocusHandler; // optional
- uint32_t dwFlags = 0; // optional
- CFX_Color sBackgroundColor; // optional
- BorderStyle nBorderStyle = BorderStyle::SOLID; // optional
- int32_t dwBorderWidth = 1; // optional
- CFX_Color sBorderColor; // optional
- CFX_Color sTextColor; // optional
- int32_t nTransparency = 255; // optional
- float fFontSize; // optional
- CPWL_Dash sDash; // optional
- CPWL_MsgControl* pMsgControl = nullptr; // ignore
- int32_t eCursorType = FXCT_ARROW; // ignore
- CFX_Matrix mtChild; // ignore
+ // Required:
+ CFX_FloatRect rcRectWnd;
+ UnownedPtr<TimerHandlerIface> pTimerHandler;
+ UnownedPtr<IPWL_SystemHandler> pSystemHandler;
+ UnownedPtr<IPVT_FontMap> pFontMap;
+ ObservedPtr<ProviderIface> pProvider;
+ // Optional:
+ UnownedPtr<FocusHandlerIface> pFocusHandler;
+ uint32_t dwFlags = 0;
+ CFX_Color sBackgroundColor;
+ BorderStyle nBorderStyle = BorderStyle::kSolid;
+ int32_t dwBorderWidth = 1;
+ CFX_Color sBorderColor;
+ CFX_Color sTextColor;
+ int32_t nTransparency = 255;
+ float fFontSize;
+ CPWL_Dash sDash;
+ // Ignore:
+ CPWL_MsgControl* pMsgControl = nullptr;
+ int32_t eCursorType = FXCT_ARROW;
+ CFX_Matrix mtChild;
};
static bool IsSHIFTKeyDown(uint32_t nFlag);
diff --git a/fxjs/cjs_field.cpp b/fxjs/cjs_field.cpp
index 0ae6e48..8830dff 100644
--- a/fxjs/cjs_field.cpp
+++ b/fxjs/cjs_field.cpp
@@ -220,17 +220,17 @@
const ByteString& string) {
ASSERT(pFormFillEnv);
- BorderStyle nBorderStyle = BorderStyle::SOLID;
+ BorderStyle nBorderStyle = BorderStyle::kSolid;
if (string == "solid")
- nBorderStyle = BorderStyle::SOLID;
+ nBorderStyle = BorderStyle::kSolid;
else if (string == "beveled")
- nBorderStyle = BorderStyle::BEVELED;
+ nBorderStyle = BorderStyle::kBeveled;
else if (string == "dashed")
- nBorderStyle = BorderStyle::DASH;
+ nBorderStyle = BorderStyle::kDash;
else if (string == "inset")
- nBorderStyle = BorderStyle::INSET;
+ nBorderStyle = BorderStyle::kInset;
else if (string == "underline")
- nBorderStyle = BorderStyle::UNDERLINE;
+ nBorderStyle = BorderStyle::kUnderline;
else
return;
@@ -703,15 +703,15 @@
return CJS_Result::Failure(JSMessage::kBadObjectError);
switch (pWidget->GetBorderStyle()) {
- case BorderStyle::SOLID:
+ case BorderStyle::kSolid:
return CJS_Result::Success(pRuntime->NewString("solid"));
- case BorderStyle::DASH:
+ case BorderStyle::kDash:
return CJS_Result::Success(pRuntime->NewString("dashed"));
- case BorderStyle::BEVELED:
+ case BorderStyle::kBeveled:
return CJS_Result::Success(pRuntime->NewString("beveled"));
- case BorderStyle::INSET:
+ case BorderStyle::kInset:
return CJS_Result::Success(pRuntime->NewString("inset"));
- case BorderStyle::UNDERLINE:
+ case BorderStyle::kUnderline:
return CJS_Result::Success(pRuntime->NewString("underline"));
}
return CJS_Result::Success(pRuntime->NewString(""));