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_Wnd.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_Wnd.cpp')
-rw-r--r-- | fpdfsdk/pdfwindow/PWL_Wnd.cpp | 52 |
1 files changed, 16 insertions, 36 deletions
diff --git a/fpdfsdk/pdfwindow/PWL_Wnd.cpp b/fpdfsdk/pdfwindow/PWL_Wnd.cpp index bb424ffa43..310f2f3f90 100644 --- a/fpdfsdk/pdfwindow/PWL_Wnd.cpp +++ b/fpdfsdk/pdfwindow/PWL_Wnd.cpp @@ -585,11 +585,11 @@ CPWL_Color CPWL_Wnd::GetTextStrokeColor() const { return m_sPrivateParam.sTextStrokeColor; } -int32_t CPWL_Wnd::GetBorderStyle() const { +BorderStyle CPWL_Wnd::GetBorderStyle() const { return m_sPrivateParam.nBorderStyle; } -void CPWL_Wnd::SetBorderStyle(int32_t nBorderStyle) { +void CPWL_Wnd::SetBorderStyle(BorderStyle nBorderStyle) { if (HasFlag(PWS_BORDER)) m_sPrivateParam.nBorderStyle = nBorderStyle; } @@ -819,46 +819,26 @@ IPVT_FontMap* CPWL_Wnd::GetFontMap() const { return m_sPrivateParam.pFontMap; } -CPWL_Color CPWL_Wnd::GetBorderLeftTopColor(int32_t nBorderStyle) const { - CPWL_Color color; - +CPWL_Color CPWL_Wnd::GetBorderLeftTopColor(BorderStyle nBorderStyle) const { switch (nBorderStyle) { - case PBS_SOLID: - break; - case PBS_DASH: - break; - case PBS_BEVELED: - color = CPWL_Color(COLORTYPE_GRAY, 1); - break; - case PBS_INSET: - color = CPWL_Color(COLORTYPE_GRAY, 0.5f); - break; - case PBS_UNDERLINED: - break; + case BorderStyle::BEVELED: + return CPWL_Color(COLORTYPE_GRAY, 1); + case BorderStyle::INSET: + return CPWL_Color(COLORTYPE_GRAY, 0.5f); + default: + return CPWL_Color(); } - - return color; } -CPWL_Color CPWL_Wnd::GetBorderRightBottomColor(int32_t nBorderStyle) const { - CPWL_Color color; - +CPWL_Color CPWL_Wnd::GetBorderRightBottomColor(BorderStyle nBorderStyle) const { switch (nBorderStyle) { - case PBS_SOLID: - break; - case PBS_DASH: - break; - case PBS_BEVELED: - color = CPWL_Utils::DevideColor(GetBackgroundColor(), 2); - break; - case PBS_INSET: - color = CPWL_Color(COLORTYPE_GRAY, 0.75f); - break; - case PBS_UNDERLINED: - break; + case BorderStyle::BEVELED: + return CPWL_Utils::DevideColor(GetBackgroundColor(), 2); + case BorderStyle::INSET: + return CPWL_Color(COLORTYPE_GRAY, 0.75f); + default: + return CPWL_Color(); } - - return color; } int32_t CPWL_Wnd::GetTransparency() { |