| 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 <algorithm> | 9 #include <algorithm> |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 DateStr.Format("D:%04d%02d%02d%02d%02d%02d", pTM->tm_year + 1900, | 76 DateStr.Format("D:%04d%02d%02d%02d%02d%02d", pTM->tm_year + 1900, |
| 77 pTM->tm_mon + 1, pTM->tm_mday, pTM->tm_hour, pTM->tm_min, | 77 pTM->tm_mon + 1, pTM->tm_mday, pTM->tm_hour, pTM->tm_min, |
| 78 pTM->tm_sec); | 78 pTM->tm_sec); |
| 79 } | 79 } |
| 80 } | 80 } |
| 81 } | 81 } |
| 82 | 82 |
| 83 CPDF_Dictionary* pInfoDict = nullptr; | 83 CPDF_Dictionary* pInfoDict = nullptr; |
| 84 pInfoDict = pDoc->GetInfo(); | 84 pInfoDict = pDoc->GetInfo(); |
| 85 if (pInfoDict) { | 85 if (pInfoDict) { |
| 86 if (FSDK_IsSandBoxPolicyEnabled(FPDF_POLICY_MACHINETIME_ACCESS)) | 86 if (FSDK_IsSandBoxPolicyEnabled(FPDF_POLICY_MACHINETIME_ACCESS)) { |
| 87 pInfoDict->SetFor("CreationDate", new CPDF_String(DateStr, false)); | 87 pInfoDict->SetFor("CreationDate", |
| 88 new CPDF_String(nullptr, DateStr, false)); |
| 89 } |
| 88 pInfoDict->SetFor("Creator", new CPDF_String(L"PDFium")); | 90 pInfoDict->SetFor("Creator", new CPDF_String(L"PDFium")); |
| 89 } | 91 } |
| 90 | 92 |
| 91 return FPDFDocumentFromCPDFDocument(pDoc); | 93 return FPDFDocumentFromCPDFDocument(pDoc); |
| 92 } | 94 } |
| 93 | 95 |
| 94 DLLEXPORT void STDCALL FPDFPage_Delete(FPDF_DOCUMENT document, int page_index) { | 96 DLLEXPORT void STDCALL FPDFPage_Delete(FPDF_DOCUMENT document, int page_index) { |
| 95 if (UnderlyingDocumentType* pDoc = UnderlyingFromFPDFDocument(document)) | 97 if (UnderlyingDocumentType* pDoc = UnderlyingFromFPDFDocument(document)) |
| 96 pDoc->DeletePage(page_index); | 98 pDoc->DeletePage(page_index); |
| 97 } | 99 } |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 | 311 |
| 310 DLLEXPORT void STDCALL FPDFPage_SetRotation(FPDF_PAGE page, int rotate) { | 312 DLLEXPORT void STDCALL FPDFPage_SetRotation(FPDF_PAGE page, int rotate) { |
| 311 CPDF_Page* pPage = CPDFPageFromFPDFPage(page); | 313 CPDF_Page* pPage = CPDFPageFromFPDFPage(page); |
| 312 if (!IsPageObject(pPage)) | 314 if (!IsPageObject(pPage)) |
| 313 return; | 315 return; |
| 314 | 316 |
| 315 CPDF_Dictionary* pDict = pPage->m_pFormDict; | 317 CPDF_Dictionary* pDict = pPage->m_pFormDict; |
| 316 rotate %= 4; | 318 rotate %= 4; |
| 317 pDict->SetFor("Rotate", new CPDF_Number(rotate * 90)); | 319 pDict->SetFor("Rotate", new CPDF_Number(rotate * 90)); |
| 318 } | 320 } |
| OLD | NEW |