summaryrefslogtreecommitdiff
path: root/xfa/fxfa/cxfa_ffcheckbutton.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2018-01-30 20:36:50 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-01-30 20:36:50 +0000
commit7311006b16f30da32fed5145e2e1c2c04a5cea41 (patch)
treec5a62d46d630fe9913817d99ea0ba4147196b867 /xfa/fxfa/cxfa_ffcheckbutton.cpp
parent802eaea7696e2e1aa8d6d76d1fee39fbe1c7794b (diff)
downloadpdfium-7311006b16f30da32fed5145e2e1c2c04a5cea41.tar.xz
Move CheckButton code from CXFA_Node to CXFA_CheckButton
This CL moves some of the code specific to CheckButtons out of CXFA_Node and into the CXFA_CheckButton class. The CheckButton is passed as a parameter to the CXFA_FFCheckButton class. Change-Id: I3344c484d90e3b8d1024024a2851685044113a23 Reviewed-on: https://pdfium-review.googlesource.com/24711 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/cxfa_ffcheckbutton.cpp')
-rw-r--r--xfa/fxfa/cxfa_ffcheckbutton.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/xfa/fxfa/cxfa_ffcheckbutton.cpp b/xfa/fxfa/cxfa_ffcheckbutton.cpp
index 6902966470..57233a0f56 100644
--- a/xfa/fxfa/cxfa_ffcheckbutton.cpp
+++ b/xfa/fxfa/cxfa_ffcheckbutton.cpp
@@ -21,10 +21,12 @@
#include "xfa/fxfa/cxfa_ffwidget.h"
#include "xfa/fxfa/parser/cxfa_border.h"
#include "xfa/fxfa/parser/cxfa_caption.h"
+#include "xfa/fxfa/parser/cxfa_checkbutton.h"
#include "xfa/fxfa/parser/cxfa_para.h"
-CXFA_FFCheckButton::CXFA_FFCheckButton(CXFA_Node* pNode)
- : CXFA_FFField(pNode), m_pOldDelegate(nullptr) {}
+CXFA_FFCheckButton::CXFA_FFCheckButton(CXFA_Node* pNode,
+ CXFA_CheckButton* button)
+ : CXFA_FFField(pNode), button_(button) {}
CXFA_FFCheckButton::~CXFA_FFCheckButton() {}
@@ -57,7 +59,7 @@ void CXFA_FFCheckButton::UpdateWidgetProperty() {
pCheckBox->SetBoxSize(m_pNode->GetCheckButtonSize());
uint32_t dwStyleEx = FWL_STYLEEXT_CKB_SignShapeCross;
- switch (m_pNode->GetCheckButtonMark()) {
+ switch (button_->GetMark()) {
case XFA_AttributeEnum::Check:
dwStyleEx = FWL_STYLEEXT_CKB_SignShapeCheck;
break;
@@ -76,7 +78,7 @@ void CXFA_FFCheckButton::UpdateWidgetProperty() {
dwStyleEx = FWL_STYLEEXT_CKB_SignShapeStar;
break;
default: {
- if (m_pNode->IsCheckButtonRound())
+ if (button_->IsRound())
dwStyleEx = FWL_STYLEEXT_CKB_SignShapeCircle;
} break;
}
@@ -235,9 +237,9 @@ void CXFA_FFCheckButton::RenderWidget(CXFA_Graphics* pGS,
CXFA_FFWidget::RenderWidget(pGS, mtRotate, dwStatus);
DrawBorderWithFlag(pGS, m_pNode->GetUIBorder(), m_rtUI, mtRotate,
- m_pNode->IsCheckButtonRound());
+ button_->IsRound());
RenderCaption(pGS, &mtRotate);
- DrawHighlight(pGS, &mtRotate, dwStatus, m_pNode->IsCheckButtonRound());
+ DrawHighlight(pGS, &mtRotate, dwStatus, button_->IsRound());
CFX_Matrix mt(1, 0, 0, 1, m_rtCheckBox.left, m_rtCheckBox.top);
mt.Concat(mtRotate);
GetApp()->GetFWLWidgetMgr()->OnDrawWidget(m_pNormalWidget.get(), pGS, mt);