diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2018-01-08 14:30:00 -0500 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-01-08 20:03:36 +0000 |
commit | 0c53b008b4f2f7a790f756d706a00e8de98dfedd (patch) | |
tree | 7e8a3e6c22792f8ee4e79c85a808ce6ea346dac1 /xfa/fxfa/cxfa_ffimage.cpp | |
parent | 2f265dbf12831dece93a6a932fd99e5737cd1afd (diff) | |
download | pdfium-0c53b008b4f2f7a790f756d706a00e8de98dfedd.tar.xz |
Change the FFWidgets to store the node
This CL changes the various CXFA_FF* widgets to hold a CXFA_Node instead
of a CXFA_WidgetAcc wrapper.
Change-Id: I7e31633d5ffd3b61abcdcdfeee7822514c5b28da
Reviewed-on: https://pdfium-review.googlesource.com/22410
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/cxfa_ffimage.cpp')
-rw-r--r-- | xfa/fxfa/cxfa_ffimage.cpp | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/xfa/fxfa/cxfa_ffimage.cpp b/xfa/fxfa/cxfa_ffimage.cpp index dbd0067ec9..5191d34858 100644 --- a/xfa/fxfa/cxfa_ffimage.cpp +++ b/xfa/fxfa/cxfa_ffimage.cpp @@ -15,26 +15,27 @@ #include "xfa/fxfa/parser/cxfa_para.h" #include "xfa/fxfa/parser/cxfa_value.h" -CXFA_FFImage::CXFA_FFImage(CXFA_WidgetAcc* pDataAcc) : CXFA_FFDraw(pDataAcc) {} +CXFA_FFImage::CXFA_FFImage(CXFA_Node* pNode) : CXFA_FFDraw(pNode) {} CXFA_FFImage::~CXFA_FFImage() { CXFA_FFImage::UnloadWidget(); } bool CXFA_FFImage::IsLoaded() { - return !!GetDataAcc()->GetImageImage(); + return !!GetNode()->GetWidgetAcc()->GetImageImage(); } bool CXFA_FFImage::LoadWidget() { - if (GetDataAcc()->GetImageImage()) + if (GetNode()->GetWidgetAcc()->GetImageImage()) return true; - return GetDataAcc()->LoadImageImage(GetDoc()) ? CXFA_FFDraw::LoadWidget() - : false; + return GetNode()->GetWidgetAcc()->LoadImageImage(GetDoc()) + ? CXFA_FFDraw::LoadWidget() + : false; } void CXFA_FFImage::UnloadWidget() { - GetDataAcc()->SetImageImage(nullptr); + GetNode()->GetWidgetAcc()->SetImageImage(nullptr); } void CXFA_FFImage::RenderWidget(CXFA_Graphics* pGS, @@ -48,18 +49,19 @@ void CXFA_FFImage::RenderWidget(CXFA_Graphics* pGS, CXFA_FFWidget::RenderWidget(pGS, mtRotate, dwStatus); - RetainPtr<CFX_DIBitmap> pDIBitmap = GetDataAcc()->GetImageImage(); + RetainPtr<CFX_DIBitmap> pDIBitmap = + GetNode()->GetWidgetAcc()->GetImageImage(); if (!pDIBitmap) return; CFX_RectF rtImage = GetRectWithoutRotate(); - CXFA_Margin* margin = m_pDataAcc->GetNode()->GetMargin(); + CXFA_Margin* margin = m_pNode->GetMargin(); if (margin) XFA_RectWidthoutMargin(rtImage, margin); XFA_AttributeEnum iHorzAlign = XFA_AttributeEnum::Left; XFA_AttributeEnum iVertAlign = XFA_AttributeEnum::Top; - CXFA_Para* para = m_pDataAcc->GetNode()->GetPara(); + CXFA_Para* para = m_pNode->GetPara(); if (para) { iHorzAlign = para->GetHorizontalAlign(); iVertAlign = para->GetVerticalAlign(); @@ -67,8 +69,8 @@ void CXFA_FFImage::RenderWidget(CXFA_Graphics* pGS, int32_t iImageXDpi = 0; int32_t iImageYDpi = 0; - m_pDataAcc->GetImageDpi(iImageXDpi, iImageYDpi); - auto* value = m_pDataAcc->GetNode()->GetFormValue(); + m_pNode->GetWidgetAcc()->GetImageDpi(iImageXDpi, iImageYDpi); + auto* value = m_pNode->GetFormValue(); CXFA_Image* image = value ? value->GetImage() : nullptr; XFA_DrawImage(pGS, rtImage, mtRotate, pDIBitmap, image->GetAspect(), iImageXDpi, iImageYDpi, iHorzAlign, iVertAlign); |