OLD | NEW |
1 // Copyright 2016 PDFium Authors. All rights reserved. | 1 // Copyright 2016 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 "core/fpdfapi/fpdf_page/cpdf_contentmarkitem.h" | 7 #include "core/fpdfapi/fpdf_page/cpdf_contentmarkitem.h" |
8 | 8 |
9 #include "core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h" | 9 #include "core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h" |
10 | 10 |
11 CPDF_ContentMarkItem::CPDF_ContentMarkItem() { | 11 CPDF_ContentMarkItem::CPDF_ContentMarkItem() |
12 m_ParamType = None; | 12 : m_ParamType(None), m_pParam(nullptr) {} |
13 } | |
14 | 13 |
15 CPDF_ContentMarkItem::CPDF_ContentMarkItem(const CPDF_ContentMarkItem& src) { | 14 CPDF_ContentMarkItem::CPDF_ContentMarkItem(const CPDF_ContentMarkItem& src) { |
16 m_MarkName = src.m_MarkName; | 15 m_MarkName = src.m_MarkName; |
17 m_ParamType = src.m_ParamType; | 16 m_ParamType = src.m_ParamType; |
18 if (m_ParamType == DirectDict) { | 17 if (m_ParamType == DirectDict) { |
19 m_pParam = ToDictionary(src.m_pParam->Clone()); | 18 m_pParam = ToDictionary(src.m_pParam->Clone()); |
20 } else { | 19 } else { |
21 m_pParam = src.m_pParam; | 20 m_pParam = src.m_pParam; |
22 } | 21 } |
23 } | 22 } |
24 | 23 |
25 CPDF_ContentMarkItem::~CPDF_ContentMarkItem() { | 24 CPDF_ContentMarkItem::~CPDF_ContentMarkItem() { |
26 if (m_ParamType == DirectDict && m_pParam) | 25 if (m_ParamType == DirectDict && m_pParam) |
27 m_pParam->Release(); | 26 m_pParam->Release(); |
28 } | 27 } |
29 | 28 |
30 FX_BOOL CPDF_ContentMarkItem::HasMCID() const { | 29 FX_BOOL CPDF_ContentMarkItem::HasMCID() const { |
31 if (m_pParam && | 30 if (m_pParam && |
32 (m_ParamType == DirectDict || m_ParamType == PropertiesDict)) { | 31 (m_ParamType == DirectDict || m_ParamType == PropertiesDict)) { |
33 return m_pParam->KeyExist("MCID"); | 32 return m_pParam->KeyExist("MCID"); |
34 } | 33 } |
35 return FALSE; | 34 return FALSE; |
36 } | 35 } |
OLD | NEW |