| 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/fpdfdoc/cpdf_bookmark.h" | 7 #include "core/fpdfdoc/cpdf_bookmark.h" |
| 8 | 8 |
| 9 #include "core/fpdfapi/fpdf_parser/cpdf_array.h" | 9 #include "core/fpdfapi/fpdf_parser/cpdf_array.h" |
| 10 #include "core/fpdfapi/fpdf_parser/cpdf_string.h" | 10 #include "core/fpdfapi/fpdf_parser/cpdf_string.h" |
| 11 #include "core/fpdfdoc/cpdf_nametree.h" | 11 #include "core/fpdfdoc/cpdf_nametree.h" |
| 12 #include "core/fxge/include/fx_dib.h" | 12 #include "core/fxge/fx_dib.h" |
| 13 | 13 |
| 14 uint32_t CPDF_Bookmark::GetColorRef() const { | 14 uint32_t CPDF_Bookmark::GetColorRef() const { |
| 15 if (!m_pDict) | 15 if (!m_pDict) |
| 16 return FXSYS_RGB(0, 0, 0); | 16 return FXSYS_RGB(0, 0, 0); |
| 17 | 17 |
| 18 CPDF_Array* pColor = m_pDict->GetArrayFor("C"); | 18 CPDF_Array* pColor = m_pDict->GetArrayFor("C"); |
| 19 if (!pColor) | 19 if (!pColor) |
| 20 return FXSYS_RGB(0, 0, 0); | 20 return FXSYS_RGB(0, 0, 0); |
| 21 | 21 |
| 22 int r = FXSYS_round(pColor->GetNumberAt(0) * 255); | 22 int r = FXSYS_round(pColor->GetNumberAt(0) * 255); |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 return CPDF_Dest(name_tree.LookupNamedDest(pDocument, pDest->GetString())); | 62 return CPDF_Dest(name_tree.LookupNamedDest(pDocument, pDest->GetString())); |
| 63 } | 63 } |
| 64 if (CPDF_Array* pArray = pDest->AsArray()) | 64 if (CPDF_Array* pArray = pDest->AsArray()) |
| 65 return CPDF_Dest(pArray); | 65 return CPDF_Dest(pArray); |
| 66 return CPDF_Dest(); | 66 return CPDF_Dest(); |
| 67 } | 67 } |
| 68 | 68 |
| 69 CPDF_Action CPDF_Bookmark::GetAction() const { | 69 CPDF_Action CPDF_Bookmark::GetAction() const { |
| 70 return m_pDict ? CPDF_Action(m_pDict->GetDictFor("A")) : CPDF_Action(); | 70 return m_pDict ? CPDF_Action(m_pDict->GetDictFor("A")) : CPDF_Action(); |
| 71 } | 71 } |
| OLD | NEW |