summaryrefslogtreecommitdiff
path: root/xfa/fxfa/cxfa_ffpushbutton.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2018-01-08 14:30:00 -0500
committerChromium commit bot <commit-bot@chromium.org>2018-01-08 20:03:36 +0000
commit0c53b008b4f2f7a790f756d706a00e8de98dfedd (patch)
tree7e8a3e6c22792f8ee4e79c85a808ce6ea346dac1 /xfa/fxfa/cxfa_ffpushbutton.cpp
parent2f265dbf12831dece93a6a932fd99e5737cd1afd (diff)
downloadpdfium-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_ffpushbutton.cpp')
-rw-r--r--xfa/fxfa/cxfa_ffpushbutton.cpp27
1 files changed, 14 insertions, 13 deletions
diff --git a/xfa/fxfa/cxfa_ffpushbutton.cpp b/xfa/fxfa/cxfa_ffpushbutton.cpp
index f42e5257b5..c494a3dd82 100644
--- a/xfa/fxfa/cxfa_ffpushbutton.cpp
+++ b/xfa/fxfa/cxfa_ffpushbutton.cpp
@@ -24,8 +24,8 @@
#include "xfa/fxgraphics/cxfa_gecolor.h"
#include "xfa/fxgraphics/cxfa_gepath.h"
-CXFA_FFPushButton::CXFA_FFPushButton(CXFA_WidgetAcc* pDataAcc)
- : CXFA_FFField(pDataAcc), m_pOldDelegate(nullptr) {}
+CXFA_FFPushButton::CXFA_FFPushButton(CXFA_Node* pNode)
+ : CXFA_FFField(pNode), m_pOldDelegate(nullptr) {}
CXFA_FFPushButton::~CXFA_FFPushButton() {
CXFA_FFPushButton::UnloadWidget();
@@ -71,7 +71,7 @@ bool CXFA_FFPushButton::LoadWidget() {
void CXFA_FFPushButton::UpdateWidgetProperty() {
uint32_t dwStyleEx = 0;
- switch (m_pDataAcc->GetButtonHighlight()) {
+ switch (m_pNode->GetWidgetAcc()->GetButtonHighlight()) {
case XFA_AttributeEnum::Inverted:
dwStyleEx = XFA_FWL_PSBSTYLEEXT_HiliteInverted;
break;
@@ -100,11 +100,11 @@ bool CXFA_FFPushButton::PerformLayout() {
CFX_RectF rtWidget = GetRectWithoutRotate();
m_rtUI = rtWidget;
- CXFA_Margin* margin = m_pDataAcc->GetNode()->GetMargin();
+ CXFA_Margin* margin = m_pNode->GetMargin();
if (margin)
XFA_RectWidthoutMargin(rtWidget, margin);
- CXFA_Caption* caption = m_pDataAcc->GetNode()->GetCaption();
+ CXFA_Caption* caption = m_pNode->GetCaption();
m_rtCaption = rtWidget;
CXFA_Margin* captionMargin = caption->GetMargin();
if (captionMargin)
@@ -118,7 +118,7 @@ bool CXFA_FFPushButton::PerformLayout() {
return true;
}
float CXFA_FFPushButton::GetLineWidth() {
- CXFA_Border* border = m_pDataAcc->GetNode()->GetBorder(false);
+ CXFA_Border* border = m_pNode->GetBorder(false);
if (border && border->GetPresence() == XFA_AttributeEnum::Visible)
return border->GetEdge(0)->GetThickness();
return 0;
@@ -133,23 +133,23 @@ FX_ARGB CXFA_FFPushButton::GetFillColor() {
}
void CXFA_FFPushButton::LoadHighlightCaption() {
- CXFA_Caption* caption = m_pDataAcc->GetNode()->GetCaption();
+ CXFA_Caption* caption = m_pNode->GetCaption();
if (!caption || caption->IsHidden())
return;
- if (m_pDataAcc->HasButtonRollover()) {
+ if (m_pNode->GetWidgetAcc()->HasButtonRollover()) {
if (!m_pRollProvider) {
m_pRollProvider = pdfium::MakeUnique<CXFA_TextProvider>(
- m_pDataAcc.Get(), XFA_TEXTPROVIDERTYPE_Rollover);
+ m_pNode->GetWidgetAcc(), XFA_TEXTPROVIDERTYPE_Rollover);
}
m_pRolloverTextLayout =
pdfium::MakeUnique<CXFA_TextLayout>(GetDoc(), m_pRollProvider.get());
}
- if (m_pDataAcc->HasButtonDown()) {
+ if (m_pNode->GetWidgetAcc()->HasButtonDown()) {
if (!m_pDownProvider) {
m_pDownProvider = pdfium::MakeUnique<CXFA_TextProvider>(
- m_pDataAcc.Get(), XFA_TEXTPROVIDERTYPE_Down);
+ m_pNode->GetWidgetAcc(), XFA_TEXTPROVIDERTYPE_Down);
}
m_pDownTextLayout =
pdfium::MakeUnique<CXFA_TextLayout>(GetDoc(), m_pDownProvider.get());
@@ -167,8 +167,9 @@ void CXFA_FFPushButton::LayoutHighlightCaption() {
void CXFA_FFPushButton::RenderHighlightCaption(CXFA_Graphics* pGS,
CFX_Matrix* pMatrix) {
- CXFA_TextLayout* pCapTextLayout = m_pDataAcc->GetCaptionTextLayout();
- CXFA_Caption* caption = m_pDataAcc->GetNode()->GetCaption();
+ CXFA_TextLayout* pCapTextLayout =
+ m_pNode->GetWidgetAcc()->GetCaptionTextLayout();
+ CXFA_Caption* caption = m_pNode->GetCaption();
if (!caption || !caption->IsVisible())
return;