From d3b0f7cc78e6a143e00e5eb653b3e7c918054426 Mon Sep 17 00:00:00 2001 From: Henrique Nakashima Date: Wed, 2 May 2018 15:31:32 +0000 Subject: Remove int out params from reference to pointer in CXFA_Node. Return a CFX_Size instead. Change-Id: I3bef1093fbc887237aa69dc942f878af27b4e8e9 Reviewed-on: https://pdfium-review.googlesource.com/31911 Commit-Queue: Henrique Nakashima Reviewed-by: Ryan Harrison Reviewed-by: Lei Zhang --- xfa/fxfa/parser/cxfa_node.cpp | 29 +++++++++-------------------- 1 file changed, 9 insertions(+), 20 deletions(-) (limited to 'xfa/fxfa/parser/cxfa_node.cpp') diff --git a/xfa/fxfa/parser/cxfa_node.cpp b/xfa/fxfa/parser/cxfa_node.cpp index c83c118e73..c3fbf62eb7 100644 --- a/xfa/fxfa/parser/cxfa_node.cpp +++ b/xfa/fxfa/parser/cxfa_node.cpp @@ -2907,10 +2907,9 @@ bool CXFA_Node::CalculatePushButtonAutoSize(CXFA_FFDoc* doc, CFX_SizeF* pSize) { CFX_SizeF CXFA_Node::CalculateImageSize(float img_width, float img_height, - float dpi_x, - float dpi_y) { - CFX_RectF rtImage(0, 0, XFA_UnitPx2Pt(img_width, dpi_x), - XFA_UnitPx2Pt(img_height, dpi_y)); + const CFX_Size& dpi) { + CFX_RectF rtImage(0, 0, XFA_UnitPx2Pt(img_width, dpi.width), + XFA_UnitPx2Pt(img_height, dpi.height)); CFX_RectF rtFit; Optional width = TryWidth(); @@ -2941,12 +2940,8 @@ bool CXFA_Node::CalculateImageAutoSize(CXFA_FFDoc* doc, CFX_SizeF* pSize) { if (!pBitmap) return CalculateWidgetAutoSize(pSize); - int32_t iImageXDpi = 0; - int32_t iImageYDpi = 0; - GetImageDpi(iImageXDpi, iImageYDpi); - *pSize = CalculateImageSize(pBitmap->GetWidth(), pBitmap->GetHeight(), - iImageXDpi, iImageYDpi); + GetImageDpi()); return CalculateWidgetAutoSize(pSize); } @@ -2959,12 +2954,8 @@ bool CXFA_Node::CalculateImageEditAutoSize(CXFA_FFDoc* doc, CFX_SizeF* pSize) { if (!pBitmap) return CalculateFieldAutoSize(doc, pSize); - int32_t iImageXDpi = 0; - int32_t iImageYDpi = 0; - GetImageEditDpi(iImageXDpi, iImageYDpi); - *pSize = CalculateImageSize(pBitmap->GetWidth(), pBitmap->GetHeight(), - iImageXDpi, iImageYDpi); + GetImageEditDpi()); return CalculateFieldAutoSize(doc, pSize); } @@ -2980,18 +2971,16 @@ bool CXFA_Node::LoadImageEditImage(CXFA_FFDoc* doc) { ->LoadImageData(doc, this); } -void CXFA_Node::GetImageDpi(int32_t& iImageXDpi, int32_t& iImageYDpi) { +CFX_Size CXFA_Node::GetImageDpi() const { CXFA_ImageLayoutData* pData = static_cast(m_pLayoutData.get()); - iImageXDpi = pData->m_iImageXDpi; - iImageYDpi = pData->m_iImageYDpi; + return CFX_Size(pData->m_iImageXDpi, pData->m_iImageYDpi); } -void CXFA_Node::GetImageEditDpi(int32_t& iImageXDpi, int32_t& iImageYDpi) { +CFX_Size CXFA_Node::GetImageEditDpi() const { CXFA_ImageEditData* pData = static_cast(m_pLayoutData.get()); - iImageXDpi = pData->m_iImageXDpi; - iImageYDpi = pData->m_iImageYDpi; + return CFX_Size(pData->m_iImageXDpi, pData->m_iImageYDpi); } float CXFA_Node::CalculateWidgetAutoWidth(float fWidthCalc) { -- cgit v1.2.3