summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/xfa_layout_itemlayout.cpp
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-05-20 14:43:28 -0700
committerCommit bot <commit-bot@chromium.org>2016-05-20 14:43:28 -0700
commit7aaaae625557f387cf7c829614e397fbf43578b6 (patch)
treedd27e3926376ee20ff7f54f18641d1f7b85287b5 /xfa/fxfa/parser/xfa_layout_itemlayout.cpp
parentbc34be4dbb7b11252a48110f89c46ccb01929d64 (diff)
downloadpdfium-7aaaae625557f387cf7c829614e397fbf43578b6.tar.xz
Use std::map in CXFA_ItemLayoutProcessor
BUG= Review-Url: https://codereview.chromium.org/1999883002
Diffstat (limited to 'xfa/fxfa/parser/xfa_layout_itemlayout.cpp')
-rw-r--r--xfa/fxfa/parser/xfa_layout_itemlayout.cpp25
1 files changed, 12 insertions, 13 deletions
diff --git a/xfa/fxfa/parser/xfa_layout_itemlayout.cpp b/xfa/fxfa/parser/xfa_layout_itemlayout.cpp
index 8b85ba8075..860de2d82c 100644
--- a/xfa/fxfa/parser/xfa_layout_itemlayout.cpp
+++ b/xfa/fxfa/parser/xfa_layout_itemlayout.cpp
@@ -2974,26 +2974,25 @@ void CXFA_ItemLayoutProcessor::SetCurrentComponentSize(FX_FLOAT fWidth,
FX_FLOAT fHeight) {
m_pLayoutItem->m_sSize = CFX_SizeF(fWidth, fHeight);
}
+
FX_BOOL CXFA_ItemLayoutProcessor::JudgeLeaderOrTrailerForOccur(
CXFA_Node* pFormNode) {
- if (pFormNode == NULL) {
+ if (!pFormNode)
return FALSE;
- }
+
CXFA_Node* pTemplate = pFormNode->GetTemplateNode();
- if (!pTemplate) {
+ if (!pTemplate)
pTemplate = pFormNode;
- }
+
CXFA_Occur NodeOccur(pTemplate->GetFirstChildByClass(XFA_ELEMENT_Occur));
int32_t iMax = NodeOccur.GetMax();
- if (iMax > -1) {
- int32_t iCount =
- (int32_t)(uintptr_t)m_PendingNodesCount.GetValueAt(pTemplate);
- if (iCount >= iMax) {
- return FALSE;
- }
- iCount++;
- m_PendingNodesCount.SetAt(pTemplate, (void*)(uintptr_t)(iCount));
+ if (iMax < 0)
return TRUE;
- }
+
+ int32_t iCount = m_PendingNodesCount[pTemplate];
+ if (iCount >= iMax)
+ return FALSE;
+
+ m_PendingNodesCount[pTemplate] = iCount + 1;
return TRUE;
}