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

Side by Side Diff: fpdfsdk/fpdfeditpage.cpp

Issue 2509123002: Make CPDF_Object subclass constructors intern strings (Closed)
Patch Set: finish Created 4 years, 1 month 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
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 #include <algorithm> 9 #include <algorithm>
10 #include <memory> 10 #include <memory>
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
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))
Lei Zhang 2016/11/17 01:05:06 braces
Tom Sepez 2016/11/17 01:13:48 Done.
87 pInfoDict->SetFor("CreationDate", new CPDF_String(DateStr, false)); 87 pInfoDict->SetFor("CreationDate",
88 new CPDF_String(nullptr, DateStr, false));
88 pInfoDict->SetFor("Creator", new CPDF_String(L"PDFium")); 89 pInfoDict->SetFor("Creator", new CPDF_String(L"PDFium"));
89 } 90 }
90 91
91 return FPDFDocumentFromCPDFDocument(pDoc); 92 return FPDFDocumentFromCPDFDocument(pDoc);
92 } 93 }
93 94
94 DLLEXPORT void STDCALL FPDFPage_Delete(FPDF_DOCUMENT document, int page_index) { 95 DLLEXPORT void STDCALL FPDFPage_Delete(FPDF_DOCUMENT document, int page_index) {
95 if (UnderlyingDocumentType* pDoc = UnderlyingFromFPDFDocument(document)) 96 if (UnderlyingDocumentType* pDoc = UnderlyingFromFPDFDocument(document))
96 pDoc->DeletePage(page_index); 97 pDoc->DeletePage(page_index);
97 } 98 }
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 310
310 DLLEXPORT void STDCALL FPDFPage_SetRotation(FPDF_PAGE page, int rotate) { 311 DLLEXPORT void STDCALL FPDFPage_SetRotation(FPDF_PAGE page, int rotate) {
311 CPDF_Page* pPage = CPDFPageFromFPDFPage(page); 312 CPDF_Page* pPage = CPDFPageFromFPDFPage(page);
312 if (!IsPageObject(pPage)) 313 if (!IsPageObject(pPage))
313 return; 314 return;
314 315
315 CPDF_Dictionary* pDict = pPage->m_pFormDict; 316 CPDF_Dictionary* pDict = pPage->m_pFormDict;
316 rotate %= 4; 317 rotate %= 4;
317 pDict->SetFor("Rotate", new CPDF_Number(rotate * 90)); 318 pDict->SetFor("Rotate", new CPDF_Number(rotate * 90));
318 } 319 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698