diff options
author | dsinclair <dsinclair@chromium.org> | 2016-05-16 11:38:28 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-05-16 11:38:28 -0700 |
commit | 92cb5e580cecf0412b74d51e8863ed557e2bd47a (patch) | |
tree | acdc33aa1bd876742ae62bd5901183413b2ead1b /fpdfsdk/pdfwindow/PWL_Edit.cpp | |
parent | 719a7a71d4cf1b714ad7f76e5f9ca28cfd5b74d3 (diff) | |
download | pdfium-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/pdfwindow/PWL_Edit.cpp')
-rw-r--r-- | fpdfsdk/pdfwindow/PWL_Edit.cpp | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/fpdfsdk/pdfwindow/PWL_Edit.cpp b/fpdfsdk/pdfwindow/PWL_Edit.cpp index ae95570d6c..e39b6c13c7 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; } } |