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 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
357 return FALSE; | 357 return FALSE; |
358 | 358 |
359 CPDF_Dictionary* pAcroForm = pRoot->GetDictBy("AcroForm"); | 359 CPDF_Dictionary* pAcroForm = pRoot->GetDictBy("AcroForm"); |
360 if (!pAcroForm) | 360 if (!pAcroForm) |
361 return FALSE; | 361 return FALSE; |
362 | 362 |
363 CPDF_Object* pXFA = pAcroForm->GetObjectBy("XFA"); | 363 CPDF_Object* pXFA = pAcroForm->GetObjectBy("XFA"); |
364 if (!pXFA) | 364 if (!pXFA) |
365 return FALSE; | 365 return FALSE; |
366 | 366 |
367 FX_BOOL bDynamicXFA = pRoot->GetBooleanBy("NeedsRendering", FALSE); | 367 bool bDynamicXFA = pRoot->GetBooleanBy("NeedsRendering", false); |
368 | 368 *docType = bDynamicXFA ? DOCTYPE_DYNAMIC_XFA : DOCTYPE_STATIC_XFA; |
369 if (bDynamicXFA) | |
370 *docType = DOCTYPE_DYNAMIC_XFA; | |
371 else | |
372 *docType = DOCTYPE_STATIC_XFA; | |
373 | |
374 return TRUE; | 369 return TRUE; |
375 } | 370 } |
376 | 371 |
377 DLLEXPORT FPDF_BOOL STDCALL FPDF_LoadXFA(FPDF_DOCUMENT document) { | 372 DLLEXPORT FPDF_BOOL STDCALL FPDF_LoadXFA(FPDF_DOCUMENT document) { |
378 return document && (static_cast<CPDFXFA_Document*>(document))->LoadXFADoc(); | 373 return document && (static_cast<CPDFXFA_Document*>(document))->LoadXFADoc(); |
379 } | 374 } |
380 #endif // PDF_ENABLE_XFA | 375 #endif // PDF_ENABLE_XFA |
381 | 376 |
382 class CMemFile final : public IFX_FileRead { | 377 class CMemFile final : public IFX_FileRead { |
383 public: | 378 public: |
(...skipping 760 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1144 if (!buffer) { | 1139 if (!buffer) { |
1145 *buflen = len; | 1140 *buflen = len; |
1146 } else if (*buflen >= len) { | 1141 } else if (*buflen >= len) { |
1147 memcpy(buffer, utf16Name.c_str(), len); | 1142 memcpy(buffer, utf16Name.c_str(), len); |
1148 *buflen = len; | 1143 *buflen = len; |
1149 } else { | 1144 } else { |
1150 *buflen = -1; | 1145 *buflen = -1; |
1151 } | 1146 } |
1152 return (FPDF_DEST)pDestObj; | 1147 return (FPDF_DEST)pDestObj; |
1153 } | 1148 } |
OLD | NEW |