diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-11-21 21:59:45 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-11-21 21:59:45 +0000 |
commit | 96d6f741b3c106ba0e48a05692910f64cf1e5e09 (patch) | |
tree | 07fc97f427a308bffd995ae9a77aa2dbac9972eb /xfa/fxfa/cxfa_ffwidget.cpp | |
parent | b06d3f8d7658eeab6624f66aef690a7f4b44936e (diff) | |
download | pdfium-96d6f741b3c106ba0e48a05692910f64cf1e5e09.tar.xz |
Cleanup CXFA_ParaData
This CL fixes the return types and makes the CXFA_ParaData methods
const.
Change-Id: Ifb63b46e826d9741682d992d7fc1ee37c772fb41
Reviewed-on: https://pdfium-review.googlesource.com/19070
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/cxfa_ffwidget.cpp')
-rw-r--r-- | xfa/fxfa/cxfa_ffwidget.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/xfa/fxfa/cxfa_ffwidget.cpp b/xfa/fxfa/cxfa_ffwidget.cpp index c66d705623..a5d19f05ac 100644 --- a/xfa/fxfa/cxfa_ffwidget.cpp +++ b/xfa/fxfa/cxfa_ffwidget.cpp @@ -1677,8 +1677,8 @@ void XFA_DrawImage(CXFA_Graphics* pGS, XFA_ATTRIBUTEENUM iAspect, int32_t iImageXDpi, int32_t iImageYDpi, - int32_t iHorzAlign, - int32_t iVertAlign) { + XFA_ATTRIBUTEENUM iHorzAlign, + XFA_ATTRIBUTEENUM iVertAlign) { if (rtImage.IsEmpty()) return; if (!pDIBitmap || !pDIBitmap->GetBuffer()) @@ -1717,16 +1717,17 @@ void XFA_DrawImage(CXFA_Graphics* pGS, default: break; } - if (iHorzAlign == XFA_ATTRIBUTEENUM_Center) { + + if (iHorzAlign == XFA_ATTRIBUTEENUM_Center) rtFit.left += (rtImage.width - rtFit.width) / 2; - } else if (iHorzAlign == XFA_ATTRIBUTEENUM_Right) { + else if (iHorzAlign == XFA_ATTRIBUTEENUM_Right) rtFit.left = rtImage.right() - rtFit.width; - } - if (iVertAlign == XFA_ATTRIBUTEENUM_Middle) { + + if (iVertAlign == XFA_ATTRIBUTEENUM_Middle) rtFit.top += (rtImage.height - rtFit.height) / 2; - } else if (iVertAlign == XFA_ATTRIBUTEENUM_Bottom) { + else if (iVertAlign == XFA_ATTRIBUTEENUM_Bottom) rtFit.top = rtImage.bottom() - rtImage.height; - } + CFX_RenderDevice* pRenderDevice = pGS->GetRenderDevice(); CFX_RenderDevice::StateRestorer restorer(pRenderDevice); CFX_PathData path; |