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/include/cpdf_annot.h" | 7 #include "core/fpdfdoc/include/cpdf_annot.h" |
8 | 8 |
9 #include "core/fpdfapi/fpdf_page/include/cpdf_form.h" | 9 #include "core/fpdfapi/fpdf_page/include/cpdf_form.h" |
10 #include "core/fpdfapi/fpdf_page/include/cpdf_page.h" | 10 #include "core/fpdfapi/fpdf_page/include/cpdf_page.h" |
11 #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" | 11 #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" |
12 #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" | 12 #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" |
13 #include "core/fpdfapi/fpdf_render/include/cpdf_rendercontext.h" | 13 #include "core/fpdfapi/fpdf_render/include/cpdf_rendercontext.h" |
14 #include "core/fpdfapi/fpdf_render/include/cpdf_renderoptions.h" | 14 #include "core/fpdfapi/fpdf_render/include/cpdf_renderoptions.h" |
15 #include "core/fpdfdoc/cpvt_generateap.h" | 15 #include "core/fpdfdoc/cpvt_generateap.h" |
16 #include "core/fxcrt/include/fx_memory.h" | 16 #include "core/fxcrt/include/fx_memory.h" |
17 #include "core/fxge/include/fx_ge.h" | 17 #include "core/fxge/include/fx_ge.h" |
18 | 18 |
19 CPDF_Annot::CPDF_Annot(CPDF_Dictionary* pDict, CPDF_Document* pDocument) | 19 CPDF_Annot::CPDF_Annot(CPDF_Dictionary* pDict, CPDF_Document* pDocument) |
20 : m_pAnnotDict(pDict), | 20 : m_pAnnotDict(pDict), |
21 m_pDocument(pDocument), | 21 m_pDocument(pDocument), |
22 m_sSubtype(m_pAnnotDict->GetStringBy("Subtype")) { | 22 m_sSubtype(m_pAnnotDict->GetStringBy("Subtype")) { |
23 if (m_sSubtype == "Highlight") | 23 if (m_sSubtype == "Highlight") |
24 CPVT_GenerateAP::GenerateHighlightAP(m_pDocument, m_pAnnotDict); | 24 CPVT_GenerateAP::GenerateHighlightAP(m_pDocument, m_pAnnotDict); |
| 25 else if (m_sSubtype == "Underline") |
| 26 CPVT_GenerateAP::GenerateUnderlineAP(m_pDocument, m_pAnnotDict); |
25 } | 27 } |
26 | 28 |
27 CPDF_Annot::~CPDF_Annot() { | 29 CPDF_Annot::~CPDF_Annot() { |
28 ClearCachedAP(); | 30 ClearCachedAP(); |
29 } | 31 } |
30 | 32 |
31 void CPDF_Annot::ClearCachedAP() { | 33 void CPDF_Annot::ClearCachedAP() { |
32 m_APMap.clear(); | 34 m_APMap.clear(); |
33 } | 35 } |
34 CFX_ByteString CPDF_Annot::GetSubType() const { | 36 CFX_ByteString CPDF_Annot::GetSubType() const { |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 CFX_PathData path; | 243 CFX_PathData path; |
242 width /= 2; | 244 width /= 2; |
243 path.AppendRect(rect.left + width, rect.bottom + width, rect.right - width, | 245 path.AppendRect(rect.left + width, rect.bottom + width, rect.right - width, |
244 rect.top - width); | 246 rect.top - width); |
245 int fill_type = 0; | 247 int fill_type = 0; |
246 if (pOptions && (pOptions->m_Flags & RENDER_NOPATHSMOOTH)) { | 248 if (pOptions && (pOptions->m_Flags & RENDER_NOPATHSMOOTH)) { |
247 fill_type |= FXFILL_NOPATHSMOOTH; | 249 fill_type |= FXFILL_NOPATHSMOOTH; |
248 } | 250 } |
249 pDevice->DrawPath(&path, pUser2Device, &graph_state, argb, argb, fill_type); | 251 pDevice->DrawPath(&path, pUser2Device, &graph_state, argb, argb, fill_type); |
250 } | 252 } |
OLD | NEW |