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/fxfa/app/xfa_ffdoc.cpp | |
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/fxfa/app/xfa_ffdoc.cpp')
-rw-r--r-- | xfa/fxfa/app/xfa_ffdoc.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/xfa/fxfa/app/xfa_ffdoc.cpp b/xfa/fxfa/app/xfa_ffdoc.cpp index 1fecee7547..4b0f67bb6a 100644 --- a/xfa/fxfa/app/xfa_ffdoc.cpp +++ b/xfa/fxfa/app/xfa_ffdoc.cpp @@ -326,8 +326,7 @@ CFX_DIBitmap* CXFA_FFDoc::GetPDFNamedImage(const CFX_WideStringC& wsName, if (!m_pPDFDoc) return nullptr; - uint32_t dwHash = - FX_HashCode_String_GetW(wsName.c_str(), wsName.GetLength(), FALSE); + uint32_t dwHash = FX_HashCode_GetW(wsName, false); FX_IMAGEDIB_AND_DPI* imageDIBDpi = nullptr; if (m_mapNamedImages.Lookup((void*)(uintptr_t)dwHash, (void*&)imageDIBDpi)) { iImageXDpi = imageDIBDpi->iImageXDpi; @@ -384,8 +383,7 @@ CFX_DIBitmap* CXFA_FFDoc::GetPDFNamedImage(const CFX_WideStringC& wsName, } CFDE_XMLElement* CXFA_FFDoc::GetPackageData(const CFX_WideStringC& wsPackage) { - uint32_t packetHash = - FX_HashCode_String_GetW(wsPackage.c_str(), wsPackage.GetLength()); + uint32_t packetHash = FX_HashCode_GetW(wsPackage, false); CXFA_Node* pNode = ToNode(m_pDocument->GetXFAObject(packetHash)); if (!pNode) { return NULL; @@ -399,8 +397,7 @@ FX_BOOL CXFA_FFDoc::SavePackage(const CFX_WideStringC& wsPackage, IFX_FileWrite* pFile, CXFA_ChecksumContext* pCSContext) { CXFA_DataExporter* pExport = new CXFA_DataExporter(m_pDocument); - uint32_t packetHash = - FX_HashCode_String_GetW(wsPackage.c_str(), wsPackage.GetLength()); + uint32_t packetHash = FX_HashCode_GetW(wsPackage, false); CXFA_Node* pNode = NULL; if (packetHash == XFA_HASHCODE_Xfa) { pNode = m_pDocument->GetRoot(); |