From b456ba7f62fa416f456ef78750c18fd2bdf837be Mon Sep 17 00:00:00 2001 From: dan sinclair Date: Thu, 15 Oct 2015 19:26:15 -0400 Subject: 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 . --- core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp') 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 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); -- cgit v1.2.3