Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(162)

Unified Diff: xfa/fde/css/fde_csscache.cpp

Issue 1919563002: Pass CFX_*StringCs to FX_HashCode_GETA and _GETW hash functions. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: fix issue from c4 Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « fpdfsdk/javascript/global.cpp ('k') | xfa/fde/css/fde_cssdatatable.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fde/css/fde_csscache.cpp
diff --git a/xfa/fde/css/fde_csscache.cpp b/xfa/fde/css/fde_csscache.cpp
index e23b4c6377c830bf9abe1650e85423bef185148b..9a259e1844e5b7b22dbf1d13c2a80c2e5c7e11cb 100644
--- a/xfa/fde/css/fde_csscache.cpp
+++ b/xfa/fde/css/fde_csscache.cpp
@@ -29,26 +29,19 @@ FDE_CSSTagCache::FDE_CSSTagCache(FDE_CSSTagCache* parent,
dwTagHash(0),
iClassIndex(0),
dwClassHashs(1) {
- static const uint32_t s_dwIDHash = FX_HashCode_String_GetW(L"id", 2, TRUE);
- static const uint32_t s_dwClassHash =
- FX_HashCode_String_GetW(L"class", 5, TRUE);
-
- CFX_WideString wsTag = pTag->GetTagName();
- dwTagHash = FX_HashCode_String_GetW(wsTag.c_str(), wsTag.GetLength(), TRUE);
+ static const uint32_t s_dwIDHash = FX_HashCode_GetW(L"id", true);
+ static const uint32_t s_dwClassHash = FX_HashCode_GetW(L"class", true);
+ dwTagHash = FX_HashCode_GetW(pTag->GetTagName().AsStringC(), true);
for (auto it : *pTag) {
CFX_WideString wsValue = it.first;
CFX_WideString wsName = it.second;
-
- uint32_t dwNameHash =
- FX_HashCode_String_GetW(wsName.c_str(), wsName.GetLength(), TRUE);
-
+ uint32_t dwNameHash = FX_HashCode_GetW(wsName.AsStringC(), true);
if (dwNameHash == s_dwClassHash) {
- uint32_t dwHash =
- FX_HashCode_String_GetW(wsValue.c_str(), wsValue.GetLength());
+ uint32_t dwHash = FX_HashCode_GetW(wsValue.AsStringC(), false);
dwClassHashs.Add(dwHash);
} else if (dwNameHash == s_dwIDHash) {
- dwIDHash = FX_HashCode_String_GetW(wsValue.c_str(), wsValue.GetLength());
+ dwIDHash = FX_HashCode_GetW(wsValue.AsStringC(), false);
}
}
}
« no previous file with comments | « fpdfsdk/javascript/global.cpp ('k') | xfa/fde/css/fde_cssdatatable.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698