summaryrefslogtreecommitdiff
path: root/core/fxcrt/fx_basic.h
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2017-01-03 12:41:21 -0800
committerCommit bot <commit-bot@chromium.org>2017-01-03 12:41:21 -0800
commiteda80ef83f1a28166bbf86c6808dda5f6623f08c (patch)
treefa99e89cc99a2cc4784d2b9f9860d880e06d37c6 /core/fxcrt/fx_basic.h
parentb38c5dfcbb76dc5b731fb969423e4bedcbca19f6 (diff)
downloadpdfium-eda80ef83f1a28166bbf86c6808dda5f6623f08c.tar.xz
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
Diffstat (limited to 'core/fxcrt/fx_basic.h')
-rw-r--r--core/fxcrt/fx_basic.h72
1 files changed, 0 insertions, 72 deletions
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