summaryrefslogtreecommitdiff
path: root/xfa/fxfa/cxfa_ffwidget.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-11-21 21:52:50 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-11-21 21:52:50 +0000
commit64e16079bb87085fdff5d6268267fd01eacbc5d9 (patch)
tree0c13b2e9fb686dc18cdf49f4091e22f089eea65c /xfa/fxfa/cxfa_ffwidget.cpp
parentf9958ed00c5f288d95ab4c6c1d90fc639d5c0f8d (diff)
downloadpdfium-64e16079bb87085fdff5d6268267fd01eacbc5d9.tar.xz
Cleanup CXFA_ImageData
This CL removes the second constructor parameter which is always true and removes all related conditionals. The methods have been changed to const and return instead of using out parameters. Change-Id: Id6d2aa533a212e961e3b8169eef57b7e868d503e Reviewed-on: https://pdfium-review.googlesource.com/19010 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Diffstat (limited to 'xfa/fxfa/cxfa_ffwidget.cpp')
-rw-r--r--xfa/fxfa/cxfa_ffwidget.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/xfa/fxfa/cxfa_ffwidget.cpp b/xfa/fxfa/cxfa_ffwidget.cpp
index a593ff45a2..c66d705623 100644
--- a/xfa/fxfa/cxfa_ffwidget.cpp
+++ b/xfa/fxfa/cxfa_ffwidget.cpp
@@ -1674,7 +1674,7 @@ void XFA_DrawImage(CXFA_Graphics* pGS,
const CFX_RectF& rtImage,
const CFX_Matrix& matrix,
const RetainPtr<CFX_DIBitmap>& pDIBitmap,
- int32_t iAspect,
+ XFA_ATTRIBUTEENUM iAspect,
int32_t iImageXDpi,
int32_t iImageYDpi,
int32_t iHorzAlign,
@@ -1695,14 +1695,14 @@ void XFA_DrawImage(CXFA_Graphics* pGS,
f1 = std::min(f1, f2);
rtFit.height = rtFit.height * f1;
rtFit.width = rtFit.width * f1;
- } break;
- case XFA_ATTRIBUTEENUM_Actual:
break;
+ }
case XFA_ATTRIBUTEENUM_Height: {
float f1 = rtImage.height / rtFit.height;
rtFit.height = rtImage.height;
rtFit.width = f1 * rtFit.width;
- } break;
+ break;
+ }
case XFA_ATTRIBUTEENUM_None:
rtFit.height = rtImage.height;
rtFit.width = rtImage.width;
@@ -1711,7 +1711,11 @@ void XFA_DrawImage(CXFA_Graphics* pGS,
float f1 = rtImage.width / rtFit.width;
rtFit.width = rtImage.width;
rtFit.height = rtFit.height * f1;
- } break;
+ break;
+ }
+ case XFA_ATTRIBUTEENUM_Actual:
+ default:
+ break;
}
if (iHorzAlign == XFA_ATTRIBUTEENUM_Center) {
rtFit.left += (rtImage.width - rtFit.width) / 2;
@@ -1879,16 +1883,12 @@ RetainPtr<CFX_DIBitmap> XFA_LoadImageData(CXFA_FFDoc* pDoc,
bool& bNameImage,
int32_t& iImageXDpi,
int32_t& iImageYDpi) {
- WideString wsHref;
- WideString wsImage;
- pImageData->GetHref(wsHref);
- pImageData->GetContent(wsImage);
+ WideString wsHref = pImageData->GetHref();
+ WideString wsImage = pImageData->GetContent();
if (wsHref.IsEmpty() && wsImage.IsEmpty())
return nullptr;
- WideString wsContentType;
- pImageData->GetContentType(wsContentType);
- FXCODEC_IMAGE_TYPE type = XFA_GetImageType(wsContentType);
+ FXCODEC_IMAGE_TYPE type = XFA_GetImageType(pImageData->GetContentType());
ByteString bsContent;
uint8_t* pImageBuffer = nullptr;
RetainPtr<IFX_SeekableReadStream> pImageFileRead;