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/cjx_instancemanager.cpp | |
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/cjx_instancemanager.cpp')
-rw-r--r-- | fxjs/xfa/cjx_instancemanager.cpp | 18 |
1 files changed, 9 insertions, 9 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, |