summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/cxfa_dataexporter.cpp
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-12-08 10:55:57 -0800
committerCommit bot <commit-bot@chromium.org>2016-12-08 10:55:57 -0800
commit51709bea3ce113df7d36a5fe6415036e26fc3236 (patch)
treeff2cc5da9de834bda8cbc5c92d45c9a5c00b21c3 /xfa/fxfa/parser/cxfa_dataexporter.cpp
parent447b1f3ffc7e0df233d15300bbf8a85ce2bc7278 (diff)
downloadpdfium-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_dataexporter.cpp')
-rw-r--r--xfa/fxfa/parser/cxfa_dataexporter.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/xfa/fxfa/parser/cxfa_dataexporter.cpp b/xfa/fxfa/parser/cxfa_dataexporter.cpp
index a9965f52a5..72d1fa76ba 100644
--- a/xfa/fxfa/parser/cxfa_dataexporter.cpp
+++ b/xfa/fxfa/parser/cxfa_dataexporter.cpp
@@ -6,7 +6,10 @@
#include "xfa/fxfa/parser/cxfa_dataexporter.h"
+#include <vector>
+
#include "core/fxcrt/fx_basic.h"
+#include "third_party/base/stl_util.h"
#include "xfa/fde/xml/fde_xml_imp.h"
#include "xfa/fgas/crt/fgas_codepage.h"
#include "xfa/fxfa/parser/cxfa_document.h"
@@ -217,12 +220,12 @@ void RegenerateFormFile_Changed(CXFA_Node* pNode,
if (wsRawValue.IsEmpty())
break;
- CFX_WideStringArray wsSelTextArray;
+ std::vector<CFX_WideString> wsSelTextArray;
int32_t iStart = 0;
int32_t iEnd = wsRawValue.Find(L'\n', iStart);
iEnd = (iEnd == -1) ? wsRawValue.GetLength() : iEnd;
while (iEnd >= iStart) {
- wsSelTextArray.Add(wsRawValue.Mid(iStart, iEnd - iStart));
+ wsSelTextArray.push_back(wsRawValue.Mid(iStart, iEnd - iStart));
iStart = iEnd + 1;
if (iStart >= wsRawValue.GetLength())
break;
@@ -242,7 +245,8 @@ void RegenerateFormFile_Changed(CXFA_Node* pNode,
buf << FX_WSTRC(L"<");
buf << bodyTagName;
buf << FX_WSTRC(L" xmlns=\"\"\n>");
- for (int32_t i = 0; i < wsSelTextArray.GetSize(); i++) {
+ for (int32_t i = 0; i < pdfium::CollectionSize<int32_t>(wsSelTextArray);
+ i++) {
buf << FX_WSTRC(L"<value\n>");
buf << ExportEncodeContent(wsSelTextArray[i].AsStringC());
buf << FX_WSTRC(L"</value\n>");