Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(135)

Side by Side Diff: fpdfsdk/src/fpdfeditpage.cpp

Issue 1153553003: Make CPDFXFA_App / IXFA_AppProvider saner (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Address comments. Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « fpdfsdk/src/fpdf_dataavail.cpp ('k') | fpdfsdk/src/fpdfformfill.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
32 if ( -1 != time( &currentTime ) ) 32 if ( -1 != time( &currentTime ) )
33 { 33 {
34 tm * pTM = localtime( &currentTime ); 34 tm * pTM = localtime( &currentTime );
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
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 }
OLDNEW
« no previous file with comments | « fpdfsdk/src/fpdf_dataavail.cpp ('k') | fpdfsdk/src/fpdfformfill.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698