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 "../../../third_party/base/nonstd_unique_ptr.h" | 7 #include "../../../third_party/base/nonstd_unique_ptr.h" |
8 #include "../../include/fpdfdoc/fpdf_doc.h" | 8 #include "../../include/fpdfdoc/fpdf_doc.h" |
9 #include "../../include/fpdfapi/fpdf_pageobj.h" | 9 #include "../../include/fpdfapi/fpdf_pageobj.h" |
10 | 10 |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 ap_entry = "N"; | 195 ap_entry = "N"; |
196 } | 196 } |
197 CPDF_Object* psub = pAP->GetElementValue(ap_entry); | 197 CPDF_Object* psub = pAP->GetElementValue(ap_entry); |
198 if (psub == NULL) { | 198 if (psub == NULL) { |
199 return NULL; | 199 return NULL; |
200 } | 200 } |
201 CPDF_Stream* pStream = NULL; | 201 CPDF_Stream* pStream = NULL; |
202 if (psub->GetType() == PDFOBJ_STREAM) { | 202 if (psub->GetType() == PDFOBJ_STREAM) { |
203 pStream = (CPDF_Stream*)psub; | 203 pStream = (CPDF_Stream*)psub; |
204 } else if (psub->GetType() == PDFOBJ_DICTIONARY) { | 204 } else if (psub->GetType() == PDFOBJ_DICTIONARY) { |
205 CFX_ByteString as = pAnnotDict->GetString("AS"); | 205 CFX_ByteString as = pAnnotDict->GetStringAt("AS"); |
206 if (as.IsEmpty()) { | 206 if (as.IsEmpty()) { |
207 CFX_ByteString value = pAnnotDict->GetString(FX_BSTRC("V")); | 207 CFX_ByteString value = pAnnotDict->GetStringAt("V"); |
208 if (value.IsEmpty()) { | 208 if (value.IsEmpty()) { |
209 CPDF_Dictionary* pDict = pAnnotDict->GetDict(FX_BSTRC("Parent"))
; | 209 CPDF_Dictionary* pDict = pAnnotDict->GetDict(FX_BSTRC("Parent"))
; |
210 value = pDict ? pDict->GetString(FX_BSTRC("V")) : CFX_ByteString
(); | 210 value = pDict ? pDict->GetStringAt("V") : CFX_ByteString(); |
211 } | 211 } |
212 if (value.IsEmpty() || !((CPDF_Dictionary*)psub)->KeyExist(value)) { | 212 if (value.IsEmpty() || !((CPDF_Dictionary*)psub)->KeyExist(value)) { |
213 as = FX_BSTRC("Off"); | 213 as = FX_BSTRC("Off"); |
214 } else { | 214 } else { |
215 as = value; | 215 as = value; |
216 } | 216 } |
217 } | 217 } |
218 pStream = ((CPDF_Dictionary*)psub)->GetStream(as); | 218 pStream = ((CPDF_Dictionary*)psub)->GetStream(as); |
219 } | 219 } |
220 return pStream; | 220 return pStream; |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 } | 312 } |
313 if (i == nLen) { | 313 if (i == nLen) { |
314 return; | 314 return; |
315 } | 315 } |
316 style_char = 'D'; | 316 style_char = 'D'; |
317 } | 317 } |
318 } else { | 318 } else { |
319 width = 1; | 319 width = 1; |
320 } | 320 } |
321 } else { | 321 } else { |
322 CFX_ByteString style = pBS->GetString("S"); | 322 CFX_ByteString style = pBS->GetStringAt("S"); |
323 pDashArray = pBS->GetArray("D"); | 323 pDashArray = pBS->GetArray("D"); |
324 style_char = style[1]; | 324 style_char = style[1]; |
325 width = pBS->GetNumber("W"); | 325 width = pBS->GetNumber("W"); |
326 } | 326 } |
327 if (width <= 0) { | 327 if (width <= 0) { |
328 return; | 328 return; |
329 } | 329 } |
330 CPDF_Array* pColor = m_pAnnotDict->GetArray("C"); | 330 CPDF_Array* pColor = m_pAnnotDict->GetArray("C"); |
331 FX_DWORD argb = 0xff000000; | 331 FX_DWORD argb = 0xff000000; |
332 if (pColor != NULL) { | 332 if (pColor != NULL) { |
(...skipping 29 matching lines...) Expand all Loading... |
362 GetRect(rect); | 362 GetRect(rect); |
363 CPDF_PathData path; | 363 CPDF_PathData path; |
364 width /= 2; | 364 width /= 2; |
365 path.AppendRect(rect.left + width, rect.bottom + width, rect.right - width,
rect.top - width); | 365 path.AppendRect(rect.left + width, rect.bottom + width, rect.right - width,
rect.top - width); |
366 int fill_type = 0; | 366 int fill_type = 0; |
367 if (pOptions && (pOptions->m_Flags & RENDER_NOPATHSMOOTH)) { | 367 if (pOptions && (pOptions->m_Flags & RENDER_NOPATHSMOOTH)) { |
368 fill_type |= FXFILL_NOPATHSMOOTH; | 368 fill_type |= FXFILL_NOPATHSMOOTH; |
369 } | 369 } |
370 pDevice->DrawPath(&path, pUser2Device, &graph_state, argb, argb, fill_type); | 370 pDevice->DrawPath(&path, pUser2Device, &graph_state, argb, argb, fill_type); |
371 } | 371 } |
OLD | NEW |