| 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/fpdf_edit.h" | 7 #include "../../public/fpdf_edit.h" |
| 8 #include "../../public/fpdf_formfill.h" | 8 #include "../../public/fpdf_formfill.h" |
| 9 #include "../include/fsdk_define.h" | 9 #include "../include/fsdk_define.h" |
| 10 #include "../include/fpdfxfa/fpdfxfa_doc.h" | 10 #include "../include/fpdfxfa/fpdfxfa_doc.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 if ( -1 != time( ¤tTime ) ) | 32 if ( -1 != time( ¤tTime ) ) |
| 33 { | 33 { |
| 34 tm * pTM = localtime( ¤tTime ); | 34 tm * pTM = localtime( ¤tTime ); |
| 35 if ( pTM ) | 35 if ( pTM ) |
| 36 { | 36 { |
| 37 DateStr.Format( "D:%04d%02d%02d%02d%02d%02d", pT
M->tm_year+1900, pTM->tm_mon+1, | 37 DateStr.Format( "D:%04d%02d%02d%02d%02d%02d", pT
M->tm_year+1900, pTM->tm_mon+1, |
| 38 pTM->tm_mday, pTM->tm_hour, pTM->tm_min,
pTM->tm_sec ); | 38 pTM->tm_mday, pTM->tm_hour, pTM->tm_min,
pTM->tm_sec ); |
| 39 } | 39 } |
| 40 } | 40 } |
| 41 } | 41 } |
| 42 » | 42 |
| 43 CPDF_Dictionary* pInfoDict = NULL; | 43 CPDF_Dictionary* pInfoDict = NULL; |
| 44 pInfoDict = pDoc->GetInfo(); | 44 pInfoDict = pDoc->GetInfo(); |
| 45 if (pInfoDict) | 45 if (pInfoDict) |
| 46 { | 46 { |
| 47 if(FSDK_IsSandBoxPolicyEnabled(FPDF_POLICY_MACHINETIME_ACCESS)) | 47 if(FSDK_IsSandBoxPolicyEnabled(FPDF_POLICY_MACHINETIME_ACCESS)) |
| 48 pInfoDict->SetAt("CreationDate", new CPDF_String(DateStr
)); | 48 pInfoDict->SetAt("CreationDate", new CPDF_String(DateStr
)); |
| 49 pInfoDict->SetAt("Creator",FX_NEW CPDF_String(L"PDFium")); | 49 pInfoDict->SetAt("Creator",FX_NEW CPDF_String(L"PDFium")); |
| 50 } | 50 } |
| 51 | 51 |
| 52 » CPDFXFA_App* pApp = FPDFXFA_GetApp(); | 52 » CPDFXFA_App* pApp = CPDFXFA_App::GetInstance(); |
| 53 CPDFXFA_Document* document = FX_NEW CPDFXFA_Document(pDoc, pApp); | 53 CPDFXFA_Document* document = FX_NEW CPDFXFA_Document(pDoc, pApp); |
| 54 | |
| 55 return document; | 54 return document; |
| 56 } | 55 } |
| 57 | 56 |
| 58 DLLEXPORT void STDCALL FPDFPage_Delete(FPDF_DOCUMENT document, int page_index) | 57 DLLEXPORT void STDCALL FPDFPage_Delete(FPDF_DOCUMENT document, int page_index) |
| 59 { | 58 { |
| 60 CPDF_Document* pDoc = ((CPDFXFA_Document*)document)->GetPDFDoc(); | 59 CPDF_Document* pDoc = ((CPDFXFA_Document*)document)->GetPDFDoc(); |
| 61 if (pDoc == NULL) | 60 if (pDoc == NULL) |
| 62 return; | 61 return; |
| 63 if (page_index < 0 || page_index >= pDoc->GetPageCount()) | 62 if (page_index < 0 || page_index >= pDoc->GetPageCount()) |
| 64 return; | 63 return; |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 if (!pPage || !pPage->m_pFormDict || !pPage->m_pFormDict->KeyExist("Type
") || !pPage->m_pFormDict->GetElement("Type")->GetDirect() | 330 if (!pPage || !pPage->m_pFormDict || !pPage->m_pFormDict->KeyExist("Type
") || !pPage->m_pFormDict->GetElement("Type")->GetDirect() |
| 332 || pPage->m_pFormDict->GetElement("Type")->GetDirect()->GetStrin
g().Compare("Page")) | 331 || pPage->m_pFormDict->GetElement("Type")->GetDirect()->GetStrin
g().Compare("Page")) |
| 333 { | 332 { |
| 334 return; | 333 return; |
| 335 } | 334 } |
| 336 CPDF_Dictionary* pDict = pPage->m_pFormDict; | 335 CPDF_Dictionary* pDict = pPage->m_pFormDict; |
| 337 rotate %=4; | 336 rotate %=4; |
| 338 | 337 |
| 339 pDict->SetAt("Rotate", FX_NEW CPDF_Number(rotate * 90)); | 338 pDict->SetAt("Rotate", FX_NEW CPDF_Number(rotate * 90)); |
| 340 } | 339 } |
| OLD | NEW |