summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordan sinclair <dsinclair@chromium.org>2015-10-15 19:26:15 -0400
committerdan sinclair <dsinclair@chromium.org>2015-10-15 19:26:15 -0400
commitb456ba7f62fa416f456ef78750c18fd2bdf837be (patch)
tree727c19b21c17603a5f07fb6a7188b556993b8d65
parent313cf59d5cd5c314fea904019923d97bfc9f315c (diff)
downloadpdfium-b456ba7f62fa416f456ef78750c18fd2bdf837be.tar.xz
Return result of GetRBG instead of TRUE
Propagate the return value of GetRBG to the callers instead of forcing the return of TRUE. BUG=pdfium:44 R=thestig@chromium.org, tsepez@chromium.org Review URL: https://codereview.chromium.org/1398633008 .
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp17
1 files changed, 6 insertions, 11 deletions
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp
index a3fef3df82..3f0de2d416 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp
@@ -762,10 +762,9 @@ FX_BOOL CPDF_ICCBasedCS::GetRGB(FX_FLOAT* pBuf,
ICodec_IccModule* pIccModule = CPDF_ModuleMgr::Get()->GetIccModule();
if (m_pProfile->m_pTransform == NULL || pIccModule == NULL) {
if (m_pAlterCS) {
- m_pAlterCS->GetRGB(pBuf, R, G, B);
- } else {
- R = G = B = 0.0f;
+ return m_pAlterCS->GetRGB(pBuf, R, G, B);
}
+ R = G = B = 0.0f;
return TRUE;
}
FX_FLOAT rgb[3];
@@ -944,8 +943,7 @@ FX_BOOL CPDF_IndexedCS::GetRGB(FX_FLOAT* pBuf,
m_pCompMinMax[i * 2] +
m_pCompMinMax[i * 2 + 1] * pTable[index * m_nBaseComponents + i] / 255;
}
- m_pBaseCS->GetRGB(comps, R, G, B);
- return TRUE;
+ return m_pBaseCS->GetRGB(comps, R, G, B);
}
CPDF_ColorSpace* CPDF_IndexedCS::GetBaseCS() const {
return m_pBaseCS;
@@ -1084,8 +1082,7 @@ FX_BOOL CPDF_SeparationCS::GetRGB(FX_FLOAT* pBuf,
for (int i = 0; i < nComps; i++) {
results[i] = *pBuf;
}
- m_pAltCS->GetRGB(results, R, G, B);
- return TRUE;
+ return m_pAltCS->GetRGB(results, R, G, B);
}
CFX_FixedBufGrow<FX_FLOAT, 16> results(m_pFunc->CountOutputs());
int nresults = 0;
@@ -1094,8 +1091,7 @@ FX_BOOL CPDF_SeparationCS::GetRGB(FX_FLOAT* pBuf,
return FALSE;
}
if (m_pAltCS) {
- m_pAltCS->GetRGB(results, R, G, B);
- return TRUE;
+ return m_pAltCS->GetRGB(results, R, G, B);
}
R = G = B = 0;
return FALSE;
@@ -1177,8 +1173,7 @@ FX_BOOL CPDF_DeviceNCS::GetRGB(FX_FLOAT* pBuf,
if (nresults == 0) {
return FALSE;
}
- m_pAltCS->GetRGB(results, R, G, B);
- return TRUE;
+ return m_pAltCS->GetRGB(results, R, G, B);
}
void CPDF_DeviceNCS::EnableStdConversion(FX_BOOL bEnabled) {
CPDF_ColorSpace::EnableStdConversion(bEnabled);