From f036f12bdf6c6c71fc57f10efa048f4c4732c355 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Thu, 25 Jan 2018 17:33:05 +0000 Subject: Remove empty FF classes This CL removes the empty FFDraw and FFSubForm classes and uses the FFWidget base class directly. Change-Id: If65ee85fda78774bb90d6fec60ca5529cc37f3e0 Reviewed-on: https://pdfium-review.googlesource.com/23971 Reviewed-by: Henrique Nakashima Commit-Queue: dsinclair --- BUILD.gn | 4 ---- xfa/fxfa/README.md | 14 +++++--------- xfa/fxfa/cxfa_ffarc.cpp | 2 +- xfa/fxfa/cxfa_ffarc.h | 4 ++-- xfa/fxfa/cxfa_ffdocview.cpp | 2 -- xfa/fxfa/cxfa_ffdraw.cpp | 16 ---------------- xfa/fxfa/cxfa_ffdraw.h | 21 --------------------- xfa/fxfa/cxfa_ffimage.cpp | 5 ++--- xfa/fxfa/cxfa_ffimage.h | 4 ++-- xfa/fxfa/cxfa_ffline.cpp | 2 +- xfa/fxfa/cxfa_ffline.h | 4 ++-- xfa/fxfa/cxfa_ffnotify.cpp | 3 +-- xfa/fxfa/cxfa_ffrectangle.cpp | 2 +- xfa/fxfa/cxfa_ffrectangle.h | 4 ++-- xfa/fxfa/cxfa_ffsubform.cpp | 16 ---------------- xfa/fxfa/cxfa_ffsubform.h | 19 ------------------- xfa/fxfa/cxfa_fftext.cpp | 5 ++--- xfa/fxfa/cxfa_fftext.h | 4 ++-- 18 files changed, 23 insertions(+), 108 deletions(-) delete mode 100644 xfa/fxfa/cxfa_ffdraw.cpp delete mode 100644 xfa/fxfa/cxfa_ffdraw.h delete mode 100644 xfa/fxfa/cxfa_ffsubform.cpp delete mode 100644 xfa/fxfa/cxfa_ffsubform.h diff --git a/BUILD.gn b/BUILD.gn index 839fffc0b8..4fe979e3d0 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -2023,8 +2023,6 @@ if (pdf_enable_xfa) { "xfa/fxfa/cxfa_ffdoc.h", "xfa/fxfa/cxfa_ffdocview.cpp", "xfa/fxfa/cxfa_ffdocview.h", - "xfa/fxfa/cxfa_ffdraw.cpp", - "xfa/fxfa/cxfa_ffdraw.h", "xfa/fxfa/cxfa_ffexclgroup.cpp", "xfa/fxfa/cxfa_ffexclgroup.h", "xfa/fxfa/cxfa_fffield.cpp", @@ -2051,8 +2049,6 @@ if (pdf_enable_xfa) { "xfa/fxfa/cxfa_ffrectangle.h", "xfa/fxfa/cxfa_ffsignature.cpp", "xfa/fxfa/cxfa_ffsignature.h", - "xfa/fxfa/cxfa_ffsubform.cpp", - "xfa/fxfa/cxfa_ffsubform.h", "xfa/fxfa/cxfa_fftext.cpp", "xfa/fxfa/cxfa_fftext.h", "xfa/fxfa/cxfa_fftextedit.cpp", diff --git a/xfa/fxfa/README.md b/xfa/fxfa/README.md index b554ce0f43..3b5ae9f4f2 100644 --- a/xfa/fxfa/README.md +++ b/xfa/fxfa/README.md @@ -6,12 +6,11 @@ The main hierarchy in this directory are the form elements: * CXFA_ContentLayoutItem * CXFA_FFPageView * CXFA_FFWidget - * CXFA_FFDraw - * CXFA_FFArc - * CXFA_FFImage - * CXFA_FFLine - * CXFA_FFRectangle - * CXFA_FFText + * CXFA_FFArc + * CXFA_FFImage + * CXFA_FFLine + * CXFA_FFRectangle + * CXFA_FFText * CXFA_FFExclGroup * CXFA_FFField * CXFA_FFCheckButton @@ -25,9 +24,6 @@ The main hierarchy in this directory are the form elements: * CXFA_FFDateTimeEdit * CXFA_FFNumericEdit * CXFA_FFPasswordEdit - * CXFA_FFSubform - -CXFA_FFDraw is the base class for static elements like text and images. CXFA_FFField is the base class for widgets. It owns a lower level CFWL widget instance from xfa/fwl. The correspondence is: diff --git a/xfa/fxfa/cxfa_ffarc.cpp b/xfa/fxfa/cxfa_ffarc.cpp index 64a4f70a61..0c842e4f64 100644 --- a/xfa/fxfa/cxfa_ffarc.cpp +++ b/xfa/fxfa/cxfa_ffarc.cpp @@ -9,7 +9,7 @@ #include "xfa/fxfa/parser/cxfa_arc.h" #include "xfa/fxfa/parser/cxfa_value.h" -CXFA_FFArc::CXFA_FFArc(CXFA_Node* pNode) : CXFA_FFDraw(pNode) {} +CXFA_FFArc::CXFA_FFArc(CXFA_Node* pNode) : CXFA_FFWidget(pNode) {} CXFA_FFArc::~CXFA_FFArc() {} diff --git a/xfa/fxfa/cxfa_ffarc.h b/xfa/fxfa/cxfa_ffarc.h index f76511995d..8e8b292500 100644 --- a/xfa/fxfa/cxfa_ffarc.h +++ b/xfa/fxfa/cxfa_ffarc.h @@ -7,9 +7,9 @@ #ifndef XFA_FXFA_CXFA_FFARC_H_ #define XFA_FXFA_CXFA_FFARC_H_ -#include "xfa/fxfa/cxfa_ffdraw.h" +#include "xfa/fxfa/cxfa_ffwidget.h" -class CXFA_FFArc : public CXFA_FFDraw { +class CXFA_FFArc : public CXFA_FFWidget { public: explicit CXFA_FFArc(CXFA_Node* pnode); ~CXFA_FFArc() override; diff --git a/xfa/fxfa/cxfa_ffdocview.cpp b/xfa/fxfa/cxfa_ffdocview.cpp index 5e3ef01e7c..8db075b3a5 100644 --- a/xfa/fxfa/cxfa_ffdocview.cpp +++ b/xfa/fxfa/cxfa_ffdocview.cpp @@ -15,7 +15,6 @@ #include "xfa/fxfa/cxfa_ffbarcode.h" #include "xfa/fxfa/cxfa_ffcheckbutton.h" #include "xfa/fxfa/cxfa_ffdoc.h" -#include "xfa/fxfa/cxfa_ffdraw.h" #include "xfa/fxfa/cxfa_ffexclgroup.h" #include "xfa/fxfa/cxfa_fffield.h" #include "xfa/fxfa/cxfa_ffimage.h" @@ -23,7 +22,6 @@ #include "xfa/fxfa/cxfa_ffpageview.h" #include "xfa/fxfa/cxfa_ffpushbutton.h" #include "xfa/fxfa/cxfa_ffsignature.h" -#include "xfa/fxfa/cxfa_ffsubform.h" #include "xfa/fxfa/cxfa_fftext.h" #include "xfa/fxfa/cxfa_ffwidget.h" #include "xfa/fxfa/cxfa_ffwidgethandler.h" diff --git a/xfa/fxfa/cxfa_ffdraw.cpp b/xfa/fxfa/cxfa_ffdraw.cpp deleted file mode 100644 index 420bde1d7c..0000000000 --- a/xfa/fxfa/cxfa_ffdraw.cpp +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2014 PDFium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com - -#include "xfa/fxfa/cxfa_ffdraw.h" - -#include "xfa/fxfa/cxfa_ffapp.h" -#include "xfa/fxfa/cxfa_ffdoc.h" -#include "xfa/fxfa/cxfa_ffpageview.h" -#include "xfa/fxfa/cxfa_ffwidget.h" - -CXFA_FFDraw::CXFA_FFDraw(CXFA_Node* pNode) : CXFA_FFWidget(pNode) {} - -CXFA_FFDraw::~CXFA_FFDraw() {} diff --git a/xfa/fxfa/cxfa_ffdraw.h b/xfa/fxfa/cxfa_ffdraw.h deleted file mode 100644 index 697359766f..0000000000 --- a/xfa/fxfa/cxfa_ffdraw.h +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2014 PDFium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com - -#ifndef XFA_FXFA_CXFA_FFDRAW_H_ -#define XFA_FXFA_CXFA_FFDRAW_H_ - -#include "xfa/fxfa/cxfa_ffpageview.h" -#include "xfa/fxfa/cxfa_ffwidget.h" - -class CXFA_FFDraw : public CXFA_FFWidget { - public: - ~CXFA_FFDraw() override; - - protected: - explicit CXFA_FFDraw(CXFA_Node* pNode); -}; - -#endif // XFA_FXFA_CXFA_FFDRAW_H_ diff --git a/xfa/fxfa/cxfa_ffimage.cpp b/xfa/fxfa/cxfa_ffimage.cpp index da3b7b5c5b..a80b19a337 100644 --- a/xfa/fxfa/cxfa_ffimage.cpp +++ b/xfa/fxfa/cxfa_ffimage.cpp @@ -9,14 +9,13 @@ #include "core/fxge/dib/cfx_dibitmap.h" #include "xfa/fxfa/cxfa_ffapp.h" #include "xfa/fxfa/cxfa_ffdoc.h" -#include "xfa/fxfa/cxfa_ffdraw.h" #include "xfa/fxfa/cxfa_ffpageview.h" #include "xfa/fxfa/cxfa_ffwidget.h" #include "xfa/fxfa/parser/cxfa_image.h" #include "xfa/fxfa/parser/cxfa_para.h" #include "xfa/fxfa/parser/cxfa_value.h" -CXFA_FFImage::CXFA_FFImage(CXFA_Node* pNode) : CXFA_FFDraw(pNode) {} +CXFA_FFImage::CXFA_FFImage(CXFA_Node* pNode) : CXFA_FFWidget(pNode) {} CXFA_FFImage::~CXFA_FFImage() { CXFA_FFImage::UnloadWidget(); @@ -30,7 +29,7 @@ bool CXFA_FFImage::LoadWidget() { if (GetNode()->GetImageImage()) return true; - return GetNode()->LoadImageImage(GetDoc()) ? CXFA_FFDraw::LoadWidget() + return GetNode()->LoadImageImage(GetDoc()) ? CXFA_FFWidget::LoadWidget() : false; } diff --git a/xfa/fxfa/cxfa_ffimage.h b/xfa/fxfa/cxfa_ffimage.h index c721b110f3..9f289dce64 100644 --- a/xfa/fxfa/cxfa_ffimage.h +++ b/xfa/fxfa/cxfa_ffimage.h @@ -7,9 +7,9 @@ #ifndef XFA_FXFA_CXFA_FFIMAGE_H_ #define XFA_FXFA_CXFA_FFIMAGE_H_ -#include "xfa/fxfa/cxfa_ffdraw.h" +#include "xfa/fxfa/cxfa_ffwidget.h" -class CXFA_FFImage : public CXFA_FFDraw { +class CXFA_FFImage : public CXFA_FFWidget { public: explicit CXFA_FFImage(CXFA_Node* pNode); ~CXFA_FFImage() override; diff --git a/xfa/fxfa/cxfa_ffline.cpp b/xfa/fxfa/cxfa_ffline.cpp index 4937a0e7cc..6ef3d1d35c 100644 --- a/xfa/fxfa/cxfa_ffline.cpp +++ b/xfa/fxfa/cxfa_ffline.cpp @@ -29,7 +29,7 @@ CFX_GraphStateData::LineCap LineCapToFXGE(XFA_AttributeEnum iLineCap) { } // namespace -CXFA_FFLine::CXFA_FFLine(CXFA_Node* pNode) : CXFA_FFDraw(pNode) {} +CXFA_FFLine::CXFA_FFLine(CXFA_Node* pNode) : CXFA_FFWidget(pNode) {} CXFA_FFLine::~CXFA_FFLine() {} diff --git a/xfa/fxfa/cxfa_ffline.h b/xfa/fxfa/cxfa_ffline.h index 01f3fd3f81..ff8d46134e 100644 --- a/xfa/fxfa/cxfa_ffline.h +++ b/xfa/fxfa/cxfa_ffline.h @@ -7,9 +7,9 @@ #ifndef XFA_FXFA_CXFA_FFLINE_H_ #define XFA_FXFA_CXFA_FFLINE_H_ -#include "xfa/fxfa/cxfa_ffdraw.h" +#include "xfa/fxfa/cxfa_ffwidget.h" -class CXFA_FFLine : public CXFA_FFDraw { +class CXFA_FFLine : public CXFA_FFWidget { public: explicit CXFA_FFLine(CXFA_Node* pNode); ~CXFA_FFLine() override; diff --git a/xfa/fxfa/cxfa_ffnotify.cpp b/xfa/fxfa/cxfa_ffnotify.cpp index 009458912a..588df5ba49 100644 --- a/xfa/fxfa/cxfa_ffnotify.cpp +++ b/xfa/fxfa/cxfa_ffnotify.cpp @@ -29,7 +29,6 @@ #include "xfa/fxfa/cxfa_ffpushbutton.h" #include "xfa/fxfa/cxfa_ffrectangle.h" #include "xfa/fxfa/cxfa_ffsignature.h" -#include "xfa/fxfa/cxfa_ffsubform.h" #include "xfa/fxfa/cxfa_fftext.h" #include "xfa/fxfa/cxfa_ffwidget.h" #include "xfa/fxfa/cxfa_ffwidgethandler.h" @@ -168,7 +167,7 @@ CXFA_ContentLayoutItem* CXFA_FFNotify::OnCreateContentLayoutItem( pWidget = new CXFA_FFImage(pNode); break; case XFA_Element::Subform: - pWidget = new CXFA_FFSubForm(pNode); + pWidget = new CXFA_FFWidget(pNode); break; case XFA_Element::ExclGroup: pWidget = new CXFA_FFExclGroup(pNode); diff --git a/xfa/fxfa/cxfa_ffrectangle.cpp b/xfa/fxfa/cxfa_ffrectangle.cpp index 46c1009844..e02a630568 100644 --- a/xfa/fxfa/cxfa_ffrectangle.cpp +++ b/xfa/fxfa/cxfa_ffrectangle.cpp @@ -9,7 +9,7 @@ #include "xfa/fxfa/parser/cxfa_rectangle.h" #include "xfa/fxfa/parser/cxfa_value.h" -CXFA_FFRectangle::CXFA_FFRectangle(CXFA_Node* pNode) : CXFA_FFDraw(pNode) {} +CXFA_FFRectangle::CXFA_FFRectangle(CXFA_Node* pNode) : CXFA_FFWidget(pNode) {} CXFA_FFRectangle::~CXFA_FFRectangle() {} diff --git a/xfa/fxfa/cxfa_ffrectangle.h b/xfa/fxfa/cxfa_ffrectangle.h index 304c5c69a9..d05f4d7f81 100644 --- a/xfa/fxfa/cxfa_ffrectangle.h +++ b/xfa/fxfa/cxfa_ffrectangle.h @@ -7,9 +7,9 @@ #ifndef XFA_FXFA_CXFA_FFRECTANGLE_H_ #define XFA_FXFA_CXFA_FFRECTANGLE_H_ -#include "xfa/fxfa/cxfa_ffdraw.h" +#include "xfa/fxfa/cxfa_ffwidget.h" -class CXFA_FFRectangle : public CXFA_FFDraw { +class CXFA_FFRectangle : public CXFA_FFWidget { public: explicit CXFA_FFRectangle(CXFA_Node* pNode); ~CXFA_FFRectangle() override; diff --git a/xfa/fxfa/cxfa_ffsubform.cpp b/xfa/fxfa/cxfa_ffsubform.cpp deleted file mode 100644 index 97a075026d..0000000000 --- a/xfa/fxfa/cxfa_ffsubform.cpp +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2014 PDFium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com - -#include "xfa/fxfa/cxfa_ffsubform.h" - -#include "xfa/fxfa/cxfa_ffapp.h" -#include "xfa/fxfa/cxfa_ffdoc.h" -#include "xfa/fxfa/cxfa_ffpageview.h" -#include "xfa/fxfa/cxfa_ffwidget.h" - -CXFA_FFSubForm::CXFA_FFSubForm(CXFA_Node* pNode) : CXFA_FFWidget(pNode) {} - -CXFA_FFSubForm::~CXFA_FFSubForm() {} diff --git a/xfa/fxfa/cxfa_ffsubform.h b/xfa/fxfa/cxfa_ffsubform.h deleted file mode 100644 index a69b571566..0000000000 --- a/xfa/fxfa/cxfa_ffsubform.h +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2014 PDFium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com - -#ifndef XFA_FXFA_CXFA_FFSUBFORM_H_ -#define XFA_FXFA_CXFA_FFSUBFORM_H_ - -#include "xfa/fxfa/cxfa_ffpageview.h" -#include "xfa/fxfa/cxfa_ffwidget.h" - -class CXFA_FFSubForm : public CXFA_FFWidget { - public: - explicit CXFA_FFSubForm(CXFA_Node* pNode); - ~CXFA_FFSubForm() override; -}; - -#endif // XFA_FXFA_CXFA_FFSUBFORM_H_ diff --git a/xfa/fxfa/cxfa_fftext.cpp b/xfa/fxfa/cxfa_fftext.cpp index 702de64216..a446993520 100644 --- a/xfa/fxfa/cxfa_fftext.cpp +++ b/xfa/fxfa/cxfa_fftext.cpp @@ -10,7 +10,6 @@ #include "xfa/fwl/fwl_widgethit.h" #include "xfa/fxfa/cxfa_ffapp.h" #include "xfa/fxfa/cxfa_ffdoc.h" -#include "xfa/fxfa/cxfa_ffdraw.h" #include "xfa/fxfa/cxfa_ffpageview.h" #include "xfa/fxfa/cxfa_ffwidget.h" #include "xfa/fxfa/cxfa_linkuserdata.h" @@ -20,7 +19,7 @@ #include "xfa/fxfa/parser/cxfa_margin.h" #include "xfa/fxgraphics/cxfa_graphics.h" -CXFA_FFText::CXFA_FFText(CXFA_Node* pNode) : CXFA_FFDraw(pNode) {} +CXFA_FFText::CXFA_FFText(CXFA_Node* pNode) : CXFA_FFWidget(pNode) {} CXFA_FFText::~CXFA_FFText() {} @@ -71,7 +70,7 @@ bool CXFA_FFText::IsLoaded() { } bool CXFA_FFText::PerformLayout() { - CXFA_FFDraw::PerformLayout(); + CXFA_FFWidget::PerformLayout(); CXFA_TextLayout* pTextLayout = m_pNode->GetTextLayout(); if (!pTextLayout) return false; diff --git a/xfa/fxfa/cxfa_fftext.h b/xfa/fxfa/cxfa_fftext.h index 8c32183d6c..8eeb523772 100644 --- a/xfa/fxfa/cxfa_fftext.h +++ b/xfa/fxfa/cxfa_fftext.h @@ -7,9 +7,9 @@ #ifndef XFA_FXFA_CXFA_FFTEXT_H_ #define XFA_FXFA_CXFA_FFTEXT_H_ -#include "xfa/fxfa/cxfa_ffdraw.h" +#include "xfa/fxfa/cxfa_ffwidget.h" -class CXFA_FFText : public CXFA_FFDraw { +class CXFA_FFText : public CXFA_FFWidget { public: explicit CXFA_FFText(CXFA_Node* pNode); ~CXFA_FFText() override; -- cgit v1.2.3