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 | 8 |
9 #include "core/fpdfapi/fpdf_edit/include/cpdf_pagecontentgenerator.h" | 9 #include "core/fpdfapi/fpdf_edit/include/cpdf_pagecontentgenerator.h" |
10 #include "core/fpdfapi/fpdf_page/include/cpdf_form.h" | 10 #include "core/fpdfapi/fpdf_page/include/cpdf_form.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 #include "fpdfsdk/fpdfxfa/include/fpdfxfa_page.h" | 29 #include "fpdfsdk/fpdfxfa/include/fpdfxfa_page.h" |
30 #endif // PDF_ENABLE_XFA | 30 #endif // PDF_ENABLE_XFA |
31 | 31 |
32 #if _FX_OS_ == _FX_ANDROID_ | 32 #if _FX_OS_ == _FX_ANDROID_ |
33 #include "time.h" | 33 #include "time.h" |
34 #else | 34 #else |
35 #include <ctime> | 35 #include <ctime> |
36 #endif | 36 #endif |
37 | 37 |
38 DLLEXPORT FPDF_DOCUMENT STDCALL FPDF_CreateNewDocument() { | 38 DLLEXPORT FPDF_DOCUMENT STDCALL FPDF_CreateNewDocument() { |
39 CPDF_Document* pDoc = new CPDF_Document; | 39 CPDF_Document* pDoc = new CPDF_Document(nullptr); |
40 pDoc->CreateNewDoc(); | 40 pDoc->CreateNewDoc(); |
41 time_t currentTime; | 41 time_t currentTime; |
42 | 42 |
43 CFX_ByteString DateStr; | 43 CFX_ByteString DateStr; |
44 | 44 |
45 if (FSDK_IsSandBoxPolicyEnabled(FPDF_POLICY_MACHINETIME_ACCESS)) { | 45 if (FSDK_IsSandBoxPolicyEnabled(FPDF_POLICY_MACHINETIME_ACCESS)) { |
46 if (-1 != time(¤tTime)) { | 46 if (-1 != time(¤tTime)) { |
47 tm* pTM = localtime(¤tTime); | 47 tm* pTM = localtime(¤tTime); |
48 if (pTM) { | 48 if (pTM) { |
49 DateStr.Format("D:%04d%02d%02d%02d%02d%02d", pTM->tm_year + 1900, | 49 DateStr.Format("D:%04d%02d%02d%02d%02d%02d", pTM->tm_year + 1900, |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 !pPage->m_pFormDict->GetObjectBy("Type")->GetDirect() || | 312 !pPage->m_pFormDict->GetObjectBy("Type")->GetDirect() || |
313 pPage->m_pFormDict->GetObjectBy("Type")->GetDirect()->GetString().Compare( | 313 pPage->m_pFormDict->GetObjectBy("Type")->GetDirect()->GetString().Compare( |
314 "Page")) { | 314 "Page")) { |
315 return; | 315 return; |
316 } | 316 } |
317 CPDF_Dictionary* pDict = pPage->m_pFormDict; | 317 CPDF_Dictionary* pDict = pPage->m_pFormDict; |
318 rotate %= 4; | 318 rotate %= 4; |
319 | 319 |
320 pDict->SetAt("Rotate", new CPDF_Number(rotate * 90)); | 320 pDict->SetAt("Rotate", new CPDF_Number(rotate * 90)); |
321 } | 321 } |
OLD | NEW |