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

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

Issue 1399273003: fpdfsdk/ differences with XFA (for didactic purposes only). (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Regenerate after taking juns patch Created 5 years 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_ext.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 8
9 #ifdef PDF_ENABLE_XFA
10 #include "../include/fpdfxfa/fpdfxfa_app.h"
11 #include "../include/fpdfxfa/fpdfxfa_doc.h"
12 #include "../include/fpdfxfa/fpdfxfa_page.h"
13 #endif
9 #include "fpdfsdk/include/fsdk_define.h" 14 #include "fpdfsdk/include/fsdk_define.h"
10 #include "public/fpdf_formfill.h" 15 #include "public/fpdf_formfill.h"
11 16
12 #if _FX_OS_ == _FX_ANDROID_ 17 #if _FX_OS_ == _FX_ANDROID_
13 #include "time.h" 18 #include "time.h"
14 #else 19 #else
15 #include <ctime> 20 #include <ctime>
16 #endif 21 #endif
17 22
18 DLLEXPORT FPDF_DOCUMENT STDCALL FPDF_CreateNewDocument() { 23 DLLEXPORT FPDF_DOCUMENT STDCALL FPDF_CreateNewDocument() {
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 CPDF_Array* pMediaBoxArray = new CPDF_Array; 76 CPDF_Array* pMediaBoxArray = new CPDF_Array;
72 pMediaBoxArray->Add(new CPDF_Number(0)); 77 pMediaBoxArray->Add(new CPDF_Number(0));
73 pMediaBoxArray->Add(new CPDF_Number(0)); 78 pMediaBoxArray->Add(new CPDF_Number(0));
74 pMediaBoxArray->Add(new CPDF_Number(FX_FLOAT(width))); 79 pMediaBoxArray->Add(new CPDF_Number(FX_FLOAT(width)));
75 pMediaBoxArray->Add(new CPDF_Number(FX_FLOAT(height))); 80 pMediaBoxArray->Add(new CPDF_Number(FX_FLOAT(height)));
76 81
77 pPageDict->SetAt("MediaBox", pMediaBoxArray); 82 pPageDict->SetAt("MediaBox", pMediaBoxArray);
78 pPageDict->SetAt("Rotate", new CPDF_Number(0)); 83 pPageDict->SetAt("Rotate", new CPDF_Number(0));
79 pPageDict->SetAt("Resources", new CPDF_Dictionary); 84 pPageDict->SetAt("Resources", new CPDF_Dictionary);
80 85
86 #ifndef PDF_ENABLE_XFA
81 CPDF_Page* pPage = new CPDF_Page; 87 CPDF_Page* pPage = new CPDF_Page;
82 pPage->Load(pDoc, pPageDict); 88 pPage->Load(pDoc, pPageDict);
83 pPage->ParseContent(); 89 pPage->ParseContent();
90 #else
91 CPDFXFA_Page* pPage =
92 new CPDFXFA_Page((CPDFXFA_Document*)document, page_index);
93 pPage->LoadPDFPage(pPageDict);
94 #endif
84 95
85 return pPage; 96 return pPage;
86 } 97 }
87 98
88 DLLEXPORT int STDCALL FPDFPage_GetRotation(FPDF_PAGE page) { 99 DLLEXPORT int STDCALL FPDFPage_GetRotation(FPDF_PAGE page) {
89 CPDF_Page* pPage = CPDFPageFromFPDFPage(page); 100 CPDF_Page* pPage = CPDFPageFromFPDFPage(page);
90 if (!pPage || !pPage->m_pFormDict || !pPage->m_pFormDict->KeyExist("Type") || 101 if (!pPage || !pPage->m_pFormDict || !pPage->m_pFormDict->KeyExist("Type") ||
91 !pPage->m_pFormDict->GetElement("Type")->GetDirect() || 102 !pPage->m_pFormDict->GetElement("Type")->GetDirect() ||
92 pPage->m_pFormDict->GetElement("Type")->GetDirect()->GetString().Compare( 103 pPage->m_pFormDict->GetElement("Type")->GetDirect()->GetString().Compare(
93 "Page")) { 104 "Page")) {
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 !pPage->m_pFormDict->GetElement("Type")->GetDirect() || 302 !pPage->m_pFormDict->GetElement("Type")->GetDirect() ||
292 pPage->m_pFormDict->GetElement("Type")->GetDirect()->GetString().Compare( 303 pPage->m_pFormDict->GetElement("Type")->GetDirect()->GetString().Compare(
293 "Page")) { 304 "Page")) {
294 return; 305 return;
295 } 306 }
296 CPDF_Dictionary* pDict = pPage->m_pFormDict; 307 CPDF_Dictionary* pDict = pPage->m_pFormDict;
297 rotate %= 4; 308 rotate %= 4;
298 309
299 pDict->SetAt("Rotate", new CPDF_Number(rotate * 90)); 310 pDict->SetAt("Rotate", new CPDF_Number(rotate * 90));
300 } 311 }
OLDNEW
« no previous file with comments | « fpdfsdk/src/fpdf_ext.cpp ('k') | fpdfsdk/src/fpdfformfill.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698