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

Side by Side Diff: fpdfsdk/fpdfeditpage.cpp

Issue 2509123002: Make CPDF_Object subclass constructors intern strings (Closed)
Patch Set: Nits 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
« no previous file with comments | « fpdfsdk/fpdfdoc_unittest.cpp ('k') | fpdfsdk/fpdfppo.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 #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)) {
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
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 }
OLDNEW
« no previous file with comments | « fpdfsdk/fpdfdoc_unittest.cpp ('k') | fpdfsdk/fpdfppo.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698