| 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 "public/fpdfview.h" | 7 #include "public/fpdfview.h" |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 return FALSE; | 351 return FALSE; |
| 352 | 352 |
| 353 CPDF_Dictionary* pRoot = pdfDoc->GetRoot(); | 353 CPDF_Dictionary* pRoot = pdfDoc->GetRoot(); |
| 354 if (!pRoot) | 354 if (!pRoot) |
| 355 return FALSE; | 355 return FALSE; |
| 356 | 356 |
| 357 CPDF_Dictionary* pAcroForm = pRoot->GetDictBy("AcroForm"); | 357 CPDF_Dictionary* pAcroForm = pRoot->GetDictBy("AcroForm"); |
| 358 if (!pAcroForm) | 358 if (!pAcroForm) |
| 359 return FALSE; | 359 return FALSE; |
| 360 | 360 |
| 361 CPDF_Object* pXFA = pAcroForm->GetElement("XFA"); | 361 CPDF_Object* pXFA = pAcroForm->GetObjectBy("XFA"); |
| 362 if (!pXFA) | 362 if (!pXFA) |
| 363 return FALSE; | 363 return FALSE; |
| 364 | 364 |
| 365 FX_BOOL bDynamicXFA = pRoot->GetBooleanBy("NeedsRendering", FALSE); | 365 FX_BOOL bDynamicXFA = pRoot->GetBooleanBy("NeedsRendering", FALSE); |
| 366 | 366 |
| 367 if (bDynamicXFA) | 367 if (bDynamicXFA) |
| 368 *docType = DOCTYPE_DYNAMIC_XFA; | 368 *docType = DOCTYPE_DYNAMIC_XFA; |
| 369 else | 369 else |
| 370 *docType = DOCTYPE_STATIC_XFA; | 370 *docType = DOCTYPE_STATIC_XFA; |
| 371 | 371 |
| (...skipping 786 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1158 if (!buffer) { | 1158 if (!buffer) { |
| 1159 *buflen = len; | 1159 *buflen = len; |
| 1160 } else if (*buflen >= len) { | 1160 } else if (*buflen >= len) { |
| 1161 memcpy(buffer, utf16Name.c_str(), len); | 1161 memcpy(buffer, utf16Name.c_str(), len); |
| 1162 *buflen = len; | 1162 *buflen = len; |
| 1163 } else { | 1163 } else { |
| 1164 *buflen = -1; | 1164 *buflen = -1; |
| 1165 } | 1165 } |
| 1166 return (FPDF_DEST)pDestObj; | 1166 return (FPDF_DEST)pDestObj; |
| 1167 } | 1167 } |
| OLD | NEW |