summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/cxfa_localevalue.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/fxfa/parser/cxfa_localevalue.cpp')
-rw-r--r--xfa/fxfa/parser/cxfa_localevalue.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/xfa/fxfa/parser/cxfa_localevalue.cpp b/xfa/fxfa/parser/cxfa_localevalue.cpp
index 15082ae5e3..c201f88ef2 100644
--- a/xfa/fxfa/parser/cxfa_localevalue.cpp
+++ b/xfa/fxfa/parser/cxfa_localevalue.cpp
@@ -99,6 +99,9 @@ bool CXFA_LocaleValue::ValidateValue(const WideString& wsValue,
const WideString& wsPattern,
LocaleIface* pLocale,
WideString* pMatchFormat) {
+ if (!m_pLocaleMgr)
+ return false;
+
WideString wsOutput;
LocaleIface* locale = m_pLocaleMgr->GetDefLocale();
if (pLocale)
@@ -109,10 +112,9 @@ bool CXFA_LocaleValue::ValidateValue(const WideString& wsValue,
pFormat->SplitFormatString(wsPattern, &wsPatterns);
bool bRet = false;
- int32_t iCount = pdfium::CollectionSize<int32_t>(wsPatterns);
- int32_t i = 0;
- for (; i < iCount && !bRet; i++) {
- WideString wsFormat = wsPatterns[i];
+ size_t i = 0;
+ for (; !bRet && i < wsPatterns.size(); i++) {
+ const WideString& wsFormat = wsPatterns[i];
switch (ValueCategory(pFormat->GetCategory(wsFormat), m_dwType)) {
case FX_LOCALECATEGORY_Null:
bRet = pFormat->ParseNull(wsValue, wsFormat);