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

Unified Diff: fpdfsdk/pdfwindow/PWL_Edit.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/pdfwindow/PWL_Edit.cpp
diff --git a/fpdfsdk/pdfwindow/PWL_Edit.cpp b/fpdfsdk/pdfwindow/PWL_Edit.cpp
index ae95570d6c9e6a9e5a7b3a9b96dddfe87f092120..e39b6c13c702f6e126afb7fc59144902b9ba87de 100644
--- a/fpdfsdk/pdfwindow/PWL_Edit.cpp
+++ b/fpdfsdk/pdfwindow/PWL_Edit.cpp
@@ -199,7 +199,7 @@ void CPWL_Edit::GetThisAppearanceStream(CFX_ByteTextBuf& sAppStream) {
if (nCharArray > 0) {
switch (GetBorderStyle()) {
- case PBS_SOLID: {
+ case BorderStyle::SOLID: {
sLine << "q\n" << GetBorderWidth() << " w\n"
<< CPWL_Utils::GetColorAppStream(GetBorderColor(), FALSE)
.AsStringC()
@@ -215,8 +215,9 @@ void CPWL_Edit::GetThisAppearanceStream(CFX_ByteTextBuf& sAppStream) {
}
sLine << "Q\n";
- } break;
- case PBS_DASH: {
+ break;
+ }
+ case BorderStyle::DASH: {
sLine << "q\n" << GetBorderWidth() << " w\n"
<< CPWL_Utils::GetColorAppStream(GetBorderColor(), FALSE)
.AsStringC()
@@ -234,7 +235,10 @@ void CPWL_Edit::GetThisAppearanceStream(CFX_ByteTextBuf& sAppStream) {
}
sLine << "Q\n";
- } break;
+ break;
+ }
+ default:
+ break;
}
}
@@ -318,7 +322,7 @@ void CPWL_Edit::DrawThisAppearance(CFX_RenderDevice* pDevice,
if (nCharArray > 0 && nCharArraySafe.IsValid()) {
switch (GetBorderStyle()) {
- case PBS_SOLID: {
+ case BorderStyle::SOLID: {
CFX_GraphStateData gsd;
gsd.m_LineWidth = (FX_FLOAT)GetBorderWidth();
@@ -337,13 +341,15 @@ void CPWL_Edit::DrawThisAppearance(CFX_RenderDevice* pDevice,
((rcClient.right - rcClient.left) / nCharArray) * (i + 1),
rcClient.top, FXPT_LINETO);
}
- if (path.GetPointCount() > 0)
+ if (path.GetPointCount() > 0) {
pDevice->DrawPath(
&path, pUser2Device, &gsd, 0,
CPWL_Utils::PWLColorToFXColor(GetBorderColor(), 255),
FXFILL_ALTERNATE);
- } break;
- case PBS_DASH: {
+ }
+ break;
+ }
+ case BorderStyle::DASH: {
CFX_GraphStateData gsd;
gsd.m_LineWidth = (FX_FLOAT)GetBorderWidth();
@@ -367,12 +373,16 @@ void CPWL_Edit::DrawThisAppearance(CFX_RenderDevice* pDevice,
((rcClient.right - rcClient.left) / nCharArray) * (i + 1),
rcClient.top, FXPT_LINETO);
}
- if (path.GetPointCount() > 0)
+ if (path.GetPointCount() > 0) {
pDevice->DrawPath(
&path, pUser2Device, &gsd, 0,
CPWL_Utils::PWLColorToFXColor(GetBorderColor(), 255),
FXFILL_ALTERNATE);
- } break;
+ }
+ break;
+ }
+ default:
+ break;
}
}

Powered by Google App Engine
This is Rietveld 408576698