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/xfa_localevalue.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/xfa_localevalue.cpp')
-rw-r--r-- | xfa/fxfa/parser/xfa_localevalue.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/xfa/fxfa/parser/xfa_localevalue.cpp b/xfa/fxfa/parser/xfa_localevalue.cpp index c060fe8166..87961358e8 100644 --- a/xfa/fxfa/parser/xfa_localevalue.cpp +++ b/xfa/fxfa/parser/xfa_localevalue.cpp @@ -6,8 +6,11 @@ #include "xfa/fxfa/parser/xfa_localevalue.h" +#include <vector> + #include "core/fxcrt/fx_ext.h" #include "third_party/base/ptr_util.h" +#include "third_party/base/stl_util.h" #include "xfa/fgas/localization/fgas_localeimp.h" #include "xfa/fxfa/parser/cxfa_document.h" #include "xfa/fxfa/parser/xfa_localemgr.h" @@ -105,11 +108,11 @@ bool CXFA_LocaleValue::ValidateValue(const CFX_WideString& wsValue, m_pLocaleMgr->SetDefLocale(pLocale); auto pFormat = pdfium::MakeUnique<CFX_FormatString>(m_pLocaleMgr, false); - CFX_WideStringArray wsPatterns; + std::vector<CFX_WideString> wsPatterns; pFormat->SplitFormatString(wsPattern, wsPatterns); bool bRet = false; - int32_t iCount = wsPatterns.GetSize(); + int32_t iCount = pdfium::CollectionSize<int32_t>(wsPatterns); int32_t i = 0; for (; i < iCount && !bRet; i++) { CFX_WideString wsFormat = wsPatterns[i]; @@ -464,10 +467,10 @@ bool CXFA_LocaleValue::FormatPatterns(CFX_WideString& wsResult, IFX_Locale* pLocale, XFA_VALUEPICTURE eValueType) const { auto pFormat = pdfium::MakeUnique<CFX_FormatString>(m_pLocaleMgr, false); - CFX_WideStringArray wsPatterns; + std::vector<CFX_WideString> wsPatterns; pFormat->SplitFormatString(wsFormat, wsPatterns); wsResult.clear(); - int32_t iCount = wsPatterns.GetSize(); + int32_t iCount = pdfium::CollectionSize<int32_t>(wsPatterns); for (int32_t i = 0; i < iCount; i++) { if (FormatSinglePattern(wsResult, wsPatterns[i], pLocale, eValueType)) return true; @@ -793,10 +796,10 @@ bool CXFA_LocaleValue::ParsePatternValue(const CFX_WideString& wsValue, m_pLocaleMgr->SetDefLocale(pLocale); auto pFormat = pdfium::MakeUnique<CFX_FormatString>(m_pLocaleMgr, false); - CFX_WideStringArray wsPatterns; + std::vector<CFX_WideString> wsPatterns; pFormat->SplitFormatString(wsPattern, wsPatterns); bool bRet = false; - int32_t iCount = wsPatterns.GetSize(); + int32_t iCount = pdfium::CollectionSize<int32_t>(wsPatterns); for (int32_t i = 0; i < iCount && !bRet; i++) { CFX_WideString wsFormat = wsPatterns[i]; FX_LOCALECATEGORY eCategory = pFormat->GetCategory(wsFormat); |