diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-07-23 14:42:09 -0700 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-07-23 14:42:09 -0700 |
commit | 2f2ffece124e4ed4b96d2846263015d4b5ad6c00 (patch) | |
tree | 6966e44279e8d9e1516b7c71219cf66f77a89ca2 /core/src/fxge/win32/fx_win32_print.cpp | |
parent | d07958fd2d1c4134d865f4ccb056eb925aaa7d2a (diff) | |
download | pdfium-2f2ffece124e4ed4b96d2846263015d4b5ad6c00.tar.xz |
Merge to XFA - else after returns.
(cherry picked from commit 3c012fef2bb72c8ec1faa73e11ee35539b2559d6)
Original Review URL: https://codereview.chromium.org/1243953004 .
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1239313005 .
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, 20 insertions, 22 deletions
diff --git a/core/src/fxge/win32/fx_win32_print.cpp b/core/src/fxge/win32/fx_win32_print.cpp index 163ee84a0a..2be8a30ecb 100644 --- a/core/src/fxge/win32/fx_win32_print.cpp +++ b/core/src/fxge/win32/fx_win32_print.cpp @@ -80,33 +80,31 @@ 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); - } else { - ASSERT(pSource != NULL); - if (pSource->HasAlpha()) { + } + 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) { return FALSE; } - 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_width < 0) { + dest_left += dest_width; } - CFX_DIBExtractor temp(pSource); - CFX_DIBitmap* pBitmap = temp; - if (pBitmap == NULL) { - return FALSE; + if (dest_height < 0) { + dest_top += dest_height; } - return GDI_StretchDIBits(pBitmap, dest_left, dest_top, dest_width, dest_height, flags, pIccTransform); + 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); } static CFX_DIBitmap* Transform1bppBitmap(const CFX_DIBSource* pSrc, const CFX_AffineMatrix* pDestMatrix) { |