diff options
author | Tom Sepez <tsepez@chromium.org> | 2017-03-28 11:16:01 -0700 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-03-28 18:29:05 +0000 |
commit | 9d20d1fc15dba4239642a2e1981e94b244425f11 (patch) | |
tree | b3b056c1fdb7838d342c4fd190397bd9d1efe168 /xfa | |
parent | 6d04ae0a1cc04141564b2a26da887c6a84d0882c (diff) | |
download | pdfium-9d20d1fc15dba4239642a2e1981e94b244425f11.tar.xz |
Remove CFX_ArrayTempalte from cxfa_resolvprocessor.cpp
Change-Id: Ib52f537b6acfbd6573e7ad1be988e6199ca3b7f9
Reviewed-on: https://pdfium-review.googlesource.com/3248
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa')
-rw-r--r-- | xfa/fxfa/parser/cxfa_resolveprocessor.cpp | 33 | ||||
-rw-r--r-- | xfa/fxfa/parser/cxfa_resolveprocessor.h | 2 |
2 files changed, 17 insertions, 18 deletions
diff --git a/xfa/fxfa/parser/cxfa_resolveprocessor.cpp b/xfa/fxfa/parser/cxfa_resolveprocessor.cpp index a00b4a6254..184cebb120 100644 --- a/xfa/fxfa/parser/cxfa_resolveprocessor.cpp +++ b/xfa/fxfa/parser/cxfa_resolveprocessor.cpp @@ -476,16 +476,15 @@ int32_t CXFA_ResolveProcessor::ResolveAsterisk(CXFA_ResolveNodesData& rnd) { return pdfium::CollectionSize<int32_t>(rnd.m_Objects); } -int32_t CXFA_ResolveProcessor::ResolvePopStack( - CFX_ArrayTemplate<int32_t>& stack) { - int32_t nType = -1; - int32_t iSize = stack.GetSize() - 1; - if (iSize > -1) { - nType = stack[iSize]; - stack.RemoveAt(iSize, 1); - } +int32_t CXFA_ResolveProcessor::ResolvePopStack(std::vector<int32_t>* stack) { + if (stack->empty()) + return -1; + + int32_t nType = stack->back(); + stack->pop_back(); return nType; } + int32_t CXFA_ResolveProcessor::GetFilter(const CFX_WideStringC& wsExpression, int32_t nStart, CXFA_ResolveNodesData& rnd) { @@ -500,7 +499,7 @@ int32_t CXFA_ResolveProcessor::GetFilter(const CFX_WideStringC& wsExpression, wchar_t* pConditionBuf = wsCondition.GetBuffer(iLength - nStart); int32_t nNameCount = 0; int32_t nConditionCount = 0; - CFX_ArrayTemplate<int32_t> stack; + std::vector<int32_t> stack; int32_t nType = -1; const wchar_t* pSrc = wsExpression.c_str(); wchar_t wPrev = 0, wCur; @@ -538,19 +537,19 @@ int32_t CXFA_ResolveProcessor::GetFilter(const CFX_WideStringC& wsExpression, switch (nType) { case 0: if (wCur == ']') { - nType = ResolvePopStack(stack); + nType = ResolvePopStack(&stack); bRecursive = false; } break; case 1: if (wCur == ')') { - nType = ResolvePopStack(stack); + nType = ResolvePopStack(&stack); bRecursive = false; } break; case 2: if (wCur == '"') { - nType = ResolvePopStack(stack); + nType = ResolvePopStack(&stack); bRecursive = false; } break; @@ -558,24 +557,24 @@ int32_t CXFA_ResolveProcessor::GetFilter(const CFX_WideStringC& wsExpression, if (bRecursive) { switch (wCur) { case '[': - stack.Add(nType); + stack.push_back(nType); nType = 0; break; case '(': - stack.Add(nType); + stack.push_back(nType); nType = 1; break; case '"': - stack.Add(nType); + stack.push_back(nType); nType = 2; break; } } wPrev = wCur; } - if (stack.GetSize() > 0) { + if (!stack.empty()) return -1; - } + wsName.ReleaseBuffer(nNameCount); wsName.TrimLeft(); wsName.TrimRight(); diff --git a/xfa/fxfa/parser/cxfa_resolveprocessor.h b/xfa/fxfa/parser/cxfa_resolveprocessor.h index e9c2cce439..a44282a43d 100644 --- a/xfa/fxfa/parser/cxfa_resolveprocessor.h +++ b/xfa/fxfa/parser/cxfa_resolveprocessor.h @@ -61,7 +61,7 @@ class CXFA_ResolveProcessor { int32_t ResolveNumberSign(CXFA_ResolveNodesData& rnd); int32_t ResolveAsterisk(CXFA_ResolveNodesData& rnd); int32_t ResolveNormal(CXFA_ResolveNodesData& rnd); - int32_t ResolvePopStack(CFX_ArrayTemplate<int32_t>& stack); + int32_t ResolvePopStack(std::vector<int32_t>* stack); void SetStylesForChild(uint32_t dwParentStyles, CXFA_ResolveNodesData& rnd); void ConditionArray(int32_t iCurIndex, |