From 2079dce2ca47f3866f1dd5d51849c53362727f7b Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Thu, 2 Mar 2017 13:12:33 -0800 Subject: Remove unused CFX_ObjectStackTemplate Change-Id: I9341f38cbea8c325e0d50f26987bc9e55e295630 Reviewed-on: https://pdfium-review.googlesource.com/2904 Commit-Queue: Tom Sepez Commit-Queue: dsinclair Reviewed-by: dsinclair --- xfa/fgas/crt/fgas_utils.h | 57 ----------------------------------------------- 1 file changed, 57 deletions(-) diff --git a/xfa/fgas/crt/fgas_utils.h b/xfa/fgas/crt/fgas_utils.h index 18bc6fcd6e..105920dc55 100644 --- a/xfa/fgas/crt/fgas_utils.h +++ b/xfa/fgas/crt/fgas_utils.h @@ -170,61 +170,4 @@ class CFX_StackTemplate : public CFX_BaseStack { void RemoveAll(bool bLeaveMemory) { CFX_BaseStack::RemoveAll(bLeaveMemory); } }; -template -class CFX_ObjectStackTemplate : public CFX_BaseStack { - public: - explicit CFX_ObjectStackTemplate(int32_t iChunkSize) - : CFX_BaseStack(iChunkSize, sizeof(baseType)) {} - ~CFX_ObjectStackTemplate() { RemoveAll(false); } - - int32_t Push(const baseType& element) { - int32_t index = CFX_BaseStack::GetSize(); - baseType* p = (baseType*)CFX_BaseStack::Push(); - new ((void*)p) baseType(element); - return index; - } - void Pop() { - baseType* p = (baseType*)CFX_BaseStack::GetTopElement(); - if (p) { - p->~baseType(); - } - CFX_BaseStack::Pop(); - } - baseType* GetTopElement() const { - return (baseType*)CFX_BaseStack::GetTopElement(); - } - int32_t GetSize() const { return CFX_BaseStack::GetSize(); } - baseType* GetAt(int32_t index) const { - return (baseType*)CFX_BaseStack::GetAt(index); - } - void RemoveAll(bool bLeaveMemory) { - int32_t iSize = CFX_BaseStack::GetSize(); - for (int32_t i = 0; i < iSize; i++) { - ((baseType*)CFX_BaseStack::GetAt(i))->~baseType(); - } - CFX_BaseStack::RemoveAll(bLeaveMemory); - } - int32_t Copy(const CFX_ObjectStackTemplate& src, - int32_t iStart, - int32_t iCount) { - if (iCount == 0) { - return CFX_BaseStack::GetSize(); - } - int32_t iSize = src.GetSize(); - ASSERT(iStart > -1 && iStart < iSize); - if (iCount < 0) { - iCount = iSize; - } - int32_t iEnd = iStart + iCount; - if (iEnd > iSize) { - iEnd = iSize; - } - RemoveAll(true); - for (int32_t i = iStart; i < iEnd; i++) { - Push(*src.GetAt(i)); - } - return CFX_BaseStack::GetSize(); - } -}; - #endif // XFA_FGAS_CRT_FGAS_UTILS_H_ -- cgit v1.2.3