diff options
author | tsepez <tsepez@chromium.org> | 2016-12-08 10:55:57 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-12-08 10:55:57 -0800 |
commit | 51709bea3ce113df7d36a5fe6415036e26fc3236 (patch) | |
tree | ff2cc5da9de834bda8cbc5c92d45c9a5c00b21c3 /xfa/fxfa/parser/cxfa_node.cpp | |
parent | 447b1f3ffc7e0df233d15300bbf8a85ce2bc7278 (diff) | |
download | pdfium-51709bea3ce113df7d36a5fe6415036e26fc3236.tar.xz |
Replace CFX_WideStringArray with std::vector
Minimalist changes with the tidying of the code to
use better loop iterators as a follow-up.
Review-Url: https://codereview.chromium.org/2556963004
Diffstat (limited to 'xfa/fxfa/parser/cxfa_node.cpp')
-rw-r--r-- | xfa/fxfa/parser/cxfa_node.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/xfa/fxfa/parser/cxfa_node.cpp b/xfa/fxfa/parser/cxfa_node.cpp index f3f79cbbec..1721cb7982 100644 --- a/xfa/fxfa/parser/cxfa_node.cpp +++ b/xfa/fxfa/parser/cxfa_node.cpp @@ -9,6 +9,7 @@ #include <map> #include <memory> #include <utility> +#include <vector> #include "core/fxcrt/fx_ext.h" #include "fxjs/cfxjse_value.h" @@ -4150,7 +4151,7 @@ bool CXFA_Node::SetScriptContent(const CFX_WideString& wsContent, bScriptModify, false); CXFA_Node* pBind = GetBindData(); if (bSyncData && pBind) { - CFX_WideStringArray wsSaveTextArray; + std::vector<CFX_WideString> wsSaveTextArray; int32_t iSize = 0; if (!wsContent.IsEmpty()) { int32_t iStart = 0; @@ -4158,17 +4159,18 @@ bool CXFA_Node::SetScriptContent(const CFX_WideString& wsContent, int32_t iEnd = wsContent.Find(L'\n', iStart); iEnd = (iEnd == -1) ? iLength : iEnd; while (iEnd >= iStart) { - wsSaveTextArray.Add(wsContent.Mid(iStart, iEnd - iStart)); + wsSaveTextArray.push_back(wsContent.Mid(iStart, iEnd - iStart)); iStart = iEnd + 1; if (iStart >= iLength) { break; } iEnd = wsContent.Find(L'\n', iStart); if (iEnd < 0) { - wsSaveTextArray.Add(wsContent.Mid(iStart, iLength - iStart)); + wsSaveTextArray.push_back( + wsContent.Mid(iStart, iLength - iStart)); } } - iSize = wsSaveTextArray.GetSize(); + iSize = pdfium::CollectionSize<int32_t>(wsSaveTextArray); } if (iSize == 0) { while (CXFA_Node* pChildNode = |