diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-07-22 15:04:26 -0700 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-07-22 15:04:26 -0700 |
commit | 4eb4d7f6c707cc2c23c806aa540d055c8832b55d (patch) | |
tree | 43b7a7fac7b4ce08c287bfc03d09e5e1201e20d0 /core/src/fxge/win32/fx_win32_print.cpp | |
parent | 7cc97521db1e52d5927f5605de5f9a7102f8af40 (diff) | |
download | pdfium-4eb4d7f6c707cc2c23c806aa540d055c8832b55d.tar.xz |
Revert "Fix else-after-returns throughout pdfium."
This reverts commit 7cc97521db1e52d5927f5605de5f9a7102f8af40.
Diffstat (limited to 'core/src/fxge/win32/fx_win32_print.cpp')
-rw-r--r-- | core/src/fxge/win32/fx_win32_print.cpp | 42 |
1 files changed, 22 insertions, 20 deletions
diff --git a/core/src/fxge/win32/fx_win32_print.cpp b/core/src/fxge/win32/fx_win32_print.cpp index 86dbf9bb0a..199ab78d9f 100644 --- a/core/src/fxge/win32/fx_win32_print.cpp +++ b/core/src/fxge/win32/fx_win32_print.cpp @@ -80,31 +80,33 @@ FX_BOOL CGdiPrinterDriver::StretchDIBits(const CFX_DIBSource* pSource, FX_DWORD return FALSE; } return GDI_StretchBitMask(pBitmap, dest_left, dest_top, dest_width, dest_height, color, flags, alpha_flag, pIccTransform); - } - if (pSource->HasAlpha()) { - return FALSE; - } - if (dest_width < 0 || dest_height < 0) { - CFX_DIBitmap* pFlipped = pSource->FlipImage(dest_width < 0, dest_height < 0); - if (pFlipped == NULL) { + } else { + ASSERT(pSource != NULL); + if (pSource->HasAlpha()) { return FALSE; } - if (dest_width < 0) { - dest_left += dest_width; + if (dest_width < 0 || dest_height < 0) { + CFX_DIBitmap* pFlipped = pSource->FlipImage(dest_width < 0, dest_height < 0); + if (pFlipped == NULL) { + return FALSE; + } + if (dest_width < 0) { + dest_left += dest_width; + } + if (dest_height < 0) { + dest_top += dest_height; + } + FX_BOOL ret = GDI_StretchDIBits(pFlipped, dest_left, dest_top, abs(dest_width), abs(dest_height), flags, pIccTransform); + delete pFlipped; + return ret; } - if (dest_height < 0) { - dest_top += dest_height; + CFX_DIBExtractor temp(pSource); + CFX_DIBitmap* pBitmap = temp; + if (pBitmap == NULL) { + return FALSE; } - FX_BOOL ret = GDI_StretchDIBits(pFlipped, dest_left, dest_top, abs(dest_width), abs(dest_height), flags, pIccTransform); - delete pFlipped; - return ret; - } - CFX_DIBExtractor temp(pSource); - CFX_DIBitmap* pBitmap = temp; - if (pBitmap == NULL) { - return FALSE; + return GDI_StretchDIBits(pBitmap, dest_left, dest_top, dest_width, dest_height, flags, pIccTransform); } - return GDI_StretchDIBits(pBitmap, dest_left, dest_top, dest_width, dest_height, flags, pIccTransform); } static CFX_DIBitmap* Transform1bppBitmap(const CFX_DIBSource* pSrc, const CFX_AffineMatrix* pDestMatrix) { |