diff options
author | Lei Zhang <thestig@chromium.org> | 2015-06-19 15:09:45 -0700 |
---|---|---|
committer | Lei Zhang <thestig@chromium.org> | 2015-06-19 15:09:45 -0700 |
commit | e8d3691c82d1be805ffdce3329d00313af7ce0ab (patch) | |
tree | 39c6aeb956cc865e8f0b88ddcd80d1dd9e4285f7 /core/include | |
parent | cfac954abcab7caf47d3fa3d641c553cba998271 (diff) | |
download | pdfium-e8d3691c82d1be805ffdce3329d00313af7ce0ab.tar.xz |
Replace CFX_MapPtrTemplate with std::map.
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1181593003.
Diffstat (limited to 'core/include')
-rw-r--r-- | core/include/fpdfdoc/fpdf_doc.h | 4 | ||||
-rw-r--r-- | core/include/fxcrt/fx_basic.h | 39 | ||||
-rw-r--r-- | core/include/fxge/fx_font.h | 9 |
3 files changed, 9 insertions, 43 deletions
diff --git a/core/include/fpdfdoc/fpdf_doc.h b/core/include/fpdfdoc/fpdf_doc.h index cb91b96f43..fc9d3bce87 100644 --- a/core/include/fpdfdoc/fpdf_doc.h +++ b/core/include/fpdfdoc/fpdf_doc.h @@ -7,6 +7,8 @@ #ifndef CORE_INCLUDE_FPDFDOC_FPDF_DOC_H_ #define CORE_INCLUDE_FPDFDOC_FPDF_DOC_H_ +#include <map> + #include "../fpdfapi/fpdf_parser.h" #include "../fpdfapi/fpdf_render.h" @@ -181,7 +183,7 @@ protected: UsageType m_eUsageType; - CFX_MapPtrTemplate<const CPDF_Dictionary*, void*> m_OCGStates; + std::map<const CPDF_Dictionary*, FX_BOOL> m_OCGStates; }; class CPDF_LWinParam { diff --git a/core/include/fxcrt/fx_basic.h b/core/include/fxcrt/fx_basic.h index 0083825bb0..d575df6e67 100644 --- a/core/include/fxcrt/fx_basic.h +++ b/core/include/fxcrt/fx_basic.h @@ -853,46 +853,7 @@ protected: CAssoc* GetAssocAt(void* key, FX_DWORD& hash) const; }; -template <class KeyType, class ValueType> -class CFX_MapPtrTemplate : public CFX_MapPtrToPtr -{ -public: - CFX_MapPtrTemplate() : CFX_MapPtrToPtr(10) {} - - FX_BOOL Lookup(KeyType key, ValueType& rValue) const - { - void* pValue = NULL; - if (!CFX_MapPtrToPtr::Lookup((void*)(uintptr_t)key, pValue)) { - return FALSE; - } - rValue = (ValueType)(uintptr_t)pValue; - return TRUE; - } - - ValueType& operator[](KeyType key) - { - return (ValueType&)CFX_MapPtrToPtr::operator []((void*)(uintptr_t)key); - } - - void SetAt(KeyType key, ValueType newValue) - { - CFX_MapPtrToPtr::SetAt((void*)(uintptr_t)key, (void*)(uintptr_t)newValue); - } - - FX_BOOL RemoveKey(KeyType key) - { - return CFX_MapPtrToPtr::RemoveKey((void*)(uintptr_t)key); - } - void GetNextAssoc(FX_POSITION& rNextPosition, KeyType& rKey, ValueType& rValue) const - { - void* pKey = NULL; - void* pValue = NULL; - CFX_MapPtrToPtr::GetNextAssoc(rNextPosition, pKey, pValue); - rKey = (KeyType)(uintptr_t)pKey; - rValue = (ValueType)(uintptr_t)pValue; - } -}; class CFX_CMapDWordToDWord { public: diff --git a/core/include/fxge/fx_font.h b/core/include/fxge/fx_font.h index 31794d6743..5a0a3b2651 100644 --- a/core/include/fxge/fx_font.h +++ b/core/include/fxge/fx_font.h @@ -7,6 +7,8 @@ #ifndef CORE_INCLUDE_FXGE_FX_FONT_H_ #define CORE_INCLUDE_FXGE_FX_FONT_H_ +#include <map> + #include "../fxcrt/fx_system.h" #include "fx_dib.h" @@ -343,7 +345,7 @@ public: CFX_FaceCache* m_Obj; FX_DWORD m_nCount; }; -typedef CFX_MapPtrTemplate<FXFT_Face, CFX_CountedFaceCache*> CFX_FTCacheMap; + class CFX_FontCache { public: @@ -353,8 +355,9 @@ public: void FreeCache(FX_BOOL bRelease = FALSE); private: - CFX_FTCacheMap m_FTFaceMap; - CFX_FTCacheMap m_ExtFaceMap; + using CFX_FTCacheMap = std::map<FXFT_Face, CFX_CountedFaceCache*>; + CFX_FTCacheMap m_FTFaceMap; + CFX_FTCacheMap m_ExtFaceMap; }; class CFX_AutoFontCache { |