diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-11-01 20:51:27 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-11-01 20:51:27 +0000 |
commit | 14fe518ae67eac22cc169517e69092f62a195913 (patch) | |
tree | 5dc56f72eb362ece77e24d01cb58c8536a42c2c2 /fxjs/cjx_layoutpseudomodel.cpp | |
parent | 1bc5e494b675aeb5e73cae1d0d3cfad341a05a60 (diff) | |
download | pdfium-14fe518ae67eac22cc169517e69092f62a195913.tar.xz |
Add GetDocument() helper to CJX_Object
Change-Id: I710ea0baa1befb093d7174d4fc61a5ab28e9f92a
Reviewed-on: https://pdfium-review.googlesource.com/17315
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'fxjs/cjx_layoutpseudomodel.cpp')
-rw-r--r-- | fxjs/cjx_layoutpseudomodel.cpp | 41 |
1 files changed, 13 insertions, 28 deletions
diff --git a/fxjs/cjx_layoutpseudomodel.cpp b/fxjs/cjx_layoutpseudomodel.cpp index 671e8aa7d0..904ef5b88d 100644 --- a/fxjs/cjx_layoutpseudomodel.cpp +++ b/fxjs/cjx_layoutpseudomodel.cpp @@ -29,15 +29,10 @@ CJX_LayoutPseudoModel::CJX_LayoutPseudoModel(CScript_LayoutPseudoModel* model) CJX_LayoutPseudoModel::~CJX_LayoutPseudoModel() {} -CScript_LayoutPseudoModel* CJX_LayoutPseudoModel::GetXFALayoutPseudoModel() { - return static_cast<CScript_LayoutPseudoModel*>(GetXFAObject()); -} - void CJX_LayoutPseudoModel::Ready(CFXJSE_Value* pValue, bool bSetting, XFA_ATTRIBUTE eAttribute) { - CXFA_FFNotify* pNotify = - GetXFALayoutPseudoModel()->GetDocument()->GetNotify(); + CXFA_FFNotify* pNotify = GetDocument()->GetNotify(); if (!pNotify) return; if (bSetting) { @@ -85,8 +80,7 @@ void CJX_LayoutPseudoModel::HWXY(CFXJSE_Arguments* pArguments, int32_t iIndex = iLength >= 3 ? pArguments->GetInt32(2) : 0; - CXFA_LayoutProcessor* pDocLayout = - GetXFALayoutPseudoModel()->GetDocument()->GetDocLayout(); + CXFA_LayoutProcessor* pDocLayout = GetDocument()->GetDocLayout(); if (!pDocLayout) return; @@ -146,8 +140,7 @@ void CJX_LayoutPseudoModel::Y(CFXJSE_Arguments* pArguments) { void CJX_LayoutPseudoModel::NumberedPageCount(CFXJSE_Arguments* pArguments, bool bNumbered) { - CXFA_LayoutProcessor* pDocLayout = - GetXFALayoutPseudoModel()->GetDocument()->GetDocLayout(); + CXFA_LayoutProcessor* pDocLayout = GetDocument()->GetDocLayout(); if (!pDocLayout) return; @@ -187,8 +180,7 @@ void CJX_LayoutPseudoModel::PageSpan(CFXJSE_Arguments* pArguments) { if (!pNode) return; - CXFA_LayoutProcessor* pDocLayout = - GetXFALayoutPseudoModel()->GetDocument()->GetDocLayout(); + CXFA_LayoutProcessor* pDocLayout = GetDocument()->GetDocLayout(); if (!pDocLayout) return; @@ -363,25 +355,20 @@ void CJX_LayoutPseudoModel::PageContent(CFXJSE_Arguments* pArguments) { if (iLength >= 3) bOnPageArea = pArguments->GetInt32(2) == 0 ? false : true; - CXFA_FFNotify* pNotify = - GetXFALayoutPseudoModel()->GetDocument()->GetNotify(); + CXFA_FFNotify* pNotify = GetDocument()->GetNotify(); if (!pNotify) return; - CXFA_LayoutProcessor* pDocLayout = - GetXFALayoutPseudoModel()->GetDocument()->GetDocLayout(); + CXFA_LayoutProcessor* pDocLayout = GetDocument()->GetDocLayout(); if (!pDocLayout) return; - auto pArrayNodeList = pdfium::MakeUnique<CXFA_ArrayNodeList>( - GetXFALayoutPseudoModel()->GetDocument()); + auto pArrayNodeList = pdfium::MakeUnique<CXFA_ArrayNodeList>(GetDocument()); pArrayNodeList->SetArrayNodeList( GetObjArray(pDocLayout, iIndex, wsType, bOnPageArea)); - pArguments->GetReturnValue()->SetObject(pArrayNodeList.release(), - GetXFALayoutPseudoModel() - ->GetDocument() - ->GetScriptContext() - ->GetJseNormalClass()); + pArguments->GetReturnValue()->SetObject( + pArrayNodeList.release(), + GetDocument()->GetScriptContext()->GetJseNormalClass()); } void CJX_LayoutPseudoModel::AbsPageCount(CFXJSE_Arguments* pArguments) { @@ -397,11 +384,10 @@ void CJX_LayoutPseudoModel::SheetCountInBatch(CFXJSE_Arguments* pArguments) { } void CJX_LayoutPseudoModel::Relayout(CFXJSE_Arguments* pArguments) { - CXFA_Node* pRootNode = GetXFALayoutPseudoModel()->GetDocument()->GetRoot(); + CXFA_Node* pRootNode = GetDocument()->GetRoot(); CXFA_Node* pFormRoot = pRootNode->GetFirstChildByClass(XFA_Element::Form); CXFA_Node* pContentRootNode = pFormRoot->GetNodeItem(XFA_NODEITEM_FirstChild); - CXFA_LayoutProcessor* pLayoutProcessor = - GetXFALayoutPseudoModel()->GetDocument()->GetLayoutProcessor(); + CXFA_LayoutProcessor* pLayoutProcessor = GetDocument()->GetLayoutProcessor(); if (pContentRootNode) pLayoutProcessor->AddChangedContainer(pContentRootNode); @@ -457,8 +443,7 @@ void CJX_LayoutPseudoModel::PageInternals(CFXJSE_Arguments* pArguments, if (!pNode) pValue->SetInteger(0); - CXFA_LayoutProcessor* pDocLayout = - GetXFALayoutPseudoModel()->GetDocument()->GetDocLayout(); + CXFA_LayoutProcessor* pDocLayout = GetDocument()->GetDocLayout(); if (!pDocLayout) return; |