diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2018-01-03 11:25:05 -0500 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-01-03 18:16:30 +0000 |
commit | 9647614a5dcd00d50aacf4e000fd23a5ebb13931 (patch) | |
tree | 2b05d094e17bde6a1464e92850dd67ef50e949f6 /fxjs/xfa | |
parent | cbd4410908e2a4898fdd5e0d6d17591fc2c71f54 (diff) | |
download | pdfium-9647614a5dcd00d50aacf4e000fd23a5ebb13931.tar.xz |
Fold CXFA_OccurData into CXFA_Occur
This CL folds the CXFA_OccurData wrapper into CXFA_Occur.
Change-Id: I52e237e4f6b76f6915c397e924037562fd9eda6a
Reviewed-on: https://pdfium-review.googlesource.com/22130
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'fxjs/xfa')
-rw-r--r-- | fxjs/xfa/cjx_instancemanager.cpp | 18 | ||||
-rw-r--r-- | fxjs/xfa/cjx_object.cpp | 1 | ||||
-rw-r--r-- | fxjs/xfa/cjx_occur.cpp | 13 |
3 files changed, 15 insertions, 17 deletions
diff --git a/fxjs/xfa/cjx_instancemanager.cpp b/fxjs/xfa/cjx_instancemanager.cpp index 86f8cf3e88..4bb09dfd9f 100644 --- a/fxjs/xfa/cjx_instancemanager.cpp +++ b/fxjs/xfa/cjx_instancemanager.cpp @@ -16,7 +16,7 @@ #include "xfa/fxfa/parser/cxfa_document.h" #include "xfa/fxfa/parser/cxfa_instancemanager.h" #include "xfa/fxfa/parser/cxfa_layoutprocessor.h" -#include "xfa/fxfa/parser/cxfa_occurdata.h" +#include "xfa/fxfa/parser/cxfa_occur.h" const CJX_MethodSpec CJX_InstanceManager::MethodSpecs[] = { {"addInstance", addInstance_static}, @@ -33,13 +33,13 @@ CJX_InstanceManager::CJX_InstanceManager(CXFA_InstanceManager* mgr) CJX_InstanceManager::~CJX_InstanceManager() {} int32_t CJX_InstanceManager::SetInstances(int32_t iDesired) { - CXFA_OccurData occurData(GetXFANode()->GetOccurNode()); - if (iDesired < occurData.GetMin()) { + CXFA_Occur* occur = GetXFANode()->GetOccur(); + if (iDesired < occur->GetMin()) { ThrowTooManyOccurancesException(L"min"); return 1; } - int32_t iMax = occurData.GetMax(); + int32_t iMax = occur->GetMax(); if (iMax >= 0 && iDesired > iMax) { ThrowTooManyOccurancesException(L"max"); return 2; @@ -154,7 +154,7 @@ CJS_Return CJX_InstanceManager::removeInstance( if (iIndex < 0 || iIndex >= iCount) return CJS_Return(JSGetStringFromID(JSMessage::kInvalidInputError)); - int32_t iMin = CXFA_OccurData(GetXFANode()->GetOccurNode()).GetMin(); + int32_t iMin = GetXFANode()->GetOccur()->GetMin(); if (iCount - 1 < iMin) return CJS_Return(JSGetStringFromID(JSMessage::kTooManyOccurances)); @@ -200,7 +200,7 @@ CJS_Return CJX_InstanceManager::addInstance( fFlags = runtime->ToBoolean(params[0]); int32_t iCount = GetXFANode()->GetCount(); - int32_t iMax = CXFA_OccurData(GetXFANode()->GetOccurNode()).GetMax(); + int32_t iMax = GetXFANode()->GetOccur()->GetMax(); if (iMax >= 0 && iCount >= iMax) return CJS_Return(JSGetStringFromID(JSMessage::kTooManyOccurances)); @@ -241,7 +241,7 @@ CJS_Return CJX_InstanceManager::insertInstance( if (iIndex < 0 || iIndex > iCount) return CJS_Return(JSGetStringFromID(JSMessage::kInvalidInputError)); - int32_t iMax = CXFA_OccurData(GetXFANode()->GetOccurNode()).GetMax(); + int32_t iMax = GetXFANode()->GetOccur()->GetMax(); if (iMax >= 0 && iCount >= iMax) return CJS_Return(JSGetStringFromID(JSMessage::kInvalidInputError)); @@ -273,7 +273,7 @@ void CJX_InstanceManager::max(CFXJSE_Value* pValue, ThrowInvalidPropertyException(); return; } - pValue->SetInteger(CXFA_OccurData(GetXFANode()->GetOccurNode()).GetMax()); + pValue->SetInteger(GetXFANode()->GetOccur()->GetMax()); } void CJX_InstanceManager::min(CFXJSE_Value* pValue, @@ -283,7 +283,7 @@ void CJX_InstanceManager::min(CFXJSE_Value* pValue, ThrowInvalidPropertyException(); return; } - pValue->SetInteger(CXFA_OccurData(GetXFANode()->GetOccurNode()).GetMin()); + pValue->SetInteger(GetXFANode()->GetOccur()->GetMin()); } void CJX_InstanceManager::count(CFXJSE_Value* pValue, diff --git a/fxjs/xfa/cjx_object.cpp b/fxjs/xfa/cjx_object.cpp index b1e3030020..b1324f1d5f 100644 --- a/fxjs/xfa/cjx_object.cpp +++ b/fxjs/xfa/cjx_object.cpp @@ -27,7 +27,6 @@ #include "xfa/fxfa/parser/cxfa_node.h" #include "xfa/fxfa/parser/cxfa_object.h" #include "xfa/fxfa/parser/cxfa_occur.h" -#include "xfa/fxfa/parser/cxfa_occurdata.h" #include "xfa/fxfa/parser/cxfa_proto.h" #include "xfa/fxfa/parser/cxfa_subform.h" #include "xfa/fxfa/parser/cxfa_validate.h" diff --git a/fxjs/xfa/cjx_occur.cpp b/fxjs/xfa/cjx_occur.cpp index f5540c0c7a..f57cd96cb5 100644 --- a/fxjs/xfa/cjx_occur.cpp +++ b/fxjs/xfa/cjx_occur.cpp @@ -10,7 +10,6 @@ #include "fxjs/cfxjse_value.h" #include "xfa/fxfa/parser/cxfa_occur.h" -#include "xfa/fxfa/parser/cxfa_occurdata.h" CJX_Occur::CJX_Occur(CXFA_Occur* node) : CJX_Node(node) {} @@ -19,23 +18,23 @@ CJX_Occur::~CJX_Occur() = default; void CJX_Occur::max(CFXJSE_Value* pValue, bool bSetting, XFA_Attribute eAttribute) { - CXFA_OccurData occurData(GetXFANode()); + CXFA_Occur* occur = static_cast<CXFA_Occur*>(GetXFANode()); if (!bSetting) { - pValue->SetInteger(occurData.GetMax()); + pValue->SetInteger(occur->GetMax()); return; } - occurData.SetMax(pValue->ToInteger()); + occur->SetMax(pValue->ToInteger()); } void CJX_Occur::min(CFXJSE_Value* pValue, bool bSetting, XFA_Attribute eAttribute) { - CXFA_OccurData occurData(GetXFANode()); + CXFA_Occur* occur = static_cast<CXFA_Occur*>(GetXFANode()); if (!bSetting) { - pValue->SetInteger(occurData.GetMin()); + pValue->SetInteger(occur->GetMin()); return; } - occurData.SetMin(pValue->ToInteger()); + occur->SetMin(pValue->ToInteger()); } void CJX_Occur::use(CFXJSE_Value* pValue, |