summaryrefslogtreecommitdiff
path: root/fxjs/xfa/cjx_layoutpseudomodel.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2018-02-08 21:01:01 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-02-08 21:01:01 +0000
commit3645652fb6cad1f94c9647f033a8e300bc37d521 (patch)
tree136dd8524455efdc4bbc32eed7914d3a3b5376e0 /fxjs/xfa/cjx_layoutpseudomodel.cpp
parent3c62d20a385d31315a392206de53c9fe72a08db1 (diff)
downloadpdfium-3645652fb6cad1f94c9647f033a8e300bc37d521.tar.xz
Move XFA-specific methods out of CJS_V8.
These belong more properly in CFXJS_Engine, and a small amount of casting is required to get to the sub-class. Change-Id: Id954d182b7a7d51fe0a522c04a50a1b362746c72 Reviewed-on: https://pdfium-review.googlesource.com/26050 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'fxjs/xfa/cjx_layoutpseudomodel.cpp')
-rw-r--r--fxjs/xfa/cjx_layoutpseudomodel.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/fxjs/xfa/cjx_layoutpseudomodel.cpp b/fxjs/xfa/cjx_layoutpseudomodel.cpp
index 384bd09d63..ba17ed8b8b 100644
--- a/fxjs/xfa/cjx_layoutpseudomodel.cpp
+++ b/fxjs/xfa/cjx_layoutpseudomodel.cpp
@@ -75,7 +75,8 @@ CJS_Return CJX_LayoutPseudoModel::HWXY(
if (params.empty() || params.size() > 3)
return CJS_Return(JSGetStringFromID(JSMessage::kParamError));
- CXFA_Node* pNode = ToNode(runtime->ToXFAObject(params[0]));
+ CXFA_Node* pNode =
+ ToNode(static_cast<CFXJSE_Engine*>(runtime)->ToXFAObject(params[0]));
if (!pNode)
return CJS_Return(true);
@@ -185,7 +186,8 @@ CJS_Return CJX_LayoutPseudoModel::pageSpan(
if (params.size() != 1)
return CJS_Return(JSGetStringFromID(JSMessage::kParamError));
- CXFA_Node* pNode = ToNode(runtime->ToXFAObject(params[0]));
+ CXFA_Node* pNode =
+ ToNode(static_cast<CFXJSE_Engine*>(runtime)->ToXFAObject(params[0]));
if (!pNode)
return CJS_Return(true);
@@ -374,7 +376,7 @@ CJS_Return CJX_LayoutPseudoModel::pageContent(
GetObjArray(pDocLayout, iIndex, wsType, bOnPageArea));
// TODO(dsinclair): Who owns the array once we release it? Won't this leak?
- return CJS_Return(runtime->NewXFAObject(
+ return CJS_Return(static_cast<CFXJSE_Engine*>(runtime)->NewXFAObject(
pArrayNodeList.release(),
GetDocument()->GetScriptContext()->GetJseNormalClass()->GetTemplate()));
}
@@ -465,7 +467,8 @@ CJS_Return CJX_LayoutPseudoModel::PageInternals(
if (params.size() != 1)
return CJS_Return(JSGetStringFromID(JSMessage::kParamError));
- CXFA_Node* pNode = ToNode(runtime->ToXFAObject(params[0]));
+ CXFA_Node* pNode =
+ ToNode(static_cast<CFXJSE_Engine*>(runtime)->ToXFAObject(params[0]));
if (!pNode)
return CJS_Return(runtime->NewNumber(0));