OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 |
| 7 #include "core/fpdfapi/fpdf_page/cpdf_contentmark.h" |
| 8 |
| 9 FX_BOOL CPDF_ContentMark::HasMark(const CFX_ByteStringC& mark) const { |
| 10 if (!m_pObject) |
| 11 return FALSE; |
| 12 |
| 13 for (int i = 0; i < m_pObject->CountItems(); i++) { |
| 14 CPDF_ContentMarkItem& item = m_pObject->GetItem(i); |
| 15 if (item.GetName() == mark) |
| 16 return TRUE; |
| 17 } |
| 18 return FALSE; |
| 19 } |
| 20 |
| 21 FX_BOOL CPDF_ContentMark::LookupMark(const CFX_ByteStringC& mark, |
| 22 CPDF_Dictionary*& pDict) const { |
| 23 if (!m_pObject) |
| 24 return FALSE; |
| 25 |
| 26 for (int i = 0; i < m_pObject->CountItems(); i++) { |
| 27 CPDF_ContentMarkItem& item = m_pObject->GetItem(i); |
| 28 if (item.GetName() == mark) { |
| 29 pDict = nullptr; |
| 30 if (item.GetParamType() == CPDF_ContentMarkItem::PropertiesDict || |
| 31 item.GetParamType() == CPDF_ContentMarkItem::DirectDict) { |
| 32 pDict = item.GetParam(); |
| 33 } |
| 34 return TRUE; |
| 35 } |
| 36 } |
| 37 return FALSE; |
| 38 } |
OLD | NEW |