| OLD | NEW |
| 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 "xfa/fde/fde_iterator.h" | 7 #include "xfa/fde/fde_iterator.h" |
| 8 | 8 |
| 9 #include "xfa/fgas/crt/fgas_utils.h" | 9 #include "xfa/fgas/crt/fgas_utils.h" |
| 10 | 10 |
| 11 CFDE_VisualSetIterator::CFDE_VisualSetIterator() | 11 CFDE_VisualSetIterator::CFDE_VisualSetIterator() |
| 12 : m_dwFilter(0), m_CanvasStack(100) {} | 12 : m_dwFilter(0), m_CanvasStack(100) {} |
| 13 | 13 |
| 14 CFDE_VisualSetIterator::~CFDE_VisualSetIterator() { | 14 CFDE_VisualSetIterator::~CFDE_VisualSetIterator() { |
| 15 m_CanvasStack.RemoveAll(FALSE); | 15 m_CanvasStack.RemoveAll(false); |
| 16 } | 16 } |
| 17 | 17 |
| 18 FX_BOOL CFDE_VisualSetIterator::AttachCanvas(IFDE_CanvasSet* pCanvas) { | 18 bool CFDE_VisualSetIterator::AttachCanvas(IFDE_CanvasSet* pCanvas) { |
| 19 ASSERT(pCanvas); | 19 ASSERT(pCanvas); |
| 20 | 20 |
| 21 m_CanvasStack.RemoveAll(FALSE); | 21 m_CanvasStack.RemoveAll(false); |
| 22 FDE_CANVASITEM canvas; | 22 FDE_CANVASITEM canvas; |
| 23 canvas.hCanvas = nullptr; | 23 canvas.hCanvas = nullptr; |
| 24 canvas.pCanvas = pCanvas; | 24 canvas.pCanvas = pCanvas; |
| 25 canvas.hPos = pCanvas->GetFirstPosition(); | 25 canvas.hPos = pCanvas->GetFirstPosition(); |
| 26 if (!canvas.hPos) | 26 if (!canvas.hPos) |
| 27 return FALSE; | 27 return false; |
| 28 | 28 |
| 29 return m_CanvasStack.Push(canvas) == 0; | 29 return m_CanvasStack.Push(canvas) == 0; |
| 30 } | 30 } |
| 31 | 31 |
| 32 FX_BOOL CFDE_VisualSetIterator::FilterObjects(uint32_t dwObjects) { | 32 bool CFDE_VisualSetIterator::FilterObjects(uint32_t dwObjects) { |
| 33 if (m_CanvasStack.GetSize() == 0) | 33 if (m_CanvasStack.GetSize() == 0) |
| 34 return FALSE; | 34 return false; |
| 35 | 35 |
| 36 while (m_CanvasStack.GetSize() > 1) | 36 while (m_CanvasStack.GetSize() > 1) |
| 37 m_CanvasStack.Pop(); | 37 m_CanvasStack.Pop(); |
| 38 | 38 |
| 39 m_dwFilter = dwObjects; | 39 m_dwFilter = dwObjects; |
| 40 | 40 |
| 41 FDE_CANVASITEM* pCanvas = m_CanvasStack.GetTopElement(); | 41 FDE_CANVASITEM* pCanvas = m_CanvasStack.GetTopElement(); |
| 42 ASSERT(pCanvas && pCanvas->pCanvas); | 42 ASSERT(pCanvas && pCanvas->pCanvas); |
| 43 | 43 |
| 44 pCanvas->hPos = pCanvas->pCanvas->GetFirstPosition(); | 44 pCanvas->hPos = pCanvas->pCanvas->GetFirstPosition(); |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 } while (pCanvas->hPos); | 89 } while (pCanvas->hPos); |
| 90 } | 90 } |
| 91 if (ppCanvasSet) | 91 if (ppCanvasSet) |
| 92 *ppCanvasSet = nullptr; | 92 *ppCanvasSet = nullptr; |
| 93 if (phCanvasObj) | 93 if (phCanvasObj) |
| 94 *phCanvasObj = nullptr; | 94 *phCanvasObj = nullptr; |
| 95 | 95 |
| 96 pVisualSet = nullptr; | 96 pVisualSet = nullptr; |
| 97 return nullptr; | 97 return nullptr; |
| 98 } | 98 } |
| OLD | NEW |