summaryrefslogtreecommitdiff
path: root/xfa/fxfa/fm2js/xfa_simpleexpression.cpp
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-04-28 16:56:08 -0700
committerCommit bot <commit-bot@chromium.org>2016-04-28 16:56:08 -0700
commita31098417852bdf13e693a6e0913e0706cf94098 (patch)
tree7539d764cfc859d8d88ab0162281f2184d1963b7 /xfa/fxfa/fm2js/xfa_simpleexpression.cpp
parent9a1b665f8a6762927b7fa4fb9c812f00e8d3135e (diff)
downloadpdfium-a31098417852bdf13e693a6e0913e0706cf94098.tar.xz
Convert CFX_PtrArray to typesafe CFX_ArrayTemplate, Part 6
Review-Url: https://codereview.chromium.org/1926303002
Diffstat (limited to 'xfa/fxfa/fm2js/xfa_simpleexpression.cpp')
-rw-r--r--xfa/fxfa/fm2js/xfa_simpleexpression.cpp30
1 files changed, 12 insertions, 18 deletions
diff --git a/xfa/fxfa/fm2js/xfa_simpleexpression.cpp b/xfa/fxfa/fm2js/xfa_simpleexpression.cpp
index 468bb3bf89..aad8f7bed0 100644
--- a/xfa/fxfa/fm2js/xfa_simpleexpression.cpp
+++ b/xfa/fxfa/fm2js/xfa_simpleexpression.cpp
@@ -464,20 +464,20 @@ void CXFA_FMNotExpression::ToJavaScript(CFX_WideTextBuf& javascript) {
javascript << FX_WSTRC(L")");
}
-CXFA_FMCallExpression::CXFA_FMCallExpression(uint32_t line,
- CXFA_FMSimpleExpression* pExp,
- CFX_PtrArray* pArguments,
- FX_BOOL bIsSomMethod)
+CXFA_FMCallExpression::CXFA_FMCallExpression(
+ uint32_t line,
+ CXFA_FMSimpleExpression* pExp,
+ CFX_ArrayTemplate<CXFA_FMSimpleExpression*>* pArguments,
+ FX_BOOL bIsSomMethod)
: CXFA_FMUnaryExpression(line, TOKcall, pExp),
m_bIsSomMethod(bIsSomMethod),
m_pArguments(pArguments) {}
CXFA_FMCallExpression::~CXFA_FMCallExpression() {
if (m_pArguments) {
- for (int i = 0; i < m_pArguments->GetSize(); ++i) {
- delete reinterpret_cast<CXFA_FMSimpleExpression*>(m_pArguments->GetAt(i));
- }
- m_pArguments->RemoveAll();
+ for (int i = 0; i < m_pArguments->GetSize(); ++i)
+ delete m_pArguments->GetAt(i);
+
delete m_pArguments;
}
}
@@ -537,9 +537,7 @@ void CXFA_FMCallExpression::ToJavaScript(CFX_WideTextBuf& javascript) {
javascript << gs_lpStrExpFuncName[GETFMVALUE];
}
javascript << FX_WSTRC(L"(");
- CXFA_FMSimpleExpression* e =
- reinterpret_cast<CXFA_FMSimpleExpression*>(
- m_pArguments->GetAt(i));
+ CXFA_FMSimpleExpression* e = m_pArguments->GetAt(i);
e->ToJavaScript(javascript);
javascript << FX_WSTRC(L")");
if (i + 1 < m_pArguments->GetSize()) {
@@ -550,9 +548,7 @@ void CXFA_FMCallExpression::ToJavaScript(CFX_WideTextBuf& javascript) {
for (int i = 0; i < m_pArguments->GetSize(); ++i) {
javascript << gs_lpStrExpFuncName[GETFMVALUE];
javascript << FX_WSTRC(L"(");
- CXFA_FMSimpleExpression* e =
- reinterpret_cast<CXFA_FMSimpleExpression*>(
- m_pArguments->GetAt(i));
+ CXFA_FMSimpleExpression* e = m_pArguments->GetAt(i);
e->ToJavaScript(javascript);
javascript << FX_WSTRC(L")");
if (i + 1 < m_pArguments->GetSize()) {
@@ -586,8 +582,7 @@ void CXFA_FMCallExpression::ToJavaScript(CFX_WideTextBuf& javascript) {
if (isExistsFunc) {
javascript << FX_WSTRC(L"\n(\nfunction ()\n{\ntry\n{\n");
if (m_pArguments && m_pArguments->GetSize() > 0) {
- CXFA_FMSimpleExpression* e =
- reinterpret_cast<CXFA_FMSimpleExpression*>(m_pArguments->GetAt(0));
+ CXFA_FMSimpleExpression* e = m_pArguments->GetAt(0);
javascript << FX_WSTRC(L"return ");
e->ToJavaScript(javascript);
javascript << FX_WSTRC(L";\n}\n");
@@ -598,8 +593,7 @@ void CXFA_FMCallExpression::ToJavaScript(CFX_WideTextBuf& javascript) {
L"catch(accessExceptions)\n{\nreturn 0;\n}\n}\n).call(this)\n");
} else if (m_pArguments) {
for (int i = 0; i < m_pArguments->GetSize(); ++i) {
- CXFA_FMSimpleExpression* e =
- reinterpret_cast<CXFA_FMSimpleExpression*>(m_pArguments->GetAt(i));
+ CXFA_FMSimpleExpression* e = m_pArguments->GetAt(i);
e->ToJavaScript(javascript);
if (i + 1 < m_pArguments->GetSize()) {
javascript << FX_WSTRC(L", ");