From 0b851fffe118d8be26e776256144a6b85495ce74 Mon Sep 17 00:00:00 2001 From: dsinclair Date: Thu, 21 Jul 2016 12:03:01 -0700 Subject: Rename xfa_doclayout and xfa_document_layout_imp files. This Cl moves the xfa_doclayout and xfa_document_layout_imp files to have names based off of their classes. Review-Url: https://codereview.chromium.org/2170473002 --- BUILD.gn | 12 +- xfa.gyp | 12 +- xfa/fxfa/app/xfa_ffdocview.cpp | 2 +- xfa/fxfa/app/xfa_ffpageview.cpp | 8 +- xfa/fxfa/app/xfa_ffwidgetacc.cpp | 2 +- xfa/fxfa/app/xfa_ffwidgethandler.cpp | 2 +- xfa/fxfa/include/xfa_ffpageview.h | 4 +- xfa/fxfa/include/xfa_ffwidget.h | 2 +- xfa/fxfa/parser/cscript_datawindow.cpp | 1 - xfa/fxfa/parser/cscript_eventpseudomodel.cpp | 1 - xfa/fxfa/parser/cscript_hostpseudomodel.cpp | 3 +- xfa/fxfa/parser/cscript_layoutpseudomodel.cpp | 6 +- xfa/fxfa/parser/cscript_layoutpseudomodel.h | 3 +- xfa/fxfa/parser/cscript_logpseudomodel.cpp | 1 - xfa/fxfa/parser/cscript_signaturepseudomodel.cpp | 1 - xfa/fxfa/parser/cxfa_containerlayoutitem.cpp | 44 +++++ xfa/fxfa/parser/cxfa_containerlayoutitem.h | 28 +++ xfa/fxfa/parser/cxfa_contentlayoutitem.cpp | 18 ++ xfa/fxfa/parser/cxfa_contentlayoutitem.h | 28 +++ xfa/fxfa/parser/cxfa_layoutitem.cpp | 28 +++ xfa/fxfa/parser/cxfa_layoutitem.h | 54 ++++++ xfa/fxfa/parser/cxfa_layoutprocessor.cpp | 163 +++++++++++++++++ xfa/fxfa/parser/cxfa_layoutprocessor.h | 55 ++++++ xfa/fxfa/parser/cxfa_node.cpp | 2 +- xfa/fxfa/parser/cxfa_nodehelper.cpp | 1 - xfa/fxfa/parser/cxfa_resolveprocessor.cpp | 1 - xfa/fxfa/parser/cxfa_scriptcontext.cpp | 1 - xfa/fxfa/parser/cxfa_traversestrategy_layoutitem.h | 25 +++ xfa/fxfa/parser/xfa_doclayout.h | 106 ----------- xfa/fxfa/parser/xfa_document_datamerger_imp.cpp | 3 +- xfa/fxfa/parser/xfa_document_imp.cpp | 3 +- xfa/fxfa/parser/xfa_document_layout_imp.cpp | 203 --------------------- xfa/fxfa/parser/xfa_document_layout_imp.h | 50 ----- xfa/fxfa/parser/xfa_document_serialize.cpp | 1 - xfa/fxfa/parser/xfa_layout_appadapter.cpp | 2 - xfa/fxfa/parser/xfa_layout_appadapter.h | 4 +- xfa/fxfa/parser/xfa_layout_itemlayout.cpp | 2 - xfa/fxfa/parser/xfa_layout_itemlayout.h | 4 +- xfa/fxfa/parser/xfa_layout_pagemgr_new.cpp | 4 +- xfa/fxfa/parser/xfa_layout_pagemgr_new.h | 3 +- xfa/fxfa/parser/xfa_locale.cpp | 1 - xfa/fxfa/parser/xfa_localemgr.cpp | 1 - xfa/fxfa/parser/xfa_localevalue.cpp | 1 - xfa/fxfa/parser/xfa_utils_imp.cpp | 1 - 44 files changed, 490 insertions(+), 407 deletions(-) create mode 100644 xfa/fxfa/parser/cxfa_containerlayoutitem.cpp create mode 100644 xfa/fxfa/parser/cxfa_containerlayoutitem.h create mode 100644 xfa/fxfa/parser/cxfa_contentlayoutitem.cpp create mode 100644 xfa/fxfa/parser/cxfa_contentlayoutitem.h create mode 100644 xfa/fxfa/parser/cxfa_layoutitem.cpp create mode 100644 xfa/fxfa/parser/cxfa_layoutitem.h create mode 100644 xfa/fxfa/parser/cxfa_layoutprocessor.cpp create mode 100644 xfa/fxfa/parser/cxfa_layoutprocessor.h create mode 100644 xfa/fxfa/parser/cxfa_traversestrategy_layoutitem.h delete mode 100644 xfa/fxfa/parser/xfa_doclayout.h delete mode 100644 xfa/fxfa/parser/xfa_document_layout_imp.cpp delete mode 100644 xfa/fxfa/parser/xfa_document_layout_imp.h diff --git a/BUILD.gn b/BUILD.gn index 996f7be185..7372cb8e16 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -1363,6 +1363,10 @@ if (pdf_enable_xfa) { "xfa/fxfa/parser/cxfa_calculate.h", "xfa/fxfa/parser/cxfa_caption.cpp", "xfa/fxfa/parser/cxfa_caption.h", + "xfa/fxfa/parser/cxfa_containerlayoutitem.cpp", + "xfa/fxfa/parser/cxfa_containerlayoutitem.h", + "xfa/fxfa/parser/cxfa_contentlayoutitem.cpp", + "xfa/fxfa/parser/cxfa_contentlayoutitem.h", "xfa/fxfa/parser/cxfa_corner.h", "xfa/fxfa/parser/cxfa_data.cpp", "xfa/fxfa/parser/cxfa_data.h", @@ -1379,6 +1383,10 @@ if (pdf_enable_xfa) { "xfa/fxfa/parser/cxfa_font.h", "xfa/fxfa/parser/cxfa_image.cpp", "xfa/fxfa/parser/cxfa_image.h", + "xfa/fxfa/parser/cxfa_layoutitem.cpp", + "xfa/fxfa/parser/cxfa_layoutitem.h", + "xfa/fxfa/parser/cxfa_layoutprocessor.cpp", + "xfa/fxfa/parser/cxfa_layoutprocessor.h", "xfa/fxfa/parser/cxfa_line.cpp", "xfa/fxfa/parser/cxfa_line.h", "xfa/fxfa/parser/cxfa_margin.cpp", @@ -1412,6 +1420,7 @@ if (pdf_enable_xfa) { "xfa/fxfa/parser/cxfa_thisproxy.cpp", "xfa/fxfa/parser/cxfa_tooltip.cpp", "xfa/fxfa/parser/cxfa_tooltip.h", + "xfa/fxfa/parser/cxfa_traversestrategy_layoutitem.h", "xfa/fxfa/parser/cxfa_validate.cpp", "xfa/fxfa/parser/cxfa_validate.h", "xfa/fxfa/parser/cxfa_value.cpp", @@ -1432,13 +1441,10 @@ if (pdf_enable_xfa) { "xfa/fxfa/parser/xfa_basic_data_element_script.cpp", "xfa/fxfa/parser/xfa_basic_data_enum.cpp", "xfa/fxfa/parser/xfa_basic_data_packets.cpp", - "xfa/fxfa/parser/xfa_doclayout.h", "xfa/fxfa/parser/xfa_document.h", "xfa/fxfa/parser/xfa_document_datamerger_imp.cpp", "xfa/fxfa/parser/xfa_document_datamerger_imp.h", "xfa/fxfa/parser/xfa_document_imp.cpp", - "xfa/fxfa/parser/xfa_document_layout_imp.cpp", - "xfa/fxfa/parser/xfa_document_layout_imp.h", "xfa/fxfa/parser/xfa_document_serialize.cpp", "xfa/fxfa/parser/xfa_document_serialize.h", "xfa/fxfa/parser/xfa_layout_appadapter.cpp", diff --git a/xfa.gyp b/xfa.gyp index 72e2922424..caefb9b1f0 100644 --- a/xfa.gyp +++ b/xfa.gyp @@ -469,6 +469,10 @@ "xfa/fxfa/parser/cxfa_caption.cpp", "xfa/fxfa/parser/cxfa_caption.h", "xfa/fxfa/parser/cxfa_corner.h", + "xfa/fxfa/parser/cxfa_containerlayoutitem.cpp", + "xfa/fxfa/parser/cxfa_containerlayoutitem.h", + "xfa/fxfa/parser/cxfa_contentlayoutitem.cpp", + "xfa/fxfa/parser/cxfa_contentlayoutitem.h", "xfa/fxfa/parser/cxfa_data.cpp", "xfa/fxfa/parser/cxfa_data.h", "xfa/fxfa/parser/cxfa_document_parser.cpp", @@ -484,6 +488,10 @@ "xfa/fxfa/parser/cxfa_font.h", "xfa/fxfa/parser/cxfa_image.cpp", "xfa/fxfa/parser/cxfa_image.h", + "xfa/fxfa/parser/cxfa_layoutitem.cpp", + "xfa/fxfa/parser/cxfa_layoutitem.h", + "xfa/fxfa/parser/cxfa_layoutprocessor.cpp", + "xfa/fxfa/parser/cxfa_layoutprocessor.h", "xfa/fxfa/parser/cxfa_line.cpp", "xfa/fxfa/parser/cxfa_line.h", "xfa/fxfa/parser/cxfa_margin.cpp", @@ -517,6 +525,7 @@ "xfa/fxfa/parser/cxfa_thisproxy.cpp", "xfa/fxfa/parser/cxfa_tooltip.cpp", "xfa/fxfa/parser/cxfa_tooltip.h", + "xfa/fxfa/parser/cxfa_traversestrategy_layoutitem.h", "xfa/fxfa/parser/cxfa_validate.cpp", "xfa/fxfa/parser/cxfa_validate.h", "xfa/fxfa/parser/cxfa_value.cpp", @@ -537,13 +546,10 @@ "xfa/fxfa/parser/xfa_basic_data_enum.cpp", "xfa/fxfa/parser/xfa_basic_data_packets.cpp", "xfa/fxfa/parser/xfa_basic_data.h", - "xfa/fxfa/parser/xfa_doclayout.h", "xfa/fxfa/parser/xfa_document.h", "xfa/fxfa/parser/xfa_document_datamerger_imp.cpp", "xfa/fxfa/parser/xfa_document_datamerger_imp.h", "xfa/fxfa/parser/xfa_document_imp.cpp", - "xfa/fxfa/parser/xfa_document_layout_imp.cpp", - "xfa/fxfa/parser/xfa_document_layout_imp.h", "xfa/fxfa/parser/xfa_document_serialize.cpp", "xfa/fxfa/parser/xfa_document_serialize.h", "xfa/fxfa/parser/xfa_layout_appadapter.cpp", diff --git a/xfa/fxfa/app/xfa_ffdocview.cpp b/xfa/fxfa/app/xfa_ffdocview.cpp index bbed31be25..e361be8974 100644 --- a/xfa/fxfa/app/xfa_ffdocview.cpp +++ b/xfa/fxfa/app/xfa_ffdocview.cpp @@ -30,8 +30,8 @@ #include "xfa/fxfa/include/xfa_ffwidget.h" #include "xfa/fxfa/include/xfa_ffwidgethandler.h" #include "xfa/fxfa/parser/cxfa_binditems.h" +#include "xfa/fxfa/parser/cxfa_layoutprocessor.h" #include "xfa/fxfa/parser/cxfa_scriptcontext.h" -#include "xfa/fxfa/parser/xfa_document_layout_imp.h" #include "xfa/fxfa/parser/xfa_resolvenode_rs.h" extern const XFA_ATTRIBUTEENUM gs_EventActivity[] = { diff --git a/xfa/fxfa/app/xfa_ffpageview.cpp b/xfa/fxfa/app/xfa_ffpageview.cpp index c1417c72a4..347174c7f2 100644 --- a/xfa/fxfa/app/xfa_ffpageview.cpp +++ b/xfa/fxfa/app/xfa_ffpageview.cpp @@ -121,15 +121,13 @@ CXFA_FFDocView* CXFA_FFPageView::GetDocView() const { } void CXFA_FFPageView::GetPageViewRect(CFX_RectF& rtPage) const { - CFX_SizeF sz; - GetPageSize(sz); - rtPage.Set(0, 0, sz); + rtPage.Set(0, 0, GetPageSize()); } + void CXFA_FFPageView::GetDisplayMatrix(CFX_Matrix& mt, const CFX_Rect& rtDisp, int32_t iRotate) const { - CFX_SizeF sz; - GetPageSize(sz); + CFX_SizeF sz = GetPageSize(); CFX_RectF fdePage; fdePage.Set(0, 0, sz.x, sz.y); GetPageMatrix(mt, fdePage, rtDisp, iRotate, 0); diff --git a/xfa/fxfa/app/xfa_ffwidgetacc.cpp b/xfa/fxfa/app/xfa_ffwidgetacc.cpp index 57bd7bf80d..075f2aa548 100644 --- a/xfa/fxfa/app/xfa_ffwidgetacc.cpp +++ b/xfa/fxfa/app/xfa_ffwidgetacc.cpp @@ -24,8 +24,8 @@ #include "xfa/fxfa/include/xfa_ffpageview.h" #include "xfa/fxfa/include/xfa_ffwidget.h" #include "xfa/fxfa/include/xfa_fontmgr.h" +#include "xfa/fxfa/parser/cxfa_layoutprocessor.h" #include "xfa/fxfa/parser/cxfa_scriptcontext.h" -#include "xfa/fxfa/parser/xfa_document_layout_imp.h" #include "xfa/fxfa/parser/xfa_localevalue.h" #include "xfa/fxfa/parser/xfa_resolvenode_rs.h" diff --git a/xfa/fxfa/app/xfa_ffwidgethandler.cpp b/xfa/fxfa/app/xfa_ffwidgethandler.cpp index 5b2577b920..7d3da448bf 100644 --- a/xfa/fxfa/app/xfa_ffwidgethandler.cpp +++ b/xfa/fxfa/app/xfa_ffwidgethandler.cpp @@ -14,8 +14,8 @@ #include "xfa/fxfa/include/xfa_ffdoc.h" #include "xfa/fxfa/include/xfa_ffdocview.h" #include "xfa/fxfa/include/xfa_ffwidget.h" +#include "xfa/fxfa/parser/cxfa_layoutprocessor.h" #include "xfa/fxfa/parser/cxfa_measurement.h" -#include "xfa/fxfa/parser/xfa_document_layout_imp.h" CXFA_FFWidgetHandler::CXFA_FFWidgetHandler(CXFA_FFDocView* pDocView) : m_pDocView(pDocView) {} diff --git a/xfa/fxfa/include/xfa_ffpageview.h b/xfa/fxfa/include/xfa_ffpageview.h index 2c703b0b00..6b22dfe7b8 100644 --- a/xfa/fxfa/include/xfa_ffpageview.h +++ b/xfa/fxfa/include/xfa_ffpageview.h @@ -7,7 +7,9 @@ #ifndef XFA_FXFA_INCLUDE_XFA_FFPAGEVIEW_H_ #define XFA_FXFA_INCLUDE_XFA_FFPAGEVIEW_H_ -#include "xfa/fxfa/parser/xfa_doclayout.h" +#include "xfa/fxfa/parser/cxfa_containerlayoutitem.h" +#include "xfa/fxfa/parser/cxfa_contentlayoutitem.h" +#include "xfa/fxfa/parser/cxfa_traversestrategy_layoutitem.h" class CXFA_FFWidget; class CXFA_FFDocView; diff --git a/xfa/fxfa/include/xfa_ffwidget.h b/xfa/fxfa/include/xfa_ffwidget.h index 23a9a82c85..bde247fab4 100644 --- a/xfa/fxfa/include/xfa_ffwidget.h +++ b/xfa/fxfa/include/xfa_ffwidget.h @@ -12,7 +12,7 @@ #include "core/fxcodec/include/fx_codec_def.h" #include "core/fxge/include/fx_ge.h" #include "xfa/fxfa/include/fxfa.h" -#include "xfa/fxfa/parser/xfa_doclayout.h" +#include "xfa/fxfa/parser/cxfa_contentlayoutitem.h" class CXFA_FFPageView; class CXFA_FFDocView; diff --git a/xfa/fxfa/parser/cscript_datawindow.cpp b/xfa/fxfa/parser/cscript_datawindow.cpp index 43f22446e3..9378b2013c 100644 --- a/xfa/fxfa/parser/cscript_datawindow.cpp +++ b/xfa/fxfa/parser/cscript_datawindow.cpp @@ -7,7 +7,6 @@ #include "xfa/fxfa/parser/cscript_datawindow.h" #include "fxjs/include/cfxjse_arguments.h" -#include "xfa/fxfa/parser/xfa_doclayout.h" #include "xfa/fxfa/parser/xfa_document.h" #include "xfa/fxfa/parser/xfa_localemgr.h" #include "xfa/fxfa/parser/xfa_object.h" diff --git a/xfa/fxfa/parser/cscript_eventpseudomodel.cpp b/xfa/fxfa/parser/cscript_eventpseudomodel.cpp index 6b08cdc92b..16b25862b4 100644 --- a/xfa/fxfa/parser/cscript_eventpseudomodel.cpp +++ b/xfa/fxfa/parser/cscript_eventpseudomodel.cpp @@ -11,7 +11,6 @@ #include "xfa/fxfa/include/cxfa_eventparam.h" #include "xfa/fxfa/include/xfa_ffwidgethandler.h" #include "xfa/fxfa/parser/cxfa_scriptcontext.h" -#include "xfa/fxfa/parser/xfa_doclayout.h" #include "xfa/fxfa/parser/xfa_document.h" #include "xfa/fxfa/parser/xfa_localemgr.h" #include "xfa/fxfa/parser/xfa_object.h" diff --git a/xfa/fxfa/parser/cscript_hostpseudomodel.cpp b/xfa/fxfa/parser/cscript_hostpseudomodel.cpp index eb4fcd9a29..a6487351e6 100644 --- a/xfa/fxfa/parser/cscript_hostpseudomodel.cpp +++ b/xfa/fxfa/parser/cscript_hostpseudomodel.cpp @@ -8,10 +8,9 @@ #include "fxjs/include/cfxjse_arguments.h" #include "xfa/fxfa/app/xfa_ffnotify.h" +#include "xfa/fxfa/parser/cxfa_layoutprocessor.h" #include "xfa/fxfa/parser/cxfa_scriptcontext.h" -#include "xfa/fxfa/parser/xfa_doclayout.h" #include "xfa/fxfa/parser/xfa_document.h" -#include "xfa/fxfa/parser/xfa_document_layout_imp.h" #include "xfa/fxfa/parser/xfa_localemgr.h" #include "xfa/fxfa/parser/xfa_object.h" #include "xfa/fxfa/parser/xfa_resolvenode_rs.h" diff --git a/xfa/fxfa/parser/cscript_layoutpseudomodel.cpp b/xfa/fxfa/parser/cscript_layoutpseudomodel.cpp index fe504c4cb5..227a2074f6 100644 --- a/xfa/fxfa/parser/cscript_layoutpseudomodel.cpp +++ b/xfa/fxfa/parser/cscript_layoutpseudomodel.cpp @@ -11,11 +11,13 @@ #include "fxjs/include/cfxjse_arguments.h" #include "third_party/base/stl_util.h" #include "xfa/fxfa/app/xfa_ffnotify.h" +#include "xfa/fxfa/parser/cxfa_containerlayoutitem.h" +#include "xfa/fxfa/parser/cxfa_contentlayoutitem.h" +#include "xfa/fxfa/parser/cxfa_layoutitem.h" +#include "xfa/fxfa/parser/cxfa_layoutprocessor.h" #include "xfa/fxfa/parser/cxfa_measurement.h" #include "xfa/fxfa/parser/cxfa_scriptcontext.h" -#include "xfa/fxfa/parser/xfa_doclayout.h" #include "xfa/fxfa/parser/xfa_document.h" -#include "xfa/fxfa/parser/xfa_document_layout_imp.h" #include "xfa/fxfa/parser/xfa_layout_appadapter.h" #include "xfa/fxfa/parser/xfa_localemgr.h" #include "xfa/fxfa/parser/xfa_object.h" diff --git a/xfa/fxfa/parser/cscript_layoutpseudomodel.h b/xfa/fxfa/parser/cscript_layoutpseudomodel.h index f812c3d330..793e43cfff 100644 --- a/xfa/fxfa/parser/cscript_layoutpseudomodel.h +++ b/xfa/fxfa/parser/cscript_layoutpseudomodel.h @@ -8,7 +8,6 @@ #define XFA_FXFA_PARSER_CSCRIPT_LAYOUTPSEUDOMODEL_H_ #include "fxjs/include/cfxjse_arguments.h" -#include "xfa/fxfa/parser/xfa_doclayout.h" #include "xfa/fxfa/parser/xfa_object.h" enum XFA_LAYOUTMODEL_HWXY { @@ -18,6 +17,8 @@ enum XFA_LAYOUTMODEL_HWXY { XFA_LAYOUTMODEL_Y }; +class CXFA_LayoutProcessor; + class CScript_LayoutPseudoModel : public CXFA_Object { public: explicit CScript_LayoutPseudoModel(CXFA_Document* pDocument); diff --git a/xfa/fxfa/parser/cscript_logpseudomodel.cpp b/xfa/fxfa/parser/cscript_logpseudomodel.cpp index fbb13af035..247a81d26a 100644 --- a/xfa/fxfa/parser/cscript_logpseudomodel.cpp +++ b/xfa/fxfa/parser/cscript_logpseudomodel.cpp @@ -7,7 +7,6 @@ #include "xfa/fxfa/parser/cscript_logpseudomodel.h" #include "fxjs/include/cfxjse_arguments.h" -#include "xfa/fxfa/parser/xfa_doclayout.h" #include "xfa/fxfa/parser/xfa_document.h" #include "xfa/fxfa/parser/xfa_localemgr.h" #include "xfa/fxfa/parser/xfa_object.h" diff --git a/xfa/fxfa/parser/cscript_signaturepseudomodel.cpp b/xfa/fxfa/parser/cscript_signaturepseudomodel.cpp index 2a23110ad3..0e7cf65076 100644 --- a/xfa/fxfa/parser/cscript_signaturepseudomodel.cpp +++ b/xfa/fxfa/parser/cscript_signaturepseudomodel.cpp @@ -9,7 +9,6 @@ #include "fxjs/include/cfxjse_arguments.h" #include "xfa/fxfa/app/xfa_ffnotify.h" #include "xfa/fxfa/parser/cxfa_scriptcontext.h" -#include "xfa/fxfa/parser/xfa_doclayout.h" #include "xfa/fxfa/parser/xfa_document.h" #include "xfa/fxfa/parser/xfa_localemgr.h" #include "xfa/fxfa/parser/xfa_object.h" diff --git a/xfa/fxfa/parser/cxfa_containerlayoutitem.cpp b/xfa/fxfa/parser/cxfa_containerlayoutitem.cpp new file mode 100644 index 0000000000..0db7fb20b4 --- /dev/null +++ b/xfa/fxfa/parser/cxfa_containerlayoutitem.cpp @@ -0,0 +1,44 @@ +// Copyright 2016 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/parser/cxfa_containerlayoutitem.h" + +#include "xfa/fxfa/parser/cxfa_layoutprocessor.h" +#include "xfa/fxfa/parser/cxfa_measurement.h" +#include "xfa/fxfa/parser/xfa_layout_pagemgr_new.h" + +CXFA_ContainerLayoutItem::CXFA_ContainerLayoutItem(CXFA_Node* pNode) + : CXFA_LayoutItem(pNode, FALSE), m_pOldSubform(nullptr) {} + +CXFA_LayoutProcessor* CXFA_ContainerLayoutItem::GetLayout() const { + return m_pFormNode->GetDocument()->GetLayoutProcessor(); +} + +int32_t CXFA_ContainerLayoutItem::GetPageIndex() const { + return m_pFormNode->GetDocument() + ->GetLayoutProcessor() + ->GetLayoutPageMgr() + ->GetPageIndex(this); +} + +CFX_SizeF CXFA_ContainerLayoutItem::GetPageSize() const { + CFX_SizeF size; + CXFA_Node* pMedium = m_pFormNode->GetFirstChildByClass(XFA_Element::Medium); + if (!pMedium) + return size; + + size = CFX_SizeF(pMedium->GetMeasure(XFA_ATTRIBUTE_Short).ToUnit(XFA_UNIT_Pt), + pMedium->GetMeasure(XFA_ATTRIBUTE_Long).ToUnit(XFA_UNIT_Pt)); + if (pMedium->GetEnum(XFA_ATTRIBUTE_Orientation) == + XFA_ATTRIBUTEENUM_Landscape) { + size = CFX_SizeF(size.y, size.x); + } + return size; +} + +CXFA_Node* CXFA_ContainerLayoutItem::GetMasterPage() const { + return m_pFormNode; +} diff --git a/xfa/fxfa/parser/cxfa_containerlayoutitem.h b/xfa/fxfa/parser/cxfa_containerlayoutitem.h new file mode 100644 index 0000000000..87fa360fe2 --- /dev/null +++ b/xfa/fxfa/parser/cxfa_containerlayoutitem.h @@ -0,0 +1,28 @@ +// Copyright 2016 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_PARSER_CXFA_CONTAINERLAYOUTITEM_H_ +#define XFA_FXFA_PARSER_CXFA_CONTAINERLAYOUTITEM_H_ + +#include "xfa/fxfa/parser/cxfa_layoutitem.h" + +class CXFA_ContainerLayoutItem : public CXFA_LayoutItem { + public: + CXFA_ContainerLayoutItem(CXFA_Node* pNode); + + CXFA_LayoutProcessor* GetLayout() const; + int32_t GetPageIndex() const; + CFX_SizeF GetPageSize() const; + CXFA_Node* GetMasterPage() const; + + CXFA_Node* m_pOldSubform; +}; + +inline CXFA_ContainerLayoutItem* ToContainerLayoutItem(CXFA_LayoutItem* pItem) { + return pItem ? pItem->AsContainerLayoutItem() : nullptr; +} + +#endif // XFA_FXFA_PARSER_CXFA_CONTAINERLAYOUTITEM_H_ diff --git a/xfa/fxfa/parser/cxfa_contentlayoutitem.cpp b/xfa/fxfa/parser/cxfa_contentlayoutitem.cpp new file mode 100644 index 0000000000..7e9311fec9 --- /dev/null +++ b/xfa/fxfa/parser/cxfa_contentlayoutitem.cpp @@ -0,0 +1,18 @@ +// Copyright 2016 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/parser/cxfa_contentlayoutitem.h" + +CXFA_ContentLayoutItem::CXFA_ContentLayoutItem(CXFA_Node* pNode) + : CXFA_LayoutItem(pNode, TRUE), + m_pPrev(nullptr), + m_pNext(nullptr), + m_dwStatus(0) {} + +CXFA_ContentLayoutItem::~CXFA_ContentLayoutItem() { + if (m_pFormNode->GetUserData(XFA_LAYOUTITEMKEY) == this) + m_pFormNode->SetUserData(XFA_LAYOUTITEMKEY, nullptr); +} diff --git a/xfa/fxfa/parser/cxfa_contentlayoutitem.h b/xfa/fxfa/parser/cxfa_contentlayoutitem.h new file mode 100644 index 0000000000..f826f52e5b --- /dev/null +++ b/xfa/fxfa/parser/cxfa_contentlayoutitem.h @@ -0,0 +1,28 @@ +// Copyright 2016 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_PARSER_CXFA_CONTENTLAYOUTITEM_H_ +#define XFA_FXFA_PARSER_CXFA_CONTENTLAYOUTITEM_H_ + +#include "xfa/fxfa/parser/cxfa_layoutitem.h" + +class CXFA_ContentLayoutItem : public CXFA_LayoutItem { + public: + CXFA_ContentLayoutItem(CXFA_Node* pNode); + ~CXFA_ContentLayoutItem() override; + + CXFA_ContentLayoutItem* m_pPrev; + CXFA_ContentLayoutItem* m_pNext; + CFX_PointF m_sPos; + CFX_SizeF m_sSize; + uint32_t m_dwStatus; +}; + +inline CXFA_ContentLayoutItem* ToContentLayoutItem(CXFA_LayoutItem* pItem) { + return pItem ? pItem->AsContentLayoutItem() : nullptr; +} + +#endif // XFA_FXFA_PARSER_CXFA_CONTENTLAYOUTITEM_H_ diff --git a/xfa/fxfa/parser/cxfa_layoutitem.cpp b/xfa/fxfa/parser/cxfa_layoutitem.cpp new file mode 100644 index 0000000000..a9ba3490d8 --- /dev/null +++ b/xfa/fxfa/parser/cxfa_layoutitem.cpp @@ -0,0 +1,28 @@ +// Copyright 2016 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/parser/cxfa_layoutitem.h" + +#include "xfa/fxfa/parser/cxfa_containerlayoutitem.h" +#include "xfa/fxfa/parser/cxfa_contentlayoutitem.h" + +CXFA_LayoutItem::CXFA_LayoutItem(CXFA_Node* pNode, FX_BOOL bIsContentLayoutItem) + : m_pFormNode(pNode), + m_pParent(nullptr), + m_pNextSibling(nullptr), + m_pFirstChild(nullptr), + m_bIsContentLayoutItem(bIsContentLayoutItem) {} + +CXFA_LayoutItem::~CXFA_LayoutItem() {} + +CXFA_ContainerLayoutItem* CXFA_LayoutItem::AsContainerLayoutItem() { + return IsContainerLayoutItem() ? static_cast(this) + : nullptr; +} +CXFA_ContentLayoutItem* CXFA_LayoutItem::AsContentLayoutItem() { + return IsContentLayoutItem() ? static_cast(this) + : nullptr; +} diff --git a/xfa/fxfa/parser/cxfa_layoutitem.h b/xfa/fxfa/parser/cxfa_layoutitem.h new file mode 100644 index 0000000000..785272bd86 --- /dev/null +++ b/xfa/fxfa/parser/cxfa_layoutitem.h @@ -0,0 +1,54 @@ +// Copyright 2016 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_PARSER_CXFA_LAYOUTITEM_H_ +#define XFA_FXFA_PARSER_CXFA_LAYOUTITEM_H_ + +#include "xfa/fxfa/parser/xfa_document.h" + +class CXFA_ContainerLayoutItem; +class CXFA_ContentLayoutItem; +class CXFA_LayoutProcessor; + +class CXFA_LayoutItem { + public: + virtual ~CXFA_LayoutItem(); + + FX_BOOL IsContainerLayoutItem() const { return !m_bIsContentLayoutItem; } + FX_BOOL IsContentLayoutItem() const { return m_bIsContentLayoutItem; } + CXFA_ContainerLayoutItem* AsContainerLayoutItem(); + CXFA_ContentLayoutItem* AsContentLayoutItem(); + + CXFA_ContainerLayoutItem* GetPage() const; + CXFA_Node* GetFormNode() const; + void GetRect(CFX_RectF& rtLayout, FX_BOOL bRelative = FALSE) const; + int32_t GetIndex() const; + int32_t GetCount() const; + CXFA_LayoutItem* GetParent() const; + const CXFA_LayoutItem* GetFirst() const; + CXFA_LayoutItem* GetFirst(); + const CXFA_LayoutItem* GetLast() const; + CXFA_LayoutItem* GetLast(); + CXFA_LayoutItem* GetPrev() const; + CXFA_LayoutItem* GetNext() const; + + void AddChild(CXFA_LayoutItem* pChildItem); + void AddHeadChild(CXFA_LayoutItem* pChildItem); + void RemoveChild(CXFA_LayoutItem* pChildItem); + void InsertChild(CXFA_LayoutItem* pBeforeItem, CXFA_LayoutItem* pChildItem); + + CXFA_Node* m_pFormNode; + CXFA_LayoutItem* m_pParent; + CXFA_LayoutItem* m_pNextSibling; + CXFA_LayoutItem* m_pFirstChild; + + protected: + CXFA_LayoutItem(CXFA_Node* pNode, FX_BOOL bIsContentLayoutItem); + + FX_BOOL m_bIsContentLayoutItem; +}; + +#endif // XFA_FXFA_PARSER_CXFA_LAYOUTITEM_H_ diff --git a/xfa/fxfa/parser/cxfa_layoutprocessor.cpp b/xfa/fxfa/parser/cxfa_layoutprocessor.cpp new file mode 100644 index 0000000000..7ebe5285e3 --- /dev/null +++ b/xfa/fxfa/parser/cxfa_layoutprocessor.cpp @@ -0,0 +1,163 @@ +// Copyright 2016 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/parser/cxfa_layoutprocessor.h" + +#include "xfa/fxfa/parser/cxfa_measurement.h" +#include "xfa/fxfa/parser/xfa_document.h" +#include "xfa/fxfa/parser/xfa_document_datamerger_imp.h" +#include "xfa/fxfa/parser/xfa_layout_appadapter.h" +#include "xfa/fxfa/parser/xfa_layout_itemlayout.h" +#include "xfa/fxfa/parser/xfa_layout_pagemgr_new.h" +#include "xfa/fxfa/parser/xfa_localemgr.h" +#include "xfa/fxfa/parser/xfa_object.h" +#include "xfa/fxfa/parser/xfa_utils.h" + +CXFA_LayoutProcessor* CXFA_Document::GetLayoutProcessor() { + if (!m_pLayoutProcessor) { + m_pLayoutProcessor = new CXFA_LayoutProcessor(this); + ASSERT(m_pLayoutProcessor); + } + return m_pLayoutProcessor; +} + +CXFA_LayoutProcessor* CXFA_Document::GetDocLayout() { + return GetLayoutProcessor(); +} + +CXFA_LayoutProcessor::CXFA_LayoutProcessor(CXFA_Document* pDocument) + : m_pDocument(pDocument), + m_pRootItemLayoutProcessor(nullptr), + m_pLayoutPageMgr(nullptr), + m_nProgressCounter(0), + m_bNeeLayout(TRUE) {} + +CXFA_LayoutProcessor::~CXFA_LayoutProcessor() { + ClearLayoutData(); +} + +CXFA_Document* CXFA_LayoutProcessor::GetDocument() const { + return m_pDocument; +} + +int32_t CXFA_LayoutProcessor::StartLayout(FX_BOOL bForceRestart) { + if (!bForceRestart && !IsNeedLayout()) + return 100; + + delete m_pRootItemLayoutProcessor; + m_pRootItemLayoutProcessor = nullptr; + m_nProgressCounter = 0; + CXFA_Node* pFormPacketNode = + ToNode(m_pDocument->GetXFAObject(XFA_HASHCODE_Form)); + if (!pFormPacketNode) + return -1; + + CXFA_Node* pFormRoot = + pFormPacketNode->GetFirstChildByClass(XFA_Element::Subform); + if (!pFormRoot) + return -1; + if (!m_pLayoutPageMgr) + m_pLayoutPageMgr = new CXFA_LayoutPageMgr(this); + if (!m_pLayoutPageMgr->InitLayoutPage(pFormRoot)) + return -1; + if (!m_pLayoutPageMgr->PrepareFirstPage(pFormRoot)) + return -1; + m_pRootItemLayoutProcessor = + new CXFA_ItemLayoutProcessor(pFormRoot, m_pLayoutPageMgr); + m_nProgressCounter = 1; + return 0; +} + +int32_t CXFA_LayoutProcessor::DoLayout(IFX_Pause* pPause) { + if (m_nProgressCounter < 1) + return -1; + + XFA_ItemLayoutProcessorResult eStatus; + CXFA_Node* pFormNode = m_pRootItemLayoutProcessor->GetFormNode(); + FX_FLOAT fPosX = pFormNode->GetMeasure(XFA_ATTRIBUTE_X).ToUnit(XFA_UNIT_Pt); + FX_FLOAT fPosY = pFormNode->GetMeasure(XFA_ATTRIBUTE_Y).ToUnit(XFA_UNIT_Pt); + do { + FX_FLOAT fAvailHeight = m_pLayoutPageMgr->GetAvailHeight(); + eStatus = + m_pRootItemLayoutProcessor->DoLayout(TRUE, fAvailHeight, fAvailHeight); + if (eStatus != XFA_ItemLayoutProcessorResult_Done) + m_nProgressCounter++; + + CXFA_ContentLayoutItem* pLayoutItem = + m_pRootItemLayoutProcessor->ExtractLayoutItem(); + if (pLayoutItem) + pLayoutItem->m_sPos = CFX_PointF(fPosX, fPosY); + + m_pLayoutPageMgr->SubmitContentItem(pLayoutItem, eStatus); + } while (eStatus != XFA_ItemLayoutProcessorResult_Done && + (!pPause || !pPause->NeedToPauseNow())); + + if (eStatus == XFA_ItemLayoutProcessorResult_Done) { + m_pLayoutPageMgr->FinishPaginatedPageSets(); + m_pLayoutPageMgr->SyncLayoutData(); + m_bNeeLayout = FALSE; + m_rgChangedContainers.RemoveAll(); + } + return 100 * (eStatus == XFA_ItemLayoutProcessorResult_Done + ? m_nProgressCounter + : m_nProgressCounter - 1) / + m_nProgressCounter; +} + +FX_BOOL CXFA_LayoutProcessor::IncrementLayout() { + if (m_bNeeLayout) { + StartLayout(TRUE); + return DoLayout(nullptr) == 100; + } + + for (int32_t i = 0, c = m_rgChangedContainers.GetSize(); i < c; i++) { + CXFA_Node* pNode = m_rgChangedContainers[i]; + CXFA_Node* pParentNode = + pNode->GetNodeItem(XFA_NODEITEM_Parent, XFA_ObjectType::ContainerNode); + if (!pParentNode) + return FALSE; + if (!CXFA_ItemLayoutProcessor::IncrementRelayoutNode(this, pNode, + pParentNode)) { + return FALSE; + } + } + m_rgChangedContainers.RemoveAll(); + return TRUE; +} + +int32_t CXFA_LayoutProcessor::CountPages() const { + return m_pLayoutPageMgr ? m_pLayoutPageMgr->GetPageCount() : 0; +} + +CXFA_ContainerLayoutItem* CXFA_LayoutProcessor::GetPage(int32_t index) const { + return m_pLayoutPageMgr ? m_pLayoutPageMgr->GetPage(index) : nullptr; +} + +CXFA_LayoutItem* CXFA_LayoutProcessor::GetLayoutItem(CXFA_Node* pFormItem) { + return static_cast( + pFormItem->GetUserData(XFA_LAYOUTITEMKEY)); +} + +void CXFA_LayoutProcessor::AddChangedContainer(CXFA_Node* pContainer) { + if (m_rgChangedContainers.Find(pContainer) < 0) + m_rgChangedContainers.Add(pContainer); +} + +CXFA_ContainerLayoutItem* CXFA_LayoutProcessor::GetRootLayoutItem() const { + return m_pLayoutPageMgr ? m_pLayoutPageMgr->GetRootLayoutItem() : nullptr; +} + +void CXFA_LayoutProcessor::ClearLayoutData() { + delete m_pLayoutPageMgr; + m_pLayoutPageMgr = nullptr; + delete m_pRootItemLayoutProcessor; + m_pRootItemLayoutProcessor = nullptr; + m_nProgressCounter = 0; +} + +FX_BOOL CXFA_LayoutProcessor::IsNeedLayout() { + return m_bNeeLayout || m_rgChangedContainers.GetSize() > 0; +} diff --git a/xfa/fxfa/parser/cxfa_layoutprocessor.h b/xfa/fxfa/parser/cxfa_layoutprocessor.h new file mode 100644 index 0000000000..1e66402720 --- /dev/null +++ b/xfa/fxfa/parser/cxfa_layoutprocessor.h @@ -0,0 +1,55 @@ +// Copyright 2016 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_PARSER_CXFA_LAYOUTPROCESSOR_H_ +#define XFA_FXFA_PARSER_CXFA_LAYOUTPROCESSOR_H_ + +#include "core/fxcrt/include/fx_system.h" +#include "xfa/fxfa/parser/xfa_object.h" + +class CXFA_ContainerLayoutItem; +class CXFA_Document; +class CXFA_ItemLayoutProcessor; +class CXFA_LayoutItem; +class CXFA_LayoutPageMgr; +class CXFA_Node; +class IFX_Pause; + +class CXFA_LayoutProcessor { + public: + CXFA_LayoutProcessor(CXFA_Document* pDocument); + ~CXFA_LayoutProcessor(); + + CXFA_Document* GetDocument() const; + int32_t StartLayout(FX_BOOL bForceRestart = FALSE); + int32_t DoLayout(IFX_Pause* pPause = nullptr); + FX_BOOL IncrementLayout(); + int32_t CountPages() const; + CXFA_ContainerLayoutItem* GetPage(int32_t index) const; + CXFA_LayoutItem* GetLayoutItem(CXFA_Node* pFormItem); + + void AddChangedContainer(CXFA_Node* pContainer); + void SetForceReLayout(FX_BOOL bForceRestart) { m_bNeeLayout = bForceRestart; } + CXFA_ContainerLayoutItem* GetRootLayoutItem() const; + CXFA_ItemLayoutProcessor* GetRootRootItemLayoutProcessor() { + return m_pRootItemLayoutProcessor; + } + CXFA_LayoutPageMgr* GetLayoutPageMgr() { return m_pLayoutPageMgr; } + + private: + void ClearLayoutData(); + + FX_BOOL IsNeedLayout(); + + CXFA_Document* m_pDocument; + CXFA_ItemLayoutProcessor* m_pRootItemLayoutProcessor; + CXFA_LayoutPageMgr* m_pLayoutPageMgr; + CXFA_NodeArray m_rgChangedContainers; + uint32_t m_nProgressCounter; + FX_BOOL m_bNeeLayout; +}; + +#endif // XFA_FXFA_PARSER_CXFA_LAYOUTPROCESSOR_H_ diff --git a/xfa/fxfa/parser/cxfa_node.cpp b/xfa/fxfa/parser/cxfa_node.cpp index 44b7e2fb1c..800ada43fb 100644 --- a/xfa/fxfa/parser/cxfa_node.cpp +++ b/xfa/fxfa/parser/cxfa_node.cpp @@ -17,13 +17,13 @@ #include "xfa/fgas/crt/fgas_system.h" #include "xfa/fxfa/app/xfa_ffnotify.h" #include "xfa/fxfa/include/cxfa_eventparam.h" +#include "xfa/fxfa/parser/cxfa_layoutprocessor.h" #include "xfa/fxfa/parser/cxfa_measurement.h" #include "xfa/fxfa/parser/cxfa_occur.h" #include "xfa/fxfa/parser/cxfa_scriptcontext.h" #include "xfa/fxfa/parser/cxfa_simple_parser.h" #include "xfa/fxfa/parser/xfa_basic_data.h" #include "xfa/fxfa/parser/xfa_document.h" -#include "xfa/fxfa/parser/xfa_document_layout_imp.h" namespace { diff --git a/xfa/fxfa/parser/cxfa_nodehelper.cpp b/xfa/fxfa/parser/cxfa_nodehelper.cpp index 038a5a55ab..f5b4c04655 100644 --- a/xfa/fxfa/parser/cxfa_nodehelper.cpp +++ b/xfa/fxfa/parser/cxfa_nodehelper.cpp @@ -8,7 +8,6 @@ #include "core/fxcrt/include/fx_ext.h" #include "xfa/fxfa/parser/cxfa_scriptcontext.h" -#include "xfa/fxfa/parser/xfa_doclayout.h" #include "xfa/fxfa/parser/xfa_document.h" #include "xfa/fxfa/parser/xfa_localemgr.h" #include "xfa/fxfa/parser/xfa_object.h" diff --git a/xfa/fxfa/parser/cxfa_resolveprocessor.cpp b/xfa/fxfa/parser/cxfa_resolveprocessor.cpp index b6894c483a..578c2dc651 100644 --- a/xfa/fxfa/parser/cxfa_resolveprocessor.cpp +++ b/xfa/fxfa/parser/cxfa_resolveprocessor.cpp @@ -9,7 +9,6 @@ #include "core/fxcrt/include/fx_ext.h" #include "xfa/fxfa/parser/cxfa_nodehelper.h" #include "xfa/fxfa/parser/cxfa_scriptcontext.h" -#include "xfa/fxfa/parser/xfa_doclayout.h" #include "xfa/fxfa/parser/xfa_document.h" #include "xfa/fxfa/parser/xfa_localemgr.h" #include "xfa/fxfa/parser/xfa_object.h" diff --git a/xfa/fxfa/parser/cxfa_scriptcontext.cpp b/xfa/fxfa/parser/cxfa_scriptcontext.cpp index f59700afba..24c3e503ce 100644 --- a/xfa/fxfa/parser/cxfa_scriptcontext.cpp +++ b/xfa/fxfa/parser/cxfa_scriptcontext.cpp @@ -15,7 +15,6 @@ #include "xfa/fxfa/parser/cxfa_nodehelper.h" #include "xfa/fxfa/parser/cxfa_resolveprocessor.h" #include "xfa/fxfa/parser/xfa_basic_data.h" -#include "xfa/fxfa/parser/xfa_doclayout.h" #include "xfa/fxfa/parser/xfa_document.h" #include "xfa/fxfa/parser/xfa_localemgr.h" #include "xfa/fxfa/parser/xfa_object.h" diff --git a/xfa/fxfa/parser/cxfa_traversestrategy_layoutitem.h b/xfa/fxfa/parser/cxfa_traversestrategy_layoutitem.h new file mode 100644 index 0000000000..7b39826130 --- /dev/null +++ b/xfa/fxfa/parser/cxfa_traversestrategy_layoutitem.h @@ -0,0 +1,25 @@ +// Copyright 2016 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_PARSER_CXFA_TRAVERSESTRATEGY_LAYOUTITEM_H_ +#define XFA_FXFA_PARSER_CXFA_TRAVERSESTRATEGY_LAYOUTITEM_H_ + +#include "xfa/fxfa/parser/cxfa_layoutitem.h" + +class CXFA_TraverseStrategy_LayoutItem { + public: + static CXFA_LayoutItem* GetFirstChild(CXFA_LayoutItem* pLayoutItem) { + return pLayoutItem->m_pFirstChild; + } + static CXFA_LayoutItem* GetNextSibling(CXFA_LayoutItem* pLayoutItem) { + return pLayoutItem->m_pNextSibling; + } + static CXFA_LayoutItem* GetParent(CXFA_LayoutItem* pLayoutItem) { + return pLayoutItem->m_pParent; + } +}; + +#endif // XFA_FXFA_PARSER_CXFA_TRAVERSESTRATEGY_LAYOUTITEM_H_ diff --git a/xfa/fxfa/parser/xfa_doclayout.h b/xfa/fxfa/parser/xfa_doclayout.h deleted file mode 100644 index cc0cf82417..0000000000 --- a/xfa/fxfa/parser/xfa_doclayout.h +++ /dev/null @@ -1,106 +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_PARSER_XFA_DOCLAYOUT_H_ -#define XFA_FXFA_PARSER_XFA_DOCLAYOUT_H_ - -#include "xfa/fxfa/parser/xfa_document.h" - -class CXFA_ContainerLayoutItem; -class CXFA_ContentLayoutItem; -class CXFA_LayoutProcessor; - -class CXFA_LayoutItem { - public: - virtual ~CXFA_LayoutItem(); - - FX_BOOL IsContainerLayoutItem() const { return !m_bIsContentLayoutItem; } - FX_BOOL IsContentLayoutItem() const { return m_bIsContentLayoutItem; } - inline CXFA_ContainerLayoutItem* AsContainerLayoutItem(); - inline CXFA_ContentLayoutItem* AsContentLayoutItem(); - - CXFA_ContainerLayoutItem* GetPage() const; - CXFA_Node* GetFormNode() const; - void GetRect(CFX_RectF& rtLayout, FX_BOOL bRelative = FALSE) const; - int32_t GetIndex() const; - int32_t GetCount() const; - CXFA_LayoutItem* GetParent() const; - const CXFA_LayoutItem* GetFirst() const; - CXFA_LayoutItem* GetFirst(); - const CXFA_LayoutItem* GetLast() const; - CXFA_LayoutItem* GetLast(); - CXFA_LayoutItem* GetPrev() const; - CXFA_LayoutItem* GetNext() const; - - void AddChild(CXFA_LayoutItem* pChildItem); - void AddHeadChild(CXFA_LayoutItem* pChildItem); - void RemoveChild(CXFA_LayoutItem* pChildItem); - void InsertChild(CXFA_LayoutItem* pBeforeItem, CXFA_LayoutItem* pChildItem); - - CXFA_Node* m_pFormNode; - CXFA_LayoutItem* m_pParent; - CXFA_LayoutItem* m_pNextSibling; - CXFA_LayoutItem* m_pFirstChild; - - protected: - CXFA_LayoutItem(CXFA_Node* pNode, FX_BOOL bIsContentLayoutItem); - - FX_BOOL m_bIsContentLayoutItem; -}; - -class CXFA_ContainerLayoutItem : public CXFA_LayoutItem { - public: - CXFA_ContainerLayoutItem(CXFA_Node* pNode); - - CXFA_LayoutProcessor* GetLayout() const; - int32_t GetPageIndex() const; - void GetPageSize(CFX_SizeF& size) const; - CXFA_Node* GetMasterPage() const; - - CXFA_Node* m_pOldSubform; -}; - -class CXFA_ContentLayoutItem : public CXFA_LayoutItem { - public: - CXFA_ContentLayoutItem(CXFA_Node* pNode); - ~CXFA_ContentLayoutItem() override; - - CXFA_ContentLayoutItem* m_pPrev; - CXFA_ContentLayoutItem* m_pNext; - CFX_PointF m_sPos; - CFX_SizeF m_sSize; - uint32_t m_dwStatus; -}; - -CXFA_ContainerLayoutItem* CXFA_LayoutItem::AsContainerLayoutItem() { - return IsContainerLayoutItem() ? static_cast(this) - : nullptr; -} -CXFA_ContentLayoutItem* CXFA_LayoutItem::AsContentLayoutItem() { - return IsContentLayoutItem() ? static_cast(this) - : nullptr; -} -inline CXFA_ContainerLayoutItem* ToContainerLayoutItem(CXFA_LayoutItem* pItem) { - return pItem ? pItem->AsContainerLayoutItem() : nullptr; -} -inline CXFA_ContentLayoutItem* ToContentLayoutItem(CXFA_LayoutItem* pItem) { - return pItem ? pItem->AsContentLayoutItem() : nullptr; -} - -class CXFA_TraverseStrategy_LayoutItem { - public: - static inline CXFA_LayoutItem* GetFirstChild(CXFA_LayoutItem* pLayoutItem) { - return pLayoutItem->m_pFirstChild; - } - static inline CXFA_LayoutItem* GetNextSibling(CXFA_LayoutItem* pLayoutItem) { - return pLayoutItem->m_pNextSibling; - } - static inline CXFA_LayoutItem* GetParent(CXFA_LayoutItem* pLayoutItem) { - return pLayoutItem->m_pParent; - } -}; - -#endif // XFA_FXFA_PARSER_XFA_DOCLAYOUT_H_ diff --git a/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp b/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp index d1f9b8e1d4..19b0698662 100644 --- a/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp +++ b/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp @@ -8,11 +8,10 @@ #include "core/fxcrt/include/fx_ext.h" #include "xfa/fde/xml/fde_xml_imp.h" +#include "xfa/fxfa/parser/cxfa_layoutprocessor.h" #include "xfa/fxfa/parser/cxfa_occur.h" #include "xfa/fxfa/parser/cxfa_scriptcontext.h" -#include "xfa/fxfa/parser/xfa_doclayout.h" #include "xfa/fxfa/parser/xfa_document.h" -#include "xfa/fxfa/parser/xfa_document_layout_imp.h" #include "xfa/fxfa/parser/xfa_localemgr.h" #include "xfa/fxfa/parser/xfa_object.h" #include "xfa/fxfa/parser/xfa_resolvenode_rs.h" diff --git a/xfa/fxfa/parser/xfa_document_imp.cpp b/xfa/fxfa/parser/xfa_document_imp.cpp index 46a6edca2e..633e2e2209 100644 --- a/xfa/fxfa/parser/xfa_document_imp.cpp +++ b/xfa/fxfa/parser/xfa_document_imp.cpp @@ -13,10 +13,9 @@ #include "xfa/fxfa/parser/cscript_logpseudomodel.h" #include "xfa/fxfa/parser/cscript_signaturepseudomodel.h" #include "xfa/fxfa/parser/cxfa_document_parser.h" +#include "xfa/fxfa/parser/cxfa_layoutprocessor.h" #include "xfa/fxfa/parser/cxfa_scriptcontext.h" -#include "xfa/fxfa/parser/xfa_doclayout.h" #include "xfa/fxfa/parser/xfa_document.h" -#include "xfa/fxfa/parser/xfa_document_layout_imp.h" #include "xfa/fxfa/parser/xfa_localemgr.h" #include "xfa/fxfa/parser/xfa_object.h" #include "xfa/fxfa/parser/xfa_resolvenode_rs.h" diff --git a/xfa/fxfa/parser/xfa_document_layout_imp.cpp b/xfa/fxfa/parser/xfa_document_layout_imp.cpp deleted file mode 100644 index ec407a2757..0000000000 --- a/xfa/fxfa/parser/xfa_document_layout_imp.cpp +++ /dev/null @@ -1,203 +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/parser/xfa_document_layout_imp.h" - -#include "xfa/fxfa/parser/cxfa_measurement.h" -#include "xfa/fxfa/parser/xfa_doclayout.h" -#include "xfa/fxfa/parser/xfa_document.h" -#include "xfa/fxfa/parser/xfa_document_datamerger_imp.h" -#include "xfa/fxfa/parser/xfa_layout_appadapter.h" -#include "xfa/fxfa/parser/xfa_layout_itemlayout.h" -#include "xfa/fxfa/parser/xfa_layout_pagemgr_new.h" -#include "xfa/fxfa/parser/xfa_localemgr.h" -#include "xfa/fxfa/parser/xfa_object.h" -#include "xfa/fxfa/parser/xfa_utils.h" - -CXFA_LayoutProcessor* CXFA_Document::GetLayoutProcessor() { - if (!m_pLayoutProcessor) { - m_pLayoutProcessor = new CXFA_LayoutProcessor(this); - ASSERT(m_pLayoutProcessor); - } - return m_pLayoutProcessor; -} -CXFA_LayoutProcessor* CXFA_Document::GetDocLayout() { - return GetLayoutProcessor(); -} -CXFA_LayoutProcessor::CXFA_LayoutProcessor(CXFA_Document* pDocument) - : m_pDocument(pDocument), - m_pRootItemLayoutProcessor(nullptr), - m_pLayoutPageMgr(nullptr), - m_nProgressCounter(0), - m_bNeeLayout(TRUE) {} -CXFA_LayoutProcessor::~CXFA_LayoutProcessor() { - ClearLayoutData(); -} -CXFA_Document* CXFA_LayoutProcessor::GetDocument() const { - return m_pDocument; -} - -int32_t CXFA_LayoutProcessor::StartLayout(FX_BOOL bForceRestart) { - if (!bForceRestart && !IsNeedLayout()) - return 100; - - delete m_pRootItemLayoutProcessor; - m_pRootItemLayoutProcessor = nullptr; - m_nProgressCounter = 0; - CXFA_Node* pFormPacketNode = - ToNode(m_pDocument->GetXFAObject(XFA_HASHCODE_Form)); - if (!pFormPacketNode) { - return -1; - } - CXFA_Node* pFormRoot = - pFormPacketNode->GetFirstChildByClass(XFA_Element::Subform); - if (!pFormRoot) { - return -1; - } - if (!m_pLayoutPageMgr) { - m_pLayoutPageMgr = new CXFA_LayoutPageMgr(this); - } - if (!m_pLayoutPageMgr->InitLayoutPage(pFormRoot)) { - return -1; - } - if (!m_pLayoutPageMgr->PrepareFirstPage(pFormRoot)) { - return -1; - } - m_pRootItemLayoutProcessor = - new CXFA_ItemLayoutProcessor(pFormRoot, m_pLayoutPageMgr); - m_nProgressCounter = 1; - return 0; -} -int32_t CXFA_LayoutProcessor::DoLayout(IFX_Pause* pPause) { - if (m_nProgressCounter < 1) { - return -1; - } - XFA_ItemLayoutProcessorResult eStatus; - CXFA_Node* pFormNode = m_pRootItemLayoutProcessor->GetFormNode(); - FX_FLOAT fPosX = pFormNode->GetMeasure(XFA_ATTRIBUTE_X).ToUnit(XFA_UNIT_Pt); - FX_FLOAT fPosY = pFormNode->GetMeasure(XFA_ATTRIBUTE_Y).ToUnit(XFA_UNIT_Pt); - do { - FX_FLOAT fAvailHeight = m_pLayoutPageMgr->GetAvailHeight(); - eStatus = - m_pRootItemLayoutProcessor->DoLayout(TRUE, fAvailHeight, fAvailHeight); - if (eStatus != XFA_ItemLayoutProcessorResult_Done) { - m_nProgressCounter++; - } - CXFA_ContentLayoutItem* pLayoutItem = - m_pRootItemLayoutProcessor->ExtractLayoutItem(); - if (pLayoutItem) { - pLayoutItem->m_sPos = CFX_PointF(fPosX, fPosY); - } - m_pLayoutPageMgr->SubmitContentItem(pLayoutItem, eStatus); - } while (eStatus != XFA_ItemLayoutProcessorResult_Done && - (!pPause || !pPause->NeedToPauseNow())); - if (eStatus == XFA_ItemLayoutProcessorResult_Done) { - m_pLayoutPageMgr->FinishPaginatedPageSets(); - m_pLayoutPageMgr->SyncLayoutData(); - m_bNeeLayout = FALSE; - m_rgChangedContainers.RemoveAll(); - } - return 100 * (eStatus == XFA_ItemLayoutProcessorResult_Done - ? m_nProgressCounter - : m_nProgressCounter - 1) / - m_nProgressCounter; -} -FX_BOOL CXFA_LayoutProcessor::IncrementLayout() { - if (m_bNeeLayout) { - StartLayout(TRUE); - return DoLayout(nullptr) == 100; - } - for (int32_t i = 0, c = m_rgChangedContainers.GetSize(); i < c; i++) { - CXFA_Node* pNode = m_rgChangedContainers[i]; - CXFA_Node* pParentNode = - pNode->GetNodeItem(XFA_NODEITEM_Parent, XFA_ObjectType::ContainerNode); - if (!pParentNode) { - return FALSE; - } - if (!CXFA_ItemLayoutProcessor::IncrementRelayoutNode(this, pNode, - pParentNode)) { - return FALSE; - } - } - m_rgChangedContainers.RemoveAll(); - return TRUE; -} -int32_t CXFA_LayoutProcessor::CountPages() const { - return m_pLayoutPageMgr ? m_pLayoutPageMgr->GetPageCount() : 0; -} -CXFA_ContainerLayoutItem* CXFA_LayoutProcessor::GetPage(int32_t index) const { - return m_pLayoutPageMgr ? m_pLayoutPageMgr->GetPage(index) : nullptr; -} -CXFA_LayoutItem* CXFA_LayoutProcessor::GetLayoutItem(CXFA_Node* pFormItem) { - return static_cast( - pFormItem->GetUserData(XFA_LAYOUTITEMKEY)); -} -void CXFA_LayoutProcessor::AddChangedContainer(CXFA_Node* pContainer) { - if (m_rgChangedContainers.Find(pContainer) < 0) { - m_rgChangedContainers.Add(pContainer); - } -} -CXFA_ContainerLayoutItem* CXFA_LayoutProcessor::GetRootLayoutItem() const { - return m_pLayoutPageMgr ? m_pLayoutPageMgr->GetRootLayoutItem() : nullptr; -} - -void CXFA_LayoutProcessor::ClearLayoutData() { - delete m_pLayoutPageMgr; - m_pLayoutPageMgr = nullptr; - delete m_pRootItemLayoutProcessor; - m_pRootItemLayoutProcessor = nullptr; - m_nProgressCounter = 0; -} - -FX_BOOL CXFA_LayoutProcessor::IsNeedLayout() { - return m_bNeeLayout || m_rgChangedContainers.GetSize() > 0; -} -CXFA_LayoutItem::CXFA_LayoutItem(CXFA_Node* pNode, FX_BOOL bIsContentLayoutItem) - : m_pFormNode(pNode), - m_pParent(nullptr), - m_pNextSibling(nullptr), - m_pFirstChild(nullptr), - m_bIsContentLayoutItem(bIsContentLayoutItem) {} -CXFA_LayoutItem::~CXFA_LayoutItem() {} -CXFA_ContainerLayoutItem::CXFA_ContainerLayoutItem(CXFA_Node* pNode) - : CXFA_LayoutItem(pNode, FALSE), m_pOldSubform(nullptr) {} -CXFA_LayoutProcessor* CXFA_ContainerLayoutItem::GetLayout() const { - return m_pFormNode->GetDocument()->GetLayoutProcessor(); -} -int32_t CXFA_ContainerLayoutItem::GetPageIndex() const { - return m_pFormNode->GetDocument() - ->GetLayoutProcessor() - ->GetLayoutPageMgr() - ->GetPageIndex(this); -} - -void CXFA_ContainerLayoutItem::GetPageSize(CFX_SizeF& size) const { - size.clear(); - CXFA_Node* pMedium = m_pFormNode->GetFirstChildByClass(XFA_Element::Medium); - if (!pMedium) - return; - - size = CFX_SizeF(pMedium->GetMeasure(XFA_ATTRIBUTE_Short).ToUnit(XFA_UNIT_Pt), - pMedium->GetMeasure(XFA_ATTRIBUTE_Long).ToUnit(XFA_UNIT_Pt)); - if (pMedium->GetEnum(XFA_ATTRIBUTE_Orientation) == - XFA_ATTRIBUTEENUM_Landscape) { - size = CFX_SizeF(size.y, size.x); - } -} - -CXFA_Node* CXFA_ContainerLayoutItem::GetMasterPage() const { - return m_pFormNode; -} -CXFA_ContentLayoutItem::CXFA_ContentLayoutItem(CXFA_Node* pNode) - : CXFA_LayoutItem(pNode, TRUE), - m_pPrev(nullptr), - m_pNext(nullptr), - m_dwStatus(0) {} -CXFA_ContentLayoutItem::~CXFA_ContentLayoutItem() { - if (m_pFormNode->GetUserData(XFA_LAYOUTITEMKEY) == this) { - m_pFormNode->SetUserData(XFA_LAYOUTITEMKEY, nullptr); - } -} diff --git a/xfa/fxfa/parser/xfa_document_layout_imp.h b/xfa/fxfa/parser/xfa_document_layout_imp.h deleted file mode 100644 index 87f7ca01af..0000000000 --- a/xfa/fxfa/parser/xfa_document_layout_imp.h +++ /dev/null @@ -1,50 +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_PARSER_XFA_DOCUMENT_LAYOUT_IMP_H_ -#define XFA_FXFA_PARSER_XFA_DOCUMENT_LAYOUT_IMP_H_ - -#include "xfa/fxfa/parser/xfa_doclayout.h" - -class CXFA_ItemLayoutProcessor; -class CXFA_LayoutPageMgr; -class CXFA_ContainerLayoutItem; - -class CXFA_LayoutProcessor { - public: - CXFA_LayoutProcessor(CXFA_Document* pDocument); - ~CXFA_LayoutProcessor(); - - CXFA_Document* GetDocument() const; - int32_t StartLayout(FX_BOOL bForceRestart = FALSE); - int32_t DoLayout(IFX_Pause* pPause = nullptr); - FX_BOOL IncrementLayout(); - int32_t CountPages() const; - CXFA_ContainerLayoutItem* GetPage(int32_t index) const; - CXFA_LayoutItem* GetLayoutItem(CXFA_Node* pFormItem); - - void AddChangedContainer(CXFA_Node* pContainer); - void SetForceReLayout(FX_BOOL bForceRestart) { m_bNeeLayout = bForceRestart; } - CXFA_ContainerLayoutItem* GetRootLayoutItem() const; - CXFA_ItemLayoutProcessor* GetRootRootItemLayoutProcessor() { - return m_pRootItemLayoutProcessor; - } - CXFA_LayoutPageMgr* GetLayoutPageMgr() { return m_pLayoutPageMgr; } - - protected: - void ClearLayoutData(); - - FX_BOOL IsNeedLayout(); - - CXFA_Document* m_pDocument; - CXFA_ItemLayoutProcessor* m_pRootItemLayoutProcessor; - CXFA_LayoutPageMgr* m_pLayoutPageMgr; - CXFA_NodeArray m_rgChangedContainers; - uint32_t m_nProgressCounter; - FX_BOOL m_bNeeLayout; -}; - -#endif // XFA_FXFA_PARSER_XFA_DOCUMENT_LAYOUT_IMP_H_ diff --git a/xfa/fxfa/parser/xfa_document_serialize.cpp b/xfa/fxfa/parser/xfa_document_serialize.cpp index e6cd3e8ef7..a524c733d2 100644 --- a/xfa/fxfa/parser/xfa_document_serialize.cpp +++ b/xfa/fxfa/parser/xfa_document_serialize.cpp @@ -9,7 +9,6 @@ #include "xfa/fde/xml/fde_xml_imp.h" #include "xfa/fgas/crt/fgas_codepage.h" #include "xfa/fxfa/parser/cxfa_simple_parser.h" -#include "xfa/fxfa/parser/xfa_doclayout.h" #include "xfa/fxfa/parser/xfa_document.h" #include "xfa/fxfa/parser/xfa_localemgr.h" #include "xfa/fxfa/parser/xfa_object.h" diff --git a/xfa/fxfa/parser/xfa_layout_appadapter.cpp b/xfa/fxfa/parser/xfa_layout_appadapter.cpp index ad6c560c1e..3dc9b5f052 100644 --- a/xfa/fxfa/parser/xfa_layout_appadapter.cpp +++ b/xfa/fxfa/parser/xfa_layout_appadapter.cpp @@ -7,9 +7,7 @@ #include "xfa/fxfa/parser/xfa_layout_appadapter.h" #include "xfa/fxfa/app/xfa_ffnotify.h" -#include "xfa/fxfa/parser/xfa_doclayout.h" #include "xfa/fxfa/parser/xfa_document.h" -#include "xfa/fxfa/parser/xfa_document_layout_imp.h" #include "xfa/fxfa/parser/xfa_layout_itemlayout.h" #include "xfa/fxfa/parser/xfa_layout_pagemgr_new.h" #include "xfa/fxfa/parser/xfa_localemgr.h" diff --git a/xfa/fxfa/parser/xfa_layout_appadapter.h b/xfa/fxfa/parser/xfa_layout_appadapter.h index 498c023fb8..7de62e6282 100644 --- a/xfa/fxfa/parser/xfa_layout_appadapter.h +++ b/xfa/fxfa/parser/xfa_layout_appadapter.h @@ -7,7 +7,9 @@ #ifndef XFA_FXFA_PARSER_XFA_LAYOUT_APPADAPTER_H_ #define XFA_FXFA_PARSER_XFA_LAYOUT_APPADAPTER_H_ -#include "xfa/fxfa/parser/xfa_doclayout.h" +#include "xfa/fxfa/parser/cxfa_containerlayoutitem.h" +#include "xfa/fxfa/parser/cxfa_contentlayoutitem.h" +#include "xfa/fxfa/parser/cxfa_layoutitem.h" class CXFA_TraverseStrategy_PageAreaContainerLayoutItem { public: diff --git a/xfa/fxfa/parser/xfa_layout_itemlayout.cpp b/xfa/fxfa/parser/xfa_layout_itemlayout.cpp index c120893627..99432d80f5 100644 --- a/xfa/fxfa/parser/xfa_layout_itemlayout.cpp +++ b/xfa/fxfa/parser/xfa_layout_itemlayout.cpp @@ -12,9 +12,7 @@ #include "xfa/fxfa/app/xfa_ffnotify.h" #include "xfa/fxfa/parser/cxfa_measurement.h" #include "xfa/fxfa/parser/cxfa_occur.h" -#include "xfa/fxfa/parser/xfa_doclayout.h" #include "xfa/fxfa/parser/xfa_document.h" -#include "xfa/fxfa/parser/xfa_document_layout_imp.h" #include "xfa/fxfa/parser/xfa_layout_appadapter.h" #include "xfa/fxfa/parser/xfa_layout_pagemgr_new.h" #include "xfa/fxfa/parser/xfa_localemgr.h" diff --git a/xfa/fxfa/parser/xfa_layout_itemlayout.h b/xfa/fxfa/parser/xfa_layout_itemlayout.h index f326715339..a1344ba53a 100644 --- a/xfa/fxfa/parser/xfa_layout_itemlayout.h +++ b/xfa/fxfa/parser/xfa_layout_itemlayout.h @@ -13,8 +13,7 @@ #include #include "core/fxcrt/include/fx_basic.h" -#include "xfa/fxfa/parser/xfa_doclayout.h" -#include "xfa/fxfa/parser/xfa_document_layout_imp.h" +#include "xfa/fxfa/include/fxfa_basic.h" #define XFA_LAYOUT_INVALIDNODE ((CXFA_Node*)(intptr_t)-1) #define XFA_LAYOUT_FLOAT_PERCISION (0.0005f) @@ -24,6 +23,7 @@ class CXFA_ContainerLayoutItem; class CXFA_ContentLayoutItem; class CXFA_ItemLayoutProcessor; class CXFA_LayoutPageMgr; +class CXFA_LayoutProcessor; class CXFA_Node; enum XFA_ItemLayoutProcessorResult { diff --git a/xfa/fxfa/parser/xfa_layout_pagemgr_new.cpp b/xfa/fxfa/parser/xfa_layout_pagemgr_new.cpp index 8794864fdc..779e783b9a 100644 --- a/xfa/fxfa/parser/xfa_layout_pagemgr_new.cpp +++ b/xfa/fxfa/parser/xfa_layout_pagemgr_new.cpp @@ -7,12 +7,12 @@ #include "xfa/fxfa/parser/xfa_layout_pagemgr_new.h" #include "xfa/fxfa/app/xfa_ffnotify.h" +#include "xfa/fxfa/parser/cxfa_layoutprocessor.h" #include "xfa/fxfa/parser/cxfa_measurement.h" #include "xfa/fxfa/parser/cxfa_scriptcontext.h" -#include "xfa/fxfa/parser/xfa_doclayout.h" +#include "xfa/fxfa/parser/cxfa_traversestrategy_layoutitem.h" #include "xfa/fxfa/parser/xfa_document.h" #include "xfa/fxfa/parser/xfa_document_datamerger_imp.h" -#include "xfa/fxfa/parser/xfa_document_layout_imp.h" #include "xfa/fxfa/parser/xfa_layout_appadapter.h" #include "xfa/fxfa/parser/xfa_layout_itemlayout.h" #include "xfa/fxfa/parser/xfa_localemgr.h" diff --git a/xfa/fxfa/parser/xfa_layout_pagemgr_new.h b/xfa/fxfa/parser/xfa_layout_pagemgr_new.h index 5ffa40e5c8..f4cc175dcb 100644 --- a/xfa/fxfa/parser/xfa_layout_pagemgr_new.h +++ b/xfa/fxfa/parser/xfa_layout_pagemgr_new.h @@ -7,9 +7,10 @@ #ifndef XFA_FXFA_PARSER_XFA_LAYOUT_PAGEMGR_NEW_H_ #define XFA_FXFA_PARSER_XFA_LAYOUT_PAGEMGR_NEW_H_ -#include "xfa/fxfa/parser/xfa_doclayout.h" #include "xfa/fxfa/parser/xfa_layout_itemlayout.h" +class CXFA_LayoutItem; + class CXFA_ContainerRecord { public: CXFA_ContainerRecord(CXFA_ContainerLayoutItem* pPageSet = nullptr, diff --git a/xfa/fxfa/parser/xfa_locale.cpp b/xfa/fxfa/parser/xfa_locale.cpp index 48492a9776..48e0f1eef5 100644 --- a/xfa/fxfa/parser/xfa_locale.cpp +++ b/xfa/fxfa/parser/xfa_locale.cpp @@ -7,7 +7,6 @@ #include "xfa/fxfa/parser/xfa_locale.h" #include "core/fxcrt/include/fx_xml.h" -#include "xfa/fxfa/parser/xfa_doclayout.h" #include "xfa/fxfa/parser/xfa_document.h" #include "xfa/fxfa/parser/xfa_localemgr.h" #include "xfa/fxfa/parser/xfa_object.h" diff --git a/xfa/fxfa/parser/xfa_localemgr.cpp b/xfa/fxfa/parser/xfa_localemgr.cpp index f19b1324d4..4b80f3e0f4 100644 --- a/xfa/fxfa/parser/xfa_localemgr.cpp +++ b/xfa/fxfa/parser/xfa_localemgr.cpp @@ -9,7 +9,6 @@ #include "core/fxcodec/include/fx_codec.h" #include "core/fxcrt/include/fx_xml.h" #include "core/fxge/include/fx_ge.h" -#include "xfa/fxfa/parser/xfa_doclayout.h" #include "xfa/fxfa/parser/xfa_document.h" #include "xfa/fxfa/parser/xfa_locale.h" #include "xfa/fxfa/parser/xfa_object.h" diff --git a/xfa/fxfa/parser/xfa_localevalue.cpp b/xfa/fxfa/parser/xfa_localevalue.cpp index f5d95ad48f..0ec38d523f 100644 --- a/xfa/fxfa/parser/xfa_localevalue.cpp +++ b/xfa/fxfa/parser/xfa_localevalue.cpp @@ -8,7 +8,6 @@ #include "core/fxcrt/include/fx_ext.h" #include "xfa/fgas/localization/fgas_localeimp.h" -#include "xfa/fxfa/parser/xfa_doclayout.h" #include "xfa/fxfa/parser/xfa_document.h" #include "xfa/fxfa/parser/xfa_localemgr.h" #include "xfa/fxfa/parser/xfa_object.h" diff --git a/xfa/fxfa/parser/xfa_utils_imp.cpp b/xfa/fxfa/parser/xfa_utils_imp.cpp index 50438b7a09..064ef6c323 100644 --- a/xfa/fxfa/parser/xfa_utils_imp.cpp +++ b/xfa/fxfa/parser/xfa_utils_imp.cpp @@ -10,7 +10,6 @@ #include "xfa/fde/xml/fde_xml_imp.h" #include "xfa/fxfa/parser/cxfa_measurement.h" #include "xfa/fxfa/parser/xfa_basic_data.h" -#include "xfa/fxfa/parser/xfa_doclayout.h" #include "xfa/fxfa/parser/xfa_document.h" #include "xfa/fxfa/parser/xfa_localemgr.h" #include "xfa/fxfa/parser/xfa_localevalue.h" -- cgit v1.2.3