From eda80ef83f1a28166bbf86c6808dda5f6623f08c Mon Sep 17 00:00:00 2001 From: tsepez Date: Tue, 3 Jan 2017 12:41:21 -0800 Subject: Kill last use of CFX_PtrList. I'd been waiting on this hoping the code would be refactored out of existence, but it looks to be used. Use tests against x.end() in place of a "null position". This is greatly complicated by the use of "tail position", which now calcluated by std::prev(x.end()) unless the list is empty. Review-Url: https://codereview.chromium.org/2592163002 --- core/fxcrt/fx_basic.h | 72 --------------------------------------------------- 1 file changed, 72 deletions(-) (limited to 'core/fxcrt/fx_basic.h') diff --git a/core/fxcrt/fx_basic.h b/core/fxcrt/fx_basic.h index 7096e6f8df..3b09489d71 100644 --- a/core/fxcrt/fx_basic.h +++ b/core/fxcrt/fx_basic.h @@ -433,79 +433,7 @@ class CFX_MapPtrTemplate : public CFX_MapPtrToPtr { rValue = (ValueType)(uintptr_t)pValue; } }; -#endif // PDF_ENABLE_XFA - -class CFX_PtrList { - protected: - struct CNode { - CNode* pNext; - CNode* pPrev; - void* data; - }; - - public: - explicit CFX_PtrList(int nBlockSize = 10); - - FX_POSITION GetHeadPosition() const { return (FX_POSITION)m_pNodeHead; } - FX_POSITION GetTailPosition() const { return (FX_POSITION)m_pNodeTail; } - - void* GetNext(FX_POSITION& rPosition) const { - CNode* pNode = (CNode*)rPosition; - rPosition = (FX_POSITION)pNode->pNext; - return pNode->data; - } - - void* GetPrev(FX_POSITION& rPosition) const { - CNode* pNode = (CNode*)rPosition; - rPosition = (FX_POSITION)pNode->pPrev; - return pNode->data; - } - - FX_POSITION GetNextPosition(FX_POSITION pos) const { - return ((CNode*)pos)->pNext; - } - - FX_POSITION GetPrevPosition(FX_POSITION pos) const { - return ((CNode*)pos)->pPrev; - } - - void* GetAt(FX_POSITION rPosition) const { - CNode* pNode = (CNode*)rPosition; - return pNode->data; - } - int GetCount() const { return m_nCount; } - FX_POSITION AddTail(void* newElement); - FX_POSITION AddHead(void* newElement); - - void SetAt(FX_POSITION pos, void* newElement) { - CNode* pNode = (CNode*)pos; - pNode->data = newElement; - } - FX_POSITION InsertAfter(FX_POSITION pos, void* newElement); - - FX_POSITION Find(void* searchValue, FX_POSITION startAfter = nullptr) const; - FX_POSITION FindIndex(int index) const; - - void RemoveAt(FX_POSITION pos); - void RemoveAll(); - - protected: - CNode* m_pNodeHead; - CNode* m_pNodeTail; - int m_nCount; - CNode* m_pNodeFree; - struct CFX_Plex* m_pBlocks; - int m_nBlockSize; - - CNode* NewNode(CNode* pPrev, CNode* pNext); - void FreeNode(CNode* pNode); - - public: - ~CFX_PtrList(); -}; - -#ifdef PDF_ENABLE_XFA typedef void (*PD_CALLBACK_FREEDATA)(void* pData); #endif // PDF_ENABLE_XFA -- cgit v1.2.3