diff options
author | dan sinclair <dsinclair@chromium.org> | 2017-02-04 10:16:21 -0500 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-02-04 15:43:04 +0000 |
commit | aaf0bdc5bf420d08dfcbb049c4511c55eec0dd6c (patch) | |
tree | 275ffc37daf73cf61a25aef532f62a9f271b39bd /xfa/fxfa | |
parent | 65c7c234d026101f69754f97f40e73eb29a3ef16 (diff) | |
download | pdfium-aaf0bdc5bf420d08dfcbb049c4511c55eec0dd6c.tar.xz |
Remove unused parameterchromium/3004
The pPageView parameter is always set to nullptr when creating XFA widgets.
Change-Id: I4259ff7e523dc462242d2e37f0e2a919c5543035
Reviewed-on: https://pdfium-review.googlesource.com/2511
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Nicolás Peña <npm@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'xfa/fxfa')
33 files changed, 110 insertions, 111 deletions
diff --git a/xfa/fxfa/app/xfa_ffbarcode.cpp b/xfa/fxfa/app/xfa_ffbarcode.cpp index 822029df3e..e42bf919c7 100644 --- a/xfa/fxfa/app/xfa_ffbarcode.cpp +++ b/xfa/fxfa/app/xfa_ffbarcode.cpp @@ -116,9 +116,8 @@ const XFA_BARCODETYPEENUMINFO* XFA_GetBarcodeTypeByName( } // namespace. -CXFA_FFBarcode::CXFA_FFBarcode(CXFA_FFPageView* pPageView, - CXFA_WidgetAcc* pDataAcc) - : CXFA_FFTextEdit(pPageView, pDataAcc) {} +CXFA_FFBarcode::CXFA_FFBarcode(CXFA_WidgetAcc* pDataAcc) + : CXFA_FFTextEdit(pDataAcc) {} CXFA_FFBarcode::~CXFA_FFBarcode() {} diff --git a/xfa/fxfa/app/xfa_ffbarcode.h b/xfa/fxfa/app/xfa_ffbarcode.h index 4690b3d612..28d7486bcd 100644 --- a/xfa/fxfa/app/xfa_ffbarcode.h +++ b/xfa/fxfa/app/xfa_ffbarcode.h @@ -13,7 +13,7 @@ class CXFA_FFBarcode : public CXFA_FFTextEdit { public: - CXFA_FFBarcode(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc); + explicit CXFA_FFBarcode(CXFA_WidgetAcc* pDataAcc); ~CXFA_FFBarcode() override; // CXFA_FFTextEdit diff --git a/xfa/fxfa/app/xfa_ffcheckbutton.cpp b/xfa/fxfa/app/xfa_ffcheckbutton.cpp index e8a422ebd6..3de3672a63 100644 --- a/xfa/fxfa/app/xfa_ffcheckbutton.cpp +++ b/xfa/fxfa/app/xfa_ffcheckbutton.cpp @@ -18,9 +18,8 @@ #include "xfa/fxfa/xfa_ffpageview.h" #include "xfa/fxfa/xfa_ffwidget.h" -CXFA_FFCheckButton::CXFA_FFCheckButton(CXFA_FFPageView* pPageView, - CXFA_WidgetAcc* pDataAcc) - : CXFA_FFField(pPageView, pDataAcc), m_pOldDelegate(nullptr) { +CXFA_FFCheckButton::CXFA_FFCheckButton(CXFA_WidgetAcc* pDataAcc) + : CXFA_FFField(pDataAcc), m_pOldDelegate(nullptr) { m_rtCheckBox.Set(0, 0, 0, 0); } diff --git a/xfa/fxfa/app/xfa_ffcheckbutton.h b/xfa/fxfa/app/xfa_ffcheckbutton.h index dcd68935af..4cb7d2113c 100644 --- a/xfa/fxfa/app/xfa_ffcheckbutton.h +++ b/xfa/fxfa/app/xfa_ffcheckbutton.h @@ -12,7 +12,7 @@ class CXFA_FFCheckButton : public CXFA_FFField { public: - CXFA_FFCheckButton(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc); + explicit CXFA_FFCheckButton(CXFA_WidgetAcc* pDataAcc); ~CXFA_FFCheckButton() override; // CXFA_FFField diff --git a/xfa/fxfa/app/xfa_ffchoicelist.cpp b/xfa/fxfa/app/xfa_ffchoicelist.cpp index e0e04699d4..847f080f3e 100644 --- a/xfa/fxfa/app/xfa_ffchoicelist.cpp +++ b/xfa/fxfa/app/xfa_ffchoicelist.cpp @@ -25,9 +25,8 @@ #include "xfa/fxfa/xfa_ffpageview.h" #include "xfa/fxfa/xfa_ffwidget.h" -CXFA_FFListBox::CXFA_FFListBox(CXFA_FFPageView* pPageView, - CXFA_WidgetAcc* pDataAcc) - : CXFA_FFField(pPageView, pDataAcc), m_pOldDelegate(nullptr) {} +CXFA_FFListBox::CXFA_FFListBox(CXFA_WidgetAcc* pDataAcc) + : CXFA_FFField(pDataAcc), m_pOldDelegate(nullptr) {} CXFA_FFListBox::~CXFA_FFListBox() { if (m_pNormalWidget) { @@ -216,9 +215,8 @@ void CXFA_FFListBox::OnDrawWidget(CFX_Graphics* pGraphics, m_pOldDelegate->OnDrawWidget(pGraphics, pMatrix); } -CXFA_FFComboBox::CXFA_FFComboBox(CXFA_FFPageView* pPageView, - CXFA_WidgetAcc* pDataAcc) - : CXFA_FFField(pPageView, pDataAcc), m_pOldDelegate(nullptr) {} +CXFA_FFComboBox::CXFA_FFComboBox(CXFA_WidgetAcc* pDataAcc) + : CXFA_FFField(pDataAcc), m_pOldDelegate(nullptr) {} CXFA_FFComboBox::~CXFA_FFComboBox() {} diff --git a/xfa/fxfa/app/xfa_ffchoicelist.h b/xfa/fxfa/app/xfa_ffchoicelist.h index 75057b041b..18d58f983e 100644 --- a/xfa/fxfa/app/xfa_ffchoicelist.h +++ b/xfa/fxfa/app/xfa_ffchoicelist.h @@ -12,7 +12,7 @@ class CXFA_FFListBox : public CXFA_FFField { public: - CXFA_FFListBox(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc); + explicit CXFA_FFListBox(CXFA_WidgetAcc* pDataAcc); ~CXFA_FFListBox() override; // CXFA_FFField @@ -41,7 +41,7 @@ class CXFA_FFListBox : public CXFA_FFField { class CXFA_FFComboBox : public CXFA_FFField { public: - CXFA_FFComboBox(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc); + explicit CXFA_FFComboBox(CXFA_WidgetAcc* pDataAcc); ~CXFA_FFComboBox() override; // CXFA_FFField diff --git a/xfa/fxfa/app/xfa_ffdraw.cpp b/xfa/fxfa/app/xfa_ffdraw.cpp index da1ae65ba9..37095ddb49 100644 --- a/xfa/fxfa/app/xfa_ffdraw.cpp +++ b/xfa/fxfa/app/xfa_ffdraw.cpp @@ -11,6 +11,6 @@ #include "xfa/fxfa/xfa_ffpageview.h" #include "xfa/fxfa/xfa_ffwidget.h" -CXFA_FFDraw::CXFA_FFDraw(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc) - : CXFA_FFWidget(pPageView, pDataAcc) {} +CXFA_FFDraw::CXFA_FFDraw(CXFA_WidgetAcc* pDataAcc) : CXFA_FFWidget(pDataAcc) {} + CXFA_FFDraw::~CXFA_FFDraw() {} diff --git a/xfa/fxfa/app/xfa_ffdraw.h b/xfa/fxfa/app/xfa_ffdraw.h index bf9fd84a12..0212dcca0a 100644 --- a/xfa/fxfa/app/xfa_ffdraw.h +++ b/xfa/fxfa/app/xfa_ffdraw.h @@ -12,7 +12,7 @@ class CXFA_FFDraw : public CXFA_FFWidget { public: - CXFA_FFDraw(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc); + explicit CXFA_FFDraw(CXFA_WidgetAcc* pDataAcc); ~CXFA_FFDraw() override; }; diff --git a/xfa/fxfa/app/xfa_ffexclgroup.cpp b/xfa/fxfa/app/xfa_ffexclgroup.cpp index a6b94475aa..6b47cfb8eb 100644 --- a/xfa/fxfa/app/xfa_ffexclgroup.cpp +++ b/xfa/fxfa/app/xfa_ffexclgroup.cpp @@ -11,10 +11,11 @@ #include "xfa/fxfa/xfa_ffpageview.h" #include "xfa/fxfa/xfa_ffwidget.h" -CXFA_FFExclGroup::CXFA_FFExclGroup(CXFA_FFPageView* pPageView, - CXFA_WidgetAcc* pDataAcc) - : CXFA_FFWidget(pPageView, pDataAcc) {} +CXFA_FFExclGroup::CXFA_FFExclGroup(CXFA_WidgetAcc* pDataAcc) + : CXFA_FFWidget(pDataAcc) {} + CXFA_FFExclGroup::~CXFA_FFExclGroup() {} + void CXFA_FFExclGroup::RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix, uint32_t dwStatus) { diff --git a/xfa/fxfa/app/xfa_ffexclgroup.h b/xfa/fxfa/app/xfa_ffexclgroup.h index 90e82510a7..12a13aea92 100644 --- a/xfa/fxfa/app/xfa_ffexclgroup.h +++ b/xfa/fxfa/app/xfa_ffexclgroup.h @@ -12,7 +12,7 @@ class CXFA_FFExclGroup : public CXFA_FFWidget { public: - CXFA_FFExclGroup(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc); + explicit CXFA_FFExclGroup(CXFA_WidgetAcc* pDataAcc); ~CXFA_FFExclGroup() override; // CXFA_FFWidget diff --git a/xfa/fxfa/app/xfa_fffield.cpp b/xfa/fxfa/app/xfa_fffield.cpp index aa8abbde86..a8ee0b9acc 100644 --- a/xfa/fxfa/app/xfa_fffield.cpp +++ b/xfa/fxfa/app/xfa_fffield.cpp @@ -25,8 +25,8 @@ #include "xfa/fxgraphics/cfx_color.h" #include "xfa/fxgraphics/cfx_path.h" -CXFA_FFField::CXFA_FFField(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc) - : CXFA_FFWidget(pPageView, pDataAcc), m_pNormalWidget(nullptr) { +CXFA_FFField::CXFA_FFField(CXFA_WidgetAcc* pDataAcc) + : CXFA_FFWidget(pDataAcc), m_pNormalWidget(nullptr) { m_rtUI.Set(0, 0, 0, 0); m_rtCaption.Set(0, 0, 0, 0); } diff --git a/xfa/fxfa/app/xfa_fffield.h b/xfa/fxfa/app/xfa_fffield.h index 6b4c92ae1d..d7f5965fe9 100644 --- a/xfa/fxfa/app/xfa_fffield.h +++ b/xfa/fxfa/app/xfa_fffield.h @@ -17,7 +17,7 @@ class CXFA_FFField : public CXFA_FFWidget, public IFWL_WidgetDelegate { public: - CXFA_FFField(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc); + explicit CXFA_FFField(CXFA_WidgetAcc* pDataAcc); ~CXFA_FFField() override; // CXFA_FFWidget diff --git a/xfa/fxfa/app/xfa_ffimage.cpp b/xfa/fxfa/app/xfa_ffimage.cpp index c387cc2690..996a3d6b3b 100644 --- a/xfa/fxfa/app/xfa_ffimage.cpp +++ b/xfa/fxfa/app/xfa_ffimage.cpp @@ -12,11 +12,12 @@ #include "xfa/fxfa/xfa_ffpageview.h" #include "xfa/fxfa/xfa_ffwidget.h" -CXFA_FFImage::CXFA_FFImage(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc) - : CXFA_FFDraw(pPageView, pDataAcc) {} +CXFA_FFImage::CXFA_FFImage(CXFA_WidgetAcc* pDataAcc) : CXFA_FFDraw(pDataAcc) {} + CXFA_FFImage::~CXFA_FFImage() { CXFA_FFImage::UnloadWidget(); } + bool CXFA_FFImage::IsLoaded() { return !!GetDataAcc()->GetImageImage(); } diff --git a/xfa/fxfa/app/xfa_ffimage.h b/xfa/fxfa/app/xfa_ffimage.h index cc5320eb36..2c42791877 100644 --- a/xfa/fxfa/app/xfa_ffimage.h +++ b/xfa/fxfa/app/xfa_ffimage.h @@ -11,7 +11,7 @@ class CXFA_FFImage : public CXFA_FFDraw { public: - CXFA_FFImage(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc); + explicit CXFA_FFImage(CXFA_WidgetAcc* pDataAcc); ~CXFA_FFImage() override; // CXFA_FFWidget diff --git a/xfa/fxfa/app/xfa_ffimageedit.cpp b/xfa/fxfa/app/xfa_ffimageedit.cpp index 3b063d6e98..791b92b445 100644 --- a/xfa/fxfa/app/xfa_ffimageedit.cpp +++ b/xfa/fxfa/app/xfa_ffimageedit.cpp @@ -16,12 +16,13 @@ #include "xfa/fxfa/xfa_ffpageview.h" #include "xfa/fxfa/xfa_ffwidget.h" -CXFA_FFImageEdit::CXFA_FFImageEdit(CXFA_FFPageView* pPageView, - CXFA_WidgetAcc* pDataAcc) - : CXFA_FFField(pPageView, pDataAcc), m_pOldDelegate(nullptr) {} +CXFA_FFImageEdit::CXFA_FFImageEdit(CXFA_WidgetAcc* pDataAcc) + : CXFA_FFField(pDataAcc), m_pOldDelegate(nullptr) {} + CXFA_FFImageEdit::~CXFA_FFImageEdit() { CXFA_FFImageEdit::UnloadWidget(); } + bool CXFA_FFImageEdit::LoadWidget() { CFWL_PictureBox* pPictureBox = new CFWL_PictureBox(GetFWLApp()); m_pNormalWidget = pPictureBox; diff --git a/xfa/fxfa/app/xfa_ffimageedit.h b/xfa/fxfa/app/xfa_ffimageedit.h index b6f6ae1ffe..9a2d19b8a8 100644 --- a/xfa/fxfa/app/xfa_ffimageedit.h +++ b/xfa/fxfa/app/xfa_ffimageedit.h @@ -11,7 +11,7 @@ class CXFA_FFImageEdit : public CXFA_FFField { public: - CXFA_FFImageEdit(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc); + explicit CXFA_FFImageEdit(CXFA_WidgetAcc* pDataAcc); ~CXFA_FFImageEdit() override; // CXFA_FFField diff --git a/xfa/fxfa/app/xfa_ffnotify.cpp b/xfa/fxfa/app/xfa_ffnotify.cpp index 3aef5fcbfd..d84ac0de37 100644 --- a/xfa/fxfa/app/xfa_ffnotify.cpp +++ b/xfa/fxfa/app/xfa_ffnotify.cpp @@ -102,62 +102,62 @@ CXFA_LayoutItem* CXFA_FFNotify::OnCreateLayoutItem(CXFA_Node* pNode) { CXFA_FFWidget* pWidget; switch (pAcc->GetUIType()) { case XFA_Element::Barcode: - pWidget = new CXFA_FFBarcode(nullptr, pAcc); + pWidget = new CXFA_FFBarcode(pAcc); break; case XFA_Element::Button: - pWidget = new CXFA_FFPushButton(nullptr, pAcc); + pWidget = new CXFA_FFPushButton(pAcc); break; case XFA_Element::CheckButton: - pWidget = new CXFA_FFCheckButton(nullptr, pAcc); + pWidget = new CXFA_FFCheckButton(pAcc); break; case XFA_Element::ChoiceList: { if (pAcc->IsListBox()) { - pWidget = new CXFA_FFListBox(nullptr, pAcc); + pWidget = new CXFA_FFListBox(pAcc); } else { - pWidget = new CXFA_FFComboBox(nullptr, pAcc); + pWidget = new CXFA_FFComboBox(pAcc); } } break; case XFA_Element::DateTimeEdit: - pWidget = new CXFA_FFDateTimeEdit(nullptr, pAcc); + pWidget = new CXFA_FFDateTimeEdit(pAcc); break; case XFA_Element::ImageEdit: - pWidget = new CXFA_FFImageEdit(nullptr, pAcc); + pWidget = new CXFA_FFImageEdit(pAcc); break; case XFA_Element::NumericEdit: - pWidget = new CXFA_FFNumericEdit(nullptr, pAcc); + pWidget = new CXFA_FFNumericEdit(pAcc); break; case XFA_Element::PasswordEdit: - pWidget = new CXFA_FFPasswordEdit(nullptr, pAcc); + pWidget = new CXFA_FFPasswordEdit(pAcc); break; case XFA_Element::Signature: - pWidget = new CXFA_FFSignature(nullptr, pAcc); + pWidget = new CXFA_FFSignature(pAcc); break; case XFA_Element::TextEdit: - pWidget = new CXFA_FFTextEdit(nullptr, pAcc); + pWidget = new CXFA_FFTextEdit(pAcc); break; case XFA_Element::Arc: - pWidget = new CXFA_FFArc(nullptr, pAcc); + pWidget = new CXFA_FFArc(pAcc); break; case XFA_Element::Line: - pWidget = new CXFA_FFLine(nullptr, pAcc); + pWidget = new CXFA_FFLine(pAcc); break; case XFA_Element::Rectangle: - pWidget = new CXFA_FFRectangle(nullptr, pAcc); + pWidget = new CXFA_FFRectangle(pAcc); break; case XFA_Element::Text: - pWidget = new CXFA_FFText(nullptr, pAcc); + pWidget = new CXFA_FFText(pAcc); break; case XFA_Element::Image: - pWidget = new CXFA_FFImage(nullptr, pAcc); + pWidget = new CXFA_FFImage(pAcc); break; case XFA_Element::Draw: - pWidget = new CXFA_FFDraw(nullptr, pAcc); + pWidget = new CXFA_FFDraw(pAcc); break; case XFA_Element::Subform: - pWidget = new CXFA_FFSubForm(nullptr, pAcc); + pWidget = new CXFA_FFSubForm(pAcc); break; case XFA_Element::ExclGroup: - pWidget = new CXFA_FFExclGroup(nullptr, pAcc); + pWidget = new CXFA_FFExclGroup(pAcc); break; case XFA_Element::DefaultUi: default: diff --git a/xfa/fxfa/app/xfa_ffpath.cpp b/xfa/fxfa/app/xfa_ffpath.cpp index c5c91a459c..0620982b1c 100644 --- a/xfa/fxfa/app/xfa_ffpath.cpp +++ b/xfa/fxfa/app/xfa_ffpath.cpp @@ -14,9 +14,10 @@ #include "xfa/fxgraphics/cfx_color.h" #include "xfa/fxgraphics/cfx_path.h" -CXFA_FFLine::CXFA_FFLine(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc) - : CXFA_FFDraw(pPageView, pDataAcc) {} +CXFA_FFLine::CXFA_FFLine(CXFA_WidgetAcc* pDataAcc) : CXFA_FFDraw(pDataAcc) {} + CXFA_FFLine::~CXFA_FFLine() {} + void CXFA_FFLine::GetRectFromHand(CFX_RectF& rect, int32_t iHand, FX_FLOAT fLineWidth) { @@ -49,6 +50,7 @@ void CXFA_FFLine::GetRectFromHand(CFX_RectF& rect, } } } + void CXFA_FFLine::RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix, uint32_t dwStatus) { @@ -102,9 +104,11 @@ void CXFA_FFLine::RenderWidget(CFX_Graphics* pGS, pGS->StrokePath(&linePath, &mtRotate); pGS->RestoreGraphState(); } -CXFA_FFArc::CXFA_FFArc(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc) - : CXFA_FFDraw(pPageView, pDataAcc) {} + +CXFA_FFArc::CXFA_FFArc(CXFA_WidgetAcc* pDataAcc) : CXFA_FFDraw(pDataAcc) {} + CXFA_FFArc::~CXFA_FFArc() {} + void CXFA_FFArc::RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix, uint32_t dwStatus) { @@ -128,10 +132,12 @@ void CXFA_FFArc::RenderWidget(CFX_Graphics* pGS, } DrawBorder(pGS, arcObj, rtArc, &mtRotate); } -CXFA_FFRectangle::CXFA_FFRectangle(CXFA_FFPageView* pPageView, - CXFA_WidgetAcc* pDataAcc) - : CXFA_FFDraw(pPageView, pDataAcc) {} + +CXFA_FFRectangle::CXFA_FFRectangle(CXFA_WidgetAcc* pDataAcc) + : CXFA_FFDraw(pDataAcc) {} + CXFA_FFRectangle::~CXFA_FFRectangle() {} + void CXFA_FFRectangle::RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix, uint32_t dwStatus) { diff --git a/xfa/fxfa/app/xfa_ffpath.h b/xfa/fxfa/app/xfa_ffpath.h index 71c45e323e..002f75d262 100644 --- a/xfa/fxfa/app/xfa_ffpath.h +++ b/xfa/fxfa/app/xfa_ffpath.h @@ -11,7 +11,7 @@ class CXFA_FFLine : public CXFA_FFDraw { public: - CXFA_FFLine(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc); + explicit CXFA_FFLine(CXFA_WidgetAcc* pDataAcc); ~CXFA_FFLine() override; // CXFA_FFWidget @@ -22,9 +22,10 @@ class CXFA_FFLine : public CXFA_FFDraw { private: void GetRectFromHand(CFX_RectF& rect, int32_t iHand, FX_FLOAT fLineWidth); }; + class CXFA_FFArc : public CXFA_FFDraw { public: - CXFA_FFArc(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc); + explicit CXFA_FFArc(CXFA_WidgetAcc* pDataAcc); ~CXFA_FFArc() override; // CXFA_FFWidget @@ -35,7 +36,7 @@ class CXFA_FFArc : public CXFA_FFDraw { class CXFA_FFRectangle : public CXFA_FFDraw { public: - CXFA_FFRectangle(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc); + explicit CXFA_FFRectangle(CXFA_WidgetAcc* pDataAcc); ~CXFA_FFRectangle() override; // CXFA_FFWidget diff --git a/xfa/fxfa/app/xfa_ffpushbutton.cpp b/xfa/fxfa/app/xfa_ffpushbutton.cpp index 4d4d1aad2d..92e5b70d4e 100644 --- a/xfa/fxfa/app/xfa_ffpushbutton.cpp +++ b/xfa/fxfa/app/xfa_ffpushbutton.cpp @@ -18,17 +18,18 @@ #include "xfa/fxgraphics/cfx_color.h" #include "xfa/fxgraphics/cfx_path.h" -CXFA_FFPushButton::CXFA_FFPushButton(CXFA_FFPageView* pPageView, - CXFA_WidgetAcc* pDataAcc) - : CXFA_FFField(pPageView, pDataAcc), +CXFA_FFPushButton::CXFA_FFPushButton(CXFA_WidgetAcc* pDataAcc) + : CXFA_FFField(pDataAcc), m_pRolloverTextLayout(nullptr), m_pDownTextLayout(nullptr), m_pDownProvider(nullptr), m_pRollProvider(nullptr), m_pOldDelegate(nullptr) {} + CXFA_FFPushButton::~CXFA_FFPushButton() { CXFA_FFPushButton::UnloadWidget(); } + void CXFA_FFPushButton::RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix, uint32_t dwStatus) { diff --git a/xfa/fxfa/app/xfa_ffpushbutton.h b/xfa/fxfa/app/xfa_ffpushbutton.h index d5fe0b279f..eb18ccb11c 100644 --- a/xfa/fxfa/app/xfa_ffpushbutton.h +++ b/xfa/fxfa/app/xfa_ffpushbutton.h @@ -18,7 +18,7 @@ class CXFA_TextProvider; class CXFA_FFPushButton : public CXFA_FFField { public: - CXFA_FFPushButton(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc); + explicit CXFA_FFPushButton(CXFA_WidgetAcc* pDataAcc); ~CXFA_FFPushButton() override; // CXFA_FFField diff --git a/xfa/fxfa/app/xfa_ffsignature.cpp b/xfa/fxfa/app/xfa_ffsignature.cpp index 7b8da0cea7..1e03e080cb 100644 --- a/xfa/fxfa/app/xfa_ffsignature.cpp +++ b/xfa/fxfa/app/xfa_ffsignature.cpp @@ -11,13 +11,15 @@ #include "xfa/fxfa/xfa_ffpageview.h" #include "xfa/fxfa/xfa_ffwidget.h" -CXFA_FFSignature::CXFA_FFSignature(CXFA_FFPageView* pPageView, - CXFA_WidgetAcc* pDataAcc) - : CXFA_FFField(pPageView, pDataAcc) {} +CXFA_FFSignature::CXFA_FFSignature(CXFA_WidgetAcc* pDataAcc) + : CXFA_FFField(pDataAcc) {} + CXFA_FFSignature::~CXFA_FFSignature() {} + bool CXFA_FFSignature::LoadWidget() { return CXFA_FFField::LoadWidget(); } + void CXFA_FFSignature::RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix, uint32_t dwStatus) { diff --git a/xfa/fxfa/app/xfa_ffsignature.h b/xfa/fxfa/app/xfa_ffsignature.h index 28053b758e..29c27360a9 100644 --- a/xfa/fxfa/app/xfa_ffsignature.h +++ b/xfa/fxfa/app/xfa_ffsignature.h @@ -11,7 +11,7 @@ class CXFA_FFSignature final : public CXFA_FFField { public: - CXFA_FFSignature(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc); + explicit CXFA_FFSignature(CXFA_WidgetAcc* pDataAcc); ~CXFA_FFSignature() override; // CXFA_FFField diff --git a/xfa/fxfa/app/xfa_ffsubform.cpp b/xfa/fxfa/app/xfa_ffsubform.cpp index 38c21fbb69..0b479f4d4c 100644 --- a/xfa/fxfa/app/xfa_ffsubform.cpp +++ b/xfa/fxfa/app/xfa_ffsubform.cpp @@ -11,7 +11,7 @@ #include "xfa/fxfa/xfa_ffpageview.h" #include "xfa/fxfa/xfa_ffwidget.h" -CXFA_FFSubForm::CXFA_FFSubForm(CXFA_FFPageView* pPageView, - CXFA_WidgetAcc* pDataAcc) - : CXFA_FFWidget(pPageView, pDataAcc) {} +CXFA_FFSubForm::CXFA_FFSubForm(CXFA_WidgetAcc* pDataAcc) + : CXFA_FFWidget(pDataAcc) {} + CXFA_FFSubForm::~CXFA_FFSubForm() {} diff --git a/xfa/fxfa/app/xfa_ffsubform.h b/xfa/fxfa/app/xfa_ffsubform.h index 98ce739b17..e6b77a8b33 100644 --- a/xfa/fxfa/app/xfa_ffsubform.h +++ b/xfa/fxfa/app/xfa_ffsubform.h @@ -12,7 +12,7 @@ class CXFA_FFSubForm : public CXFA_FFWidget { public: - CXFA_FFSubForm(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc); + explicit CXFA_FFSubForm(CXFA_WidgetAcc* pDataAcc); ~CXFA_FFSubForm() override; }; diff --git a/xfa/fxfa/app/xfa_fftext.cpp b/xfa/fxfa/app/xfa_fftext.cpp index 3d2c9a6ea0..0cc6651d21 100644 --- a/xfa/fxfa/app/xfa_fftext.cpp +++ b/xfa/fxfa/app/xfa_fftext.cpp @@ -19,9 +19,10 @@ #include "xfa/fxfa/xfa_ffwidget.h" #include "xfa/fxgraphics/cfx_graphics.h" -CXFA_FFText::CXFA_FFText(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc) - : CXFA_FFDraw(pPageView, pDataAcc) {} +CXFA_FFText::CXFA_FFText(CXFA_WidgetAcc* pDataAcc) : CXFA_FFDraw(pDataAcc) {} + CXFA_FFText::~CXFA_FFText() {} + void CXFA_FFText::RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix, uint32_t dwStatus) { diff --git a/xfa/fxfa/app/xfa_fftext.h b/xfa/fxfa/app/xfa_fftext.h index 71f36e2769..02716e532f 100644 --- a/xfa/fxfa/app/xfa_fftext.h +++ b/xfa/fxfa/app/xfa_fftext.h @@ -11,7 +11,7 @@ class CXFA_FFText : public CXFA_FFDraw { public: - CXFA_FFText(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc); + explicit CXFA_FFText(CXFA_WidgetAcc* pDataAcc); ~CXFA_FFText() override; // CXFA_FFWidget diff --git a/xfa/fxfa/app/xfa_fftextedit.cpp b/xfa/fxfa/app/xfa_fftextedit.cpp index 1088afdb6a..0cb43575b0 100644 --- a/xfa/fxfa/app/xfa_fftextedit.cpp +++ b/xfa/fxfa/app/xfa_fftextedit.cpp @@ -28,9 +28,8 @@ #include "xfa/fxfa/xfa_ffpageview.h" #include "xfa/fxfa/xfa_ffwidget.h" -CXFA_FFTextEdit::CXFA_FFTextEdit(CXFA_FFPageView* pPageView, - CXFA_WidgetAcc* pDataAcc) - : CXFA_FFField(pPageView, pDataAcc), m_pOldDelegate(nullptr) {} +CXFA_FFTextEdit::CXFA_FFTextEdit(CXFA_WidgetAcc* pDataAcc) + : CXFA_FFField(pDataAcc), m_pOldDelegate(nullptr) {} CXFA_FFTextEdit::~CXFA_FFTextEdit() { if (m_pNormalWidget) { @@ -360,10 +359,11 @@ void CXFA_FFTextEdit::OnDrawWidget(CFX_Graphics* pGraphics, m_pOldDelegate->OnDrawWidget(pGraphics, pMatrix); } -CXFA_FFNumericEdit::CXFA_FFNumericEdit(CXFA_FFPageView* pPageView, - CXFA_WidgetAcc* pDataAcc) - : CXFA_FFTextEdit(pPageView, pDataAcc) {} +CXFA_FFNumericEdit::CXFA_FFNumericEdit(CXFA_WidgetAcc* pDataAcc) + : CXFA_FFTextEdit(pDataAcc) {} + CXFA_FFNumericEdit::~CXFA_FFNumericEdit() {} + bool CXFA_FFNumericEdit::LoadWidget() { CFWL_Edit* pWidget = new CFWL_Edit( GetFWLApp(), pdfium::MakeUnique<CFWL_WidgetProperties>(), nullptr); @@ -437,9 +437,9 @@ bool CXFA_FFNumericEdit::OnValidate(CFWL_Widget* pWidget, return widgetValue.ValidateNumericTemp(wsText, wsFormat, m_pDataAcc->GetLocal()); } -CXFA_FFPasswordEdit::CXFA_FFPasswordEdit(CXFA_FFPageView* pPageView, - CXFA_WidgetAcc* pDataAcc) - : CXFA_FFTextEdit(pPageView, pDataAcc) {} + +CXFA_FFPasswordEdit::CXFA_FFPasswordEdit(CXFA_WidgetAcc* pDataAcc) + : CXFA_FFTextEdit(pDataAcc) {} CXFA_FFPasswordEdit::~CXFA_FFPasswordEdit() {} @@ -488,9 +488,8 @@ void CXFA_FFPasswordEdit::UpdateWidgetProperty() { dwExtendedStyle |= GetAlignment(); m_pNormalWidget->ModifyStylesEx(dwExtendedStyle, 0xFFFFFFFF); } -CXFA_FFDateTimeEdit::CXFA_FFDateTimeEdit(CXFA_FFPageView* pPageView, - CXFA_WidgetAcc* pDataAcc) - : CXFA_FFTextEdit(pPageView, pDataAcc) {} +CXFA_FFDateTimeEdit::CXFA_FFDateTimeEdit(CXFA_WidgetAcc* pDataAcc) + : CXFA_FFTextEdit(pDataAcc) {} CXFA_FFDateTimeEdit::~CXFA_FFDateTimeEdit() {} diff --git a/xfa/fxfa/app/xfa_fftextedit.h b/xfa/fxfa/app/xfa_fftextedit.h index 88622e3c50..0c22db7a2f 100644 --- a/xfa/fxfa/app/xfa_fftextedit.h +++ b/xfa/fxfa/app/xfa_fftextedit.h @@ -13,7 +13,7 @@ class CXFA_FFTextEdit : public CXFA_FFField { public: - CXFA_FFTextEdit(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc); + explicit CXFA_FFTextEdit(CXFA_WidgetAcc* pDataAcc); ~CXFA_FFTextEdit() override; // CXFA_FFField @@ -48,7 +48,7 @@ class CXFA_FFTextEdit : public CXFA_FFField { class CXFA_FFNumericEdit : public CXFA_FFTextEdit { public: - CXFA_FFNumericEdit(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc); + explicit CXFA_FFNumericEdit(CXFA_WidgetAcc* pDataAcc); ~CXFA_FFNumericEdit() override; // CXFA_FFTextEdit @@ -62,7 +62,7 @@ class CXFA_FFNumericEdit : public CXFA_FFTextEdit { class CXFA_FFPasswordEdit : public CXFA_FFTextEdit { public: - CXFA_FFPasswordEdit(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc); + explicit CXFA_FFPasswordEdit(CXFA_WidgetAcc* pDataAcc); ~CXFA_FFPasswordEdit() override; // CXFA_FFTextEdit @@ -80,7 +80,7 @@ enum XFA_DATETIMETYPE { class CXFA_FFDateTimeEdit : public CXFA_FFTextEdit { public: - CXFA_FFDateTimeEdit(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc); + explicit CXFA_FFDateTimeEdit(CXFA_WidgetAcc* pDataAcc); ~CXFA_FFDateTimeEdit() override; // CXFA_FFTextEdit diff --git a/xfa/fxfa/app/xfa_ffwidget.cpp b/xfa/fxfa/app/xfa_ffwidget.cpp index c87fa4ef9f..29b10dd195 100644 --- a/xfa/fxfa/app/xfa_ffwidget.cpp +++ b/xfa/fxfa/app/xfa_ffwidget.cpp @@ -32,20 +32,14 @@ #include "xfa/fxgraphics/cfx_pattern.h" #include "xfa/fxgraphics/cfx_shading.h" -CXFA_FFWidget::CXFA_FFWidget(CXFA_FFPageView* pPageView, - CXFA_WidgetAcc* pDataAcc) +CXFA_FFWidget::CXFA_FFWidget(CXFA_WidgetAcc* pDataAcc) : CXFA_ContentLayoutItem(pDataAcc->GetNode()), - m_pPageView(pPageView), + m_pPageView(nullptr), m_pDataAcc(pDataAcc) { m_rtWidget.Set(0, 0, 0, 0); } + CXFA_FFWidget::~CXFA_FFWidget() {} -CXFA_FFPageView* CXFA_FFWidget::GetPageView() { - return m_pPageView; -} -void CXFA_FFWidget::SetPageView(CXFA_FFPageView* pPageView) { - m_pPageView = pPageView; -} const CFWL_App* CXFA_FFWidget::GetFWLApp() { return GetPageView()->GetDocView()->GetDoc()->GetApp()->GetFWLApp(); diff --git a/xfa/fxfa/parser/cxfa_layoutpagemgr.cpp b/xfa/fxfa/parser/cxfa_layoutpagemgr.cpp index 080b06b953..8e004075ce 100644 --- a/xfa/fxfa/parser/cxfa_layoutpagemgr.cpp +++ b/xfa/fxfa/parser/cxfa_layoutpagemgr.cpp @@ -1587,11 +1587,6 @@ void CXFA_LayoutPageMgr::ClearData() { m_pPageSetMap.clear(); } -CXFA_LayoutItem* CXFA_LayoutPageMgr::FindOrCreateLayoutItem( - CXFA_Node* pFormNode) { - return pFormNode->GetDocument()->GetNotify()->OnCreateLayoutItem(pFormNode); -} - void CXFA_LayoutPageMgr::SaveLayoutItem(CXFA_LayoutItem* pParentLayoutItem) { CXFA_LayoutItem* pNextLayoutItem; CXFA_LayoutItem* pCurLayoutItem = pParentLayoutItem->m_pFirstChild; diff --git a/xfa/fxfa/parser/cxfa_layoutpagemgr.h b/xfa/fxfa/parser/cxfa_layoutpagemgr.h index 1133e1778a..3c8e7f9d1e 100644 --- a/xfa/fxfa/parser/cxfa_layoutpagemgr.h +++ b/xfa/fxfa/parser/cxfa_layoutpagemgr.h @@ -50,7 +50,6 @@ class CXFA_LayoutPageMgr { bool ProcessBookendLeaderOrTrailer(CXFA_Node* pBookendNode, bool bLeader, CXFA_Node*& pBookendAppendNode); - CXFA_LayoutItem* FindOrCreateLayoutItem(CXFA_Node* pFormNode); protected: bool AppendNewPage(bool bFirstTemPage = false); diff --git a/xfa/fxfa/xfa_ffwidget.h b/xfa/fxfa/xfa_ffwidget.h index 009cd44dc0..e370de22aa 100644 --- a/xfa/fxfa/xfa_ffwidget.h +++ b/xfa/fxfa/xfa_ffwidget.h @@ -24,7 +24,9 @@ enum class FWL_WidgetHit; inline FX_FLOAT XFA_UnitPx2Pt(FX_FLOAT fPx, FX_FLOAT fDpi) { return fPx * 72.0f / fDpi; } + #define XFA_FLOAT_PERCISION 0.001f + enum XFA_WIDGETITEM { XFA_WIDGETITEM_Parent, XFA_WIDGETITEM_FirstChild, @@ -43,7 +45,7 @@ class CXFA_CalcData { class CXFA_FFWidget : public CXFA_ContentLayoutItem { public: - CXFA_FFWidget(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc); + explicit CXFA_FFWidget(CXFA_WidgetAcc* pDataAcc); ~CXFA_FFWidget() override; virtual bool GetBBox(CFX_RectF& rtBox, @@ -100,8 +102,8 @@ class CXFA_FFWidget : public CXFA_ContentLayoutItem { virtual bool ReplaceSpellCheckWord(CFX_PointF pointf, const CFX_ByteStringC& bsReplace); - CXFA_FFPageView* GetPageView(); - void SetPageView(CXFA_FFPageView* pPageView); + CXFA_FFPageView* GetPageView() const { return m_pPageView; } + void SetPageView(CXFA_FFPageView* pPageView) { m_pPageView = pPageView; } void GetWidgetRect(CFX_RectF& rtWidget); CFX_RectF ReCacheWidgetRect(); uint32_t GetStatus(); |