summaryrefslogtreecommitdiff
path: root/core/src/fpdfapi/fpdf_render
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-07-22 14:59:55 -0700
committerTom Sepez <tsepez@chromium.org>2015-07-22 14:59:55 -0700
commit7cc97521db1e52d5927f5605de5f9a7102f8af40 (patch)
treedf96cf98cd470e794c7817f347511f3c554c96e4 /core/src/fpdfapi/fpdf_render
parentb05f1fd710496dea44b001bb905fa1c16a39bb28 (diff)
downloadpdfium-7cc97521db1e52d5927f5605de5f9a7102f8af40.tar.xz
Fix else-after-returns throughout pdfium.
Driven by CS search for pcre:yes file:third_party/pdfium/ -file:pdfium/third_party/ \breturn\b[^;]*;\s*\n*\s*\}*\s*\n*\r*else Note: Care is required to ensure the preceding block is not an else-if. As usual, removed any tabs I saw. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1243883003 .
Diffstat (limited to 'core/src/fpdfapi/fpdf_render')
-rw-r--r--core/src/fpdfapi/fpdf_render/fpdf_render.cpp6
-rw-r--r--core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp10
-rw-r--r--core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp18
3 files changed, 22 insertions, 12 deletions
diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render.cpp
index 12f60632fc..f8b59913e4 100644
--- a/core/src/fpdfapi/fpdf_render/fpdf_render.cpp
+++ b/core/src/fpdfapi/fpdf_render/fpdf_render.cpp
@@ -551,7 +551,8 @@ FX_ARGB CPDF_RenderStatus::GetFillArgb(const CPDF_PageObject* pObj, FX_BOOL bTyp
CPDF_ColorStateData* pColorData = (CPDF_ColorStateData*)(const CPDF_ColorStateData*)pObj->m_ColorState;
if (m_pType3Char && !bType3 && (!m_pType3Char->m_bColored || (m_pType3Char->m_bColored && (!pColorData || pColorData->m_FillColor.IsNull())))) {
return m_T3FillColor;
- } else if (!pColorData || pColorData->m_FillColor.IsNull()) {
+ }
+ if (!pColorData || pColorData->m_FillColor.IsNull()) {
pColorData = (CPDF_ColorStateData*)(const CPDF_ColorStateData*)m_InitialStates.m_ColorState;
}
FX_COLORREF rgb = pColorData->m_FillRGB;
@@ -580,7 +581,8 @@ FX_ARGB CPDF_RenderStatus::GetStrokeArgb(const CPDF_PageObject* pObj) const
CPDF_ColorStateData* pColorData = (CPDF_ColorStateData*)(const CPDF_ColorStateData*)pObj->m_ColorState;
if (m_pType3Char && (!m_pType3Char->m_bColored || (m_pType3Char->m_bColored && (!pColorData || pColorData->m_StrokeColor.IsNull())))) {
return m_T3FillColor;
- } else if (!pColorData || pColorData->m_StrokeColor.IsNull()) {
+ }
+ if (!pColorData || pColorData->m_StrokeColor.IsNull()) {
pColorData = (CPDF_ColorStateData*)(const CPDF_ColorStateData*)m_InitialStates.m_ColorState;
}
FX_COLORREF rgb = pColorData->m_StrokeRGB;
diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp
index 0730206e23..fa9325a4d2 100644
--- a/core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp
+++ b/core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp
@@ -761,7 +761,8 @@ FX_BOOL CPDF_ImageRenderer::Continue(IFX_Pause* pPause)
m_pRenderStatus->m_pDevice->SetDIBits(m_pQuickStretcher->m_pBitmap, m_pQuickStretcher->m_ResultLeft,
m_pQuickStretcher->m_ResultTop, m_BlendType);
return FALSE;
- } else if (m_Status == 2) {
+ }
+ if (m_Status == 2) {
if (m_pTransformer->Continue(pPause)) {
return TRUE;
}
@@ -784,16 +785,17 @@ FX_BOOL CPDF_ImageRenderer::Continue(IFX_Pause* pPause)
}
delete pBitmap;
return FALSE;
- } else if (m_Status == 3) {
+ }
+ if (m_Status == 3) {
return m_pRenderStatus->m_pDevice->ContinueDIBits(m_DeviceHandle, pPause);
- } else if (m_Status == 4) {
+ }
+ if (m_Status == 4) {
if (m_Loader.Continue(m_LoadHandle, pPause)) {
return TRUE;
}
if (StartRenderDIBSource()) {
return Continue(pPause);
}
- return FALSE;
}
return FALSE;
}
diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp
index ce29baf738..7d17e78e24 100644
--- a/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp
+++ b/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp
@@ -21,13 +21,17 @@ unsigned int _GetBits8(const uint8_t* pData, int bitpos, int nbits)
unsigned int byte = pData[bitpos / 8];
if (nbits == 8) {
return byte;
- } else if (nbits == 4) {
+ }
+ if (nbits == 4) {
return (bitpos % 8) ? (byte & 0x0f) : (byte >> 4);
- } else if (nbits == 2) {
+ }
+ if (nbits == 2) {
return (byte >> (6 - bitpos % 8)) & 0x03;
- } else if (nbits == 1) {
+ }
+ if (nbits == 1) {
return (byte >> (7 - bitpos % 8)) & 0x01;
- } else if (nbits == 16) {
+ }
+ if (nbits == 16) {
return byte * 256 + pData[bitpos / 8 + 1];
}
return 0;
@@ -462,7 +466,8 @@ int CPDF_DIBSource::ContinueLoadDIBSource(IFX_Pause* pPause)
m_pColorSpace->EnableStdConversion(FALSE);
}
return ret1;
- } else if (m_Status == 2) {
+ }
+ if (m_Status == 2) {
return ContinueLoadMaskDIB(pPause);
}
return 0;
@@ -1008,7 +1013,8 @@ void CPDF_DIBSource::TranslateScanline24bpp(uint8_t* dest_scan, const uint8_t* s
break;
}
return;
- } else if (m_bpc == 8) {
+ }
+ if (m_bpc == 8) {
if (m_nComponents == m_pColorSpace->CountComponents())
m_pColorSpace->TranslateImageLine(dest_scan, src_scan, m_Width, m_Width, m_Height,
m_bLoadMask && m_GroupFamily == PDFCS_DEVICECMYK && m_Family == PDFCS_DEVICECMYK);