diff options
author | tsepez <tsepez@chromium.org> | 2016-04-25 11:23:43 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-04-25 11:23:43 -0700 |
commit | b6853cfe4fd1ee089dfdd0cb09bbc4063532ef82 (patch) | |
tree | 1404031e845c8b4b09d5a68fd81f09a7d2865d59 /xfa/fgas/localization | |
parent | 2a8a20cde4c8e2294f6868bb097fe450960a709f (diff) | |
download | pdfium-b6853cfe4fd1ee089dfdd0cb09bbc4063532ef82.tar.xz |
Pass CFX_*StringCs to FX_HashCode_GETA and _GETW hash functions.
Too many calls were of the form fn(x.c_str(), x.GetLength())
which is an anti-pattern given the StringC classes which tie
these together.
There are a few places where explicit CFX_*StringCs are
constructed, but this can be avoided by changing the args
to these functions in the same manner.
Removed String_ from name of functions since it added
little value. Also removed default argument.
Review URL: https://codereview.chromium.org/1919563002
Diffstat (limited to 'xfa/fgas/localization')
-rw-r--r-- | xfa/fgas/localization/fgas_locale.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/xfa/fgas/localization/fgas_locale.cpp b/xfa/fgas/localization/fgas_locale.cpp index 6e0add1fa5..9a8e05cbc7 100644 --- a/xfa/fgas/localization/fgas_locale.cpp +++ b/xfa/fgas/localization/fgas_locale.cpp @@ -595,8 +595,7 @@ FX_LOCALECATEGORY CFX_FormatString::GetCategory( wsCategory += pStr[ccf]; ccf++; } - uint32_t dwHash = - FX_HashCode_String_GetW(wsCategory.c_str(), wsCategory.GetLength()); + uint32_t dwHash = FX_HashCode_GetW(wsCategory.AsStringC(), false); if (dwHash == FX_LOCALECATEGORY_DateHash) { if (eCategory == FX_LOCALECATEGORY_Time) { return FX_LOCALECATEGORY_DateTime; @@ -755,8 +754,8 @@ IFX_Locale* CFX_FormatString::GetNumericFormat(const CFX_WideString& wsPattern, while (ccf < iLenf && pStr[ccf] != '(' && pStr[ccf] != '{') { wsSubCategory += pStr[ccf++]; } - uint32_t dwSubHash = FX_HashCode_String_GetW( - wsSubCategory.c_str(), wsSubCategory.GetLength()); + uint32_t dwSubHash = + FX_HashCode_GetW(wsSubCategory.AsStringC(), false); FX_LOCALENUMSUBCATEGORY eSubCategory = FX_LOCALENUMPATTERN_Decimal; for (int32_t i = 0; i < g_iFXLocaleNumSubCatCount; i++) { if (g_FXLocaleNumSubCatData[i].uHash == dwSubHash) { @@ -2209,8 +2208,8 @@ FX_DATETIMETYPE CFX_FormatString::GetDateTimeFormat( while (ccf < iLenf && pStr[ccf] != '(' && pStr[ccf] != '{') { wsSubCategory += pStr[ccf++]; } - uint32_t dwSubHash = FX_HashCode_String_GetW( - wsSubCategory.c_str(), wsSubCategory.GetLength()); + uint32_t dwSubHash = + FX_HashCode_GetW(wsSubCategory.AsStringC(), false); FX_LOCALEDATETIMESUBCATEGORY eSubCategory = FX_LOCALEDATETIMESUBCATEGORY_Medium; for (int32_t i = 0; i < g_iFXLocaleDateTimeSubCatCount; i++) { |