summaryrefslogtreecommitdiff
path: root/core/fpdfapi/fpdf_page/cpdf_colorstate.cpp
diff options
context:
space:
mode:
authorthestig <thestig@chromium.org>2016-05-11 12:59:16 -0700
committerCommit bot <commit-bot@chromium.org>2016-05-11 12:59:17 -0700
commita244dfe2ba2cc82ee264475253cc16222e022524 (patch)
tree3a69928e3c60c5c6f91813aa07518b1af481754b /core/fpdfapi/fpdf_page/cpdf_colorstate.cpp
parent35c2100a5f6a466635bf99b4e7117d23aeb54d2c (diff)
downloadpdfium-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.cpp4
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;