diff options
author | dsinclair <dsinclair@chromium.org> | 2016-07-21 12:03:01 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-07-21 12:03:02 -0700 |
commit | 0b851fffe118d8be26e776256144a6b85495ce74 (patch) | |
tree | 909dd6a08a506894f1953fb00e8afc8c27c8dd8e /xfa | |
parent | 9eb0db1d7f6273de7eb28b0e1490eaf893e3bfb5 (diff) | |
download | pdfium-0b851fffe118d8be26e776256144a6b85495ce74.tar.xz |
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
Diffstat (limited to 'xfa')
40 files changed, 295 insertions, 224 deletions
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<CXFA_ContainerLayoutItem*>(this) + : nullptr; +} +CXFA_ContentLayoutItem* CXFA_LayoutItem::AsContentLayoutItem() { + return IsContentLayoutItem() ? static_cast<CXFA_ContentLayoutItem*>(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/xfa_document_layout_imp.cpp b/xfa/fxfa/parser/cxfa_layoutprocessor.cpp index ec407a2757..7ebe5285e3 100644 --- a/xfa/fxfa/parser/xfa_document_layout_imp.cpp +++ b/xfa/fxfa/parser/cxfa_layoutprocessor.cpp @@ -1,13 +1,12 @@ -// Copyright 2014 PDFium Authors. All rights reserved. +// 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/xfa_document_layout_imp.h" +#include "xfa/fxfa/parser/cxfa_layoutprocessor.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" @@ -24,18 +23,22 @@ CXFA_LayoutProcessor* CXFA_Document::GetLayoutProcessor() { } 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; } @@ -49,32 +52,29 @@ int32_t CXFA_LayoutProcessor::StartLayout(FX_BOOL bForceRestart) { m_nProgressCounter = 0; CXFA_Node* pFormPacketNode = ToNode(m_pDocument->GetXFAObject(XFA_HASHCODE_Form)); - if (!pFormPacketNode) { + if (!pFormPacketNode) return -1; - } + CXFA_Node* pFormRoot = pFormPacketNode->GetFirstChildByClass(XFA_Element::Subform); - if (!pFormRoot) { + if (!pFormRoot) return -1; - } - if (!m_pLayoutPageMgr) { + if (!m_pLayoutPageMgr) m_pLayoutPageMgr = new CXFA_LayoutPageMgr(this); - } - if (!m_pLayoutPageMgr->InitLayoutPage(pFormRoot)) { + if (!m_pLayoutPageMgr->InitLayoutPage(pFormRoot)) return -1; - } - if (!m_pLayoutPageMgr->PrepareFirstPage(pFormRoot)) { + 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) { + 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); @@ -83,17 +83,18 @@ int32_t CXFA_LayoutProcessor::DoLayout(IFX_Pause* pPause) { FX_FLOAT fAvailHeight = m_pLayoutPageMgr->GetAvailHeight(); eStatus = m_pRootItemLayoutProcessor->DoLayout(TRUE, fAvailHeight, fAvailHeight); - if (eStatus != XFA_ItemLayoutProcessorResult_Done) { + if (eStatus != XFA_ItemLayoutProcessorResult_Done) m_nProgressCounter++; - } + CXFA_ContentLayoutItem* pLayoutItem = m_pRootItemLayoutProcessor->ExtractLayoutItem(); - if (pLayoutItem) { + 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(); @@ -105,18 +106,19 @@ int32_t CXFA_LayoutProcessor::DoLayout(IFX_Pause* pPause) { : 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) { + if (!pParentNode) return FALSE; - } if (!CXFA_ItemLayoutProcessor::IncrementRelayoutNode(this, pNode, pParentNode)) { return FALSE; @@ -125,21 +127,25 @@ FX_BOOL CXFA_LayoutProcessor::IncrementLayout() { 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<CXFA_LayoutItem*>( pFormItem->GetUserData(XFA_LAYOUTITEMKEY)); } + void CXFA_LayoutProcessor::AddChangedContainer(CXFA_Node* pContainer) { - if (m_rgChangedContainers.Find(pContainer) < 0) { + if (m_rgChangedContainers.Find(pContainer) < 0) m_rgChangedContainers.Add(pContainer); - } } + CXFA_ContainerLayoutItem* CXFA_LayoutProcessor::GetRootLayoutItem() const { return m_pLayoutPageMgr ? m_pLayoutPageMgr->GetRootLayoutItem() : nullptr; } @@ -155,49 +161,3 @@ void CXFA_LayoutProcessor::ClearLayoutData() { 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/cxfa_layoutprocessor.h index 87f7ca01af..1e66402720 100644 --- a/xfa/fxfa/parser/xfa_document_layout_imp.h +++ b/xfa/fxfa/parser/cxfa_layoutprocessor.h @@ -1,17 +1,22 @@ -// Copyright 2014 PDFium Authors. All rights reserved. +// 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_XFA_DOCUMENT_LAYOUT_IMP_H_ -#define XFA_FXFA_PARSER_XFA_DOCUMENT_LAYOUT_IMP_H_ +#ifndef XFA_FXFA_PARSER_CXFA_LAYOUTPROCESSOR_H_ +#define XFA_FXFA_PARSER_CXFA_LAYOUTPROCESSOR_H_ -#include "xfa/fxfa/parser/xfa_doclayout.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_ContainerLayoutItem; +class CXFA_Node; +class IFX_Pause; class CXFA_LayoutProcessor { public: @@ -34,7 +39,7 @@ class CXFA_LayoutProcessor { } CXFA_LayoutPageMgr* GetLayoutPageMgr() { return m_pLayoutPageMgr; } - protected: + private: void ClearLayoutData(); FX_BOOL IsNeedLayout(); @@ -47,4 +52,4 @@ class CXFA_LayoutProcessor { FX_BOOL m_bNeeLayout; }; -#endif // XFA_FXFA_PARSER_XFA_DOCUMENT_LAYOUT_IMP_H_ +#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<CXFA_ContainerLayoutItem*>(this) - : nullptr; -} -CXFA_ContentLayoutItem* CXFA_LayoutItem::AsContentLayoutItem() { - return IsContentLayoutItem() ? static_cast<CXFA_ContentLayoutItem*>(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_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 <map> #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" |