Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(76)

Side by Side Diff: xfa/src/fxfa/src/parser/xfa_layout_itemlayout.cpp

Issue 1668003003: Call CXFA_Object::ToNode() rather than C-style casting. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "xfa/src/foxitlib.h" 9 #include "xfa/src/foxitlib.h"
10 #include "xfa/src/fxfa/src/common/xfa_utils.h" 10 #include "xfa/src/fxfa/src/common/xfa_utils.h"
(...skipping 1752 matching lines...) Expand 10 before | Expand all | Expand 10 after
1763 return fTotalHeight; 1763 return fTotalHeight;
1764 } 1764 }
1765 if (pProcessor->m_pLayoutItem == NULL) { 1765 if (pProcessor->m_pLayoutItem == NULL) {
1766 pProcessor->m_pLayoutItem = 1766 pProcessor->m_pLayoutItem =
1767 pProcessor->CreateContentLayoutItem(pCurChildNode); 1767 pProcessor->CreateContentLayoutItem(pCurChildNode);
1768 pProcessor->m_pLayoutItem->m_sSize.Set(0, 0); 1768 pProcessor->m_pLayoutItem->m_sSize.Set(0, 0);
1769 } 1769 }
1770 while (pProcessor->m_rgPendingNodes.GetCount() > 0) { 1770 while (pProcessor->m_rgPendingNodes.GetCount() > 0) {
1771 FX_POSITION pos = pProcessor->m_rgPendingNodes.GetHeadPosition(); 1771 FX_POSITION pos = pProcessor->m_rgPendingNodes.GetHeadPosition();
1772 CXFA_Node* pPendingNode = 1772 CXFA_Node* pPendingNode =
1773 (CXFA_Node*)pProcessor->m_rgPendingNodes.GetAt(pos); 1773 reinterpret_cast<CXFA_Node*>(pProcessor->m_rgPendingNodes.GetAt(pos));
1774 pProcessor->m_rgPendingNodes.RemoveAt(pos); 1774 pProcessor->m_rgPendingNodes.RemoveAt(pos);
1775 CXFA_ContentLayoutItem* pPendingLayoutItem = NULL; 1775 CXFA_ContentLayoutItem* pPendingLayoutItem = NULL;
1776 CXFA_ItemLayoutProcessor* pPendingProcessor = 1776 CXFA_ItemLayoutProcessor* pPendingProcessor =
1777 new CXFA_ItemLayoutProcessor(pPendingNode, NULL); 1777 new CXFA_ItemLayoutProcessor(pPendingNode, NULL);
1778 #ifndef _XFA_LAYOUTITEM_ProcessCACHE_ 1778 #ifndef _XFA_LAYOUTITEM_ProcessCACHE_
1779 pPendingProcessor->m_pPageMgrCreateItem = pProcessor->m_pPageMgrCreateItem; 1779 pPendingProcessor->m_pPageMgrCreateItem = pProcessor->m_pPageMgrCreateItem;
1780 #endif 1780 #endif
1781 pPendingProcessor->DoLayout(FALSE, XFA_LAYOUT_FLOAT_MAX); 1781 pPendingProcessor->DoLayout(FALSE, XFA_LAYOUT_FLOAT_MAX);
1782 pPendingLayoutItem = pPendingProcessor->HasLayoutItem() 1782 pPendingLayoutItem = pPendingProcessor->HasLayoutItem()
1783 ? pPendingProcessor->ExtractLayoutItem() 1783 ? pPendingProcessor->ExtractLayoutItem()
(...skipping 1233 matching lines...) Expand 10 before | Expand all | Expand 10 after
3017 (int32_t)(uintptr_t)m_PendingNodesCount.GetValueAt(pTemplate); 3017 (int32_t)(uintptr_t)m_PendingNodesCount.GetValueAt(pTemplate);
3018 if (iCount >= iMax) { 3018 if (iCount >= iMax) {
3019 return FALSE; 3019 return FALSE;
3020 } 3020 }
3021 iCount++; 3021 iCount++;
3022 m_PendingNodesCount.SetAt(pTemplate, (void*)(uintptr_t)(iCount)); 3022 m_PendingNodesCount.SetAt(pTemplate, (void*)(uintptr_t)(iCount));
3023 return TRUE; 3023 return TRUE;
3024 } 3024 }
3025 return TRUE; 3025 return TRUE;
3026 } 3026 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698