From 0821c95ee9f132f77f3670a7dbbf114a82a6b9a0 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Thu, 14 Dec 2017 20:09:43 +0000 Subject: Fold CXFA_ValueData into CXFA_Value The CXFA_ValueData class is a thin wrapper around the CXFA_Value, this CL moves the methods from CXFA_ValueData into CXFA_Value. Change-Id: I2c57e93e5c4675b82af71cf75f2dfc0fb12e4b20 Reviewed-on: https://pdfium-review.googlesource.com/21170 Commit-Queue: dsinclair Reviewed-by: Henrique Nakashima --- xfa/fxfa/cxfa_ffimage.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'xfa/fxfa/cxfa_ffimage.cpp') diff --git a/xfa/fxfa/cxfa_ffimage.cpp b/xfa/fxfa/cxfa_ffimage.cpp index 7a94c76a6a..159c6648b5 100644 --- a/xfa/fxfa/cxfa_ffimage.cpp +++ b/xfa/fxfa/cxfa_ffimage.cpp @@ -11,6 +11,7 @@ #include "xfa/fxfa/cxfa_ffdraw.h" #include "xfa/fxfa/cxfa_ffpageview.h" #include "xfa/fxfa/cxfa_ffwidget.h" +#include "xfa/fxfa/parser/cxfa_value.h" CXFA_FFImage::CXFA_FFImage(CXFA_WidgetAcc* pDataAcc) : CXFA_FFDraw(pDataAcc) {} @@ -64,7 +65,10 @@ void CXFA_FFImage::RenderWidget(CXFA_Graphics* pGS, int32_t iImageXDpi = 0; int32_t iImageYDpi = 0; m_pDataAcc->GetImageDpi(iImageXDpi, iImageYDpi); - XFA_DrawImage(pGS, rtImage, mtRotate, pDIBitmap, - m_pDataAcc->GetFormValueData().GetImageData().GetAspect(), + auto* value = m_pDataAcc->GetFormValue(); + CXFA_ImageData imageData = + value ? value->GetImageData() : CXFA_ImageData(nullptr); + + XFA_DrawImage(pGS, rtImage, mtRotate, pDIBitmap, imageData.GetAspect(), iImageXDpi, iImageYDpi, iHorzAlign, iVertAlign); } -- cgit v1.2.3