summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/cxfa_layoutpagemgr.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 /xfa/fxfa/parser/cxfa_layoutpagemgr.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 'xfa/fxfa/parser/cxfa_layoutpagemgr.h')
-rw-r--r--xfa/fxfa/parser/cxfa_layoutpagemgr.h20
1 files changed, 11 insertions, 9 deletions
diff --git a/xfa/fxfa/parser/cxfa_layoutpagemgr.h b/xfa/fxfa/parser/cxfa_layoutpagemgr.h
index 3f0410f74c..b466f3ad1f 100644
--- a/xfa/fxfa/parser/cxfa_layoutpagemgr.h
+++ b/xfa/fxfa/parser/cxfa_layoutpagemgr.h
@@ -7,6 +7,9 @@
#ifndef XFA_FXFA_PARSER_CXFA_LAYOUTPAGEMGR_H_
#define XFA_FXFA_PARSER_CXFA_LAYOUTPAGEMGR_H_
+#include <iterator>
+#include <list>
+
#include "xfa/fxfa/parser/xfa_layout_itemlayout.h"
class CXFA_ContainerRecord;
@@ -54,12 +57,12 @@ class CXFA_LayoutPageMgr {
CXFA_ContainerRecord* pPrevRecord);
void RemoveLayoutRecord(CXFA_ContainerRecord* pNewRecord,
CXFA_ContainerRecord* pPrevRecord);
- inline CXFA_ContainerRecord* GetCurrentContainerRecord() {
- CXFA_ContainerRecord* result =
- ((CXFA_ContainerRecord*)m_rgProposedContainerRecord.GetAt(
- m_pCurrentContainerRecord));
- ASSERT(result);
- return result;
+ CXFA_ContainerRecord* GetCurrentContainerRecord() {
+ return *m_CurrentContainerRecordIter;
+ }
+ std::list<CXFA_ContainerRecord*>::iterator GetTailPosition() {
+ auto iter = m_ProposedContainerRecords.end();
+ return !m_ProposedContainerRecords.empty() ? std::prev(iter) : iter;
}
CXFA_ContainerRecord* CreateContainerRecord(CXFA_Node* pPageNode = nullptr,
bool bCreateNew = false);
@@ -120,7 +123,6 @@ class CXFA_LayoutPageMgr {
return m_ePageSetMode == XFA_ATTRIBUTEENUM_OrderedOccurrence;
}
void ClearData();
- void ClearRecordList();
void MergePageSetContents();
void LayoutPageSetContents();
void PrepareLayout();
@@ -129,8 +131,8 @@ class CXFA_LayoutPageMgr {
CXFA_Node* m_pTemplatePageSetRoot;
CXFA_ContainerLayoutItem* m_pPageSetLayoutItemRoot;
CXFA_ContainerLayoutItem* m_pPageSetCurRoot;
- FX_POSITION m_pCurrentContainerRecord;
- CFX_PtrList m_rgProposedContainerRecord;
+ std::list<CXFA_ContainerRecord*> m_ProposedContainerRecords;
+ std::list<CXFA_ContainerRecord*>::iterator m_CurrentContainerRecordIter;
CXFA_Node* m_pCurPageArea;
int32_t m_nAvailPages;
int32_t m_nCurPageCount;