From 87c1fdcc9a5669e29c4440e2b220587de7134e7a Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Mon, 30 Jul 2018 21:50:07 +0000 Subject: Don't static_cast<>(this) to subclass in CXFA_LayoutItem methods. Instead, move the methods to the subclass where they belong. Fix IWYU in CJX_Object.h to fix compilation. Change-Id: I4c71f28235b9cf5000e9ddaf33d6602baf22205f Reviewed-on: https://pdfium-review.googlesource.com/39170 Commit-Queue: Tom Sepez Reviewed-by: Lei Zhang --- fxjs/xfa/cjx_layoutpseudomodel.cpp | 9 ++++++--- fxjs/xfa/cjx_object.h | 1 + 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'fxjs') diff --git a/fxjs/xfa/cjx_layoutpseudomodel.cpp b/fxjs/xfa/cjx_layoutpseudomodel.cpp index ea842c78e0..4c460c8a41 100644 --- a/fxjs/xfa/cjx_layoutpseudomodel.cpp +++ b/fxjs/xfa/cjx_layoutpseudomodel.cpp @@ -92,7 +92,8 @@ CJS_Return CJX_LayoutPseudoModel::HWXY( if (!pDocLayout) return CJS_Return(); - CXFA_LayoutItem* pLayoutItem = pDocLayout->GetLayoutItem(pNode); + CXFA_ContentLayoutItem* pLayoutItem = + ToContentLayoutItem(pDocLayout->GetLayoutItem(pNode)); if (!pLayoutItem) return CJS_Return(); @@ -195,7 +196,8 @@ CJS_Return CJX_LayoutPseudoModel::pageSpan( if (!pDocLayout) return CJS_Return(); - CXFA_LayoutItem* pLayoutItem = pDocLayout->GetLayoutItem(pNode); + CXFA_ContentLayoutItem* pLayoutItem = + ToContentLayoutItem(pDocLayout->GetLayoutItem(pNode)); if (!pLayoutItem) return CJS_Return(runtime->NewNumber(-1)); @@ -473,7 +475,8 @@ CJS_Return CJX_LayoutPseudoModel::PageInternals( if (!pDocLayout) return CJS_Return(); - CXFA_LayoutItem* pLayoutItem = pDocLayout->GetLayoutItem(pNode); + CXFA_ContentLayoutItem* pLayoutItem = + ToContentLayoutItem(pDocLayout->GetLayoutItem(pNode)); if (!pLayoutItem) return CJS_Return(runtime->NewNumber(-1)); diff --git a/fxjs/xfa/cjx_object.h b/fxjs/xfa/cjx_object.h index 5b57cbe6e7..c9042b5049 100644 --- a/fxjs/xfa/cjx_object.h +++ b/fxjs/xfa/cjx_object.h @@ -19,6 +19,7 @@ #include "third_party/base/optional.h" #include "third_party/base/span.h" #include "xfa/fxfa/fxfa_basic.h" +#include "xfa/fxfa/parser/cxfa_measurement.h" class CFXJSE_Value; class CFX_V8; -- cgit v1.2.3