Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(133)

Unified Diff: core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp

Issue 1243953004: Re-land else-after-returns (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp ('k') | core/src/fpdfdoc/doc_action.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp
diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp
index ce29baf738f8b5e3702132cd3882303a6334bb24..7d17e78e2457ed5e19565cda2de00797947ce92a 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);
« no previous file with comments | « core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp ('k') | core/src/fpdfdoc/doc_action.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698