summaryrefslogtreecommitdiff
path: root/xfa/fgas/localization/fgas_locale.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/fgas/localization/fgas_locale.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/fgas/localization/fgas_locale.cpp')
-rw-r--r--xfa/fgas/localization/fgas_locale.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/xfa/fgas/localization/fgas_locale.cpp b/xfa/fgas/localization/fgas_locale.cpp
index aea7bacc11..d6ef62885d 100644
--- a/xfa/fgas/localization/fgas_locale.cpp
+++ b/xfa/fgas/localization/fgas_locale.cpp
@@ -7,6 +7,7 @@
#include "xfa/fgas/localization/fgas_locale.h"
#include <algorithm>
+#include <vector>
#include "core/fxcrt/fx_ext.h"
#include "core/fxcrt/fx_xml.h"
@@ -262,9 +263,12 @@ CFX_WideString CFX_LCNumeric::ToString(int32_t nTreading,
CFX_FormatString::CFX_FormatString(IFX_LocaleMgr* pLocaleMgr, bool bUseLCID)
: m_pLocaleMgr(pLocaleMgr), m_bUseLCID(bUseLCID) {}
+
CFX_FormatString::~CFX_FormatString() {}
-void CFX_FormatString::SplitFormatString(const CFX_WideString& wsFormatString,
- CFX_WideStringArray& wsPatterns) {
+
+void CFX_FormatString::SplitFormatString(
+ const CFX_WideString& wsFormatString,
+ std::vector<CFX_WideString>& wsPatterns) {
int32_t iStrLen = wsFormatString.GetLength();
const FX_WCHAR* pStr = wsFormatString.c_str();
const FX_WCHAR* pToken = pStr;
@@ -272,20 +276,19 @@ void CFX_FormatString::SplitFormatString(const CFX_WideString& wsFormatString,
bool iQuote = false;
while (true) {
if (pStr >= pEnd) {
- CFX_WideString sub(pToken, pStr - pToken);
- wsPatterns.Add(sub);
+ wsPatterns.push_back(CFX_WideString(pToken, pStr - pToken));
return;
}
if (*pStr == '\'') {
iQuote = !iQuote;
} else if (*pStr == L'|' && !iQuote) {
- CFX_WideString sub(pToken, pStr - pToken);
- wsPatterns.Add(sub);
+ wsPatterns.push_back(CFX_WideString(pToken, pStr - pToken));
pToken = pStr + 1;
}
pStr++;
}
}
+
static CFX_WideString FX_GetLiteralText(const FX_WCHAR* pStrPattern,
int32_t& iPattern,
int32_t iLenPattern) {