diff options
author | thestig <thestig@chromium.org> | 2016-05-11 12:59:16 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-05-11 12:59:17 -0700 |
commit | a244dfe2ba2cc82ee264475253cc16222e022524 (patch) | |
tree | 3a69928e3c60c5c6f91813aa07518b1af481754b /core/fpdfapi/fpdf_page/cpdf_colorstate.cpp | |
parent | 35c2100a5f6a466635bf99b4e7117d23aeb54d2c (diff) | |
download | pdfium-a244dfe2ba2cc82ee264475253cc16222e022524.tar.xz |
Clean up CPDF_Color and some related code.
- Remove dead code in CPDF_Color.
- Encapsulate member variables.
- Added accessors as need.
- Remove unused CPDF_ColorSpace::GetMaxIndex().
- Remove redundent CPDF_StreamContentParser::GetNumber16().
Review-Url: https://codereview.chromium.org/1965243002
Diffstat (limited to 'core/fpdfapi/fpdf_page/cpdf_colorstate.cpp')
-rw-r--r-- | core/fpdfapi/fpdf_page/cpdf_colorstate.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/fpdfapi/fpdf_page/cpdf_colorstate.cpp b/core/fpdfapi/fpdf_page/cpdf_colorstate.cpp index 88e9f561c3..1d422cb061 100644 --- a/core/fpdfapi/fpdf_page/cpdf_colorstate.cpp +++ b/core/fpdfapi/fpdf_page/cpdf_colorstate.cpp @@ -34,9 +34,9 @@ void CPDF_ColorState::SetColor(CPDF_Color& color, } else if (color.IsNull()) { color.SetColorSpace(CPDF_ColorSpace::GetStockCS(PDFCS_DEVICEGRAY)); } - if (color.m_pCS->CountComponents() > nValues) { + if (color.GetColorSpace()->CountComponents() > nValues) return; - } + color.SetValue(pValue); int R, G, B; rgb = color.GetRGB(R, G, B) ? FXSYS_RGB(R, G, B) : (uint32_t)-1; |