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

Side by Side Diff: core/src/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp

Issue 1415453002: Merge to XFA: Declare PDF_GetStandardFontName() in the header. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: rebase Created 5 years, 2 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 | « core/include/fxge/fx_font.h ('k') | core/src/fpdfapi/fpdf_font/fpdf_font.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 "../../../include/fpdfapi/fpdf_page.h" 7 #include "../../../include/fpdfapi/fpdf_page.h"
8 #include "../../../include/fpdfapi/fpdf_module.h" 8 #include "../../../include/fpdfapi/fpdf_module.h"
9 #include "../fpdf_page/pageint.h" 9 #include "../fpdf_page/pageint.h"
10 #include <limits.h> 10 #include <limits.h>
(...skipping 1088 matching lines...) Expand 10 before | Expand all | Expand 10 after
1099 CPDF_Dictionary* CPDF_Document::CreateNewPage(int iPage) { 1099 CPDF_Dictionary* CPDF_Document::CreateNewPage(int iPage) {
1100 CPDF_Dictionary* pDict = new CPDF_Dictionary; 1100 CPDF_Dictionary* pDict = new CPDF_Dictionary;
1101 pDict->SetAtName("Type", "Page"); 1101 pDict->SetAtName("Type", "Page");
1102 FX_DWORD dwObjNum = AddIndirectObject(pDict); 1102 FX_DWORD dwObjNum = AddIndirectObject(pDict);
1103 if (InsertNewPage(this, iPage, pDict, m_PageList) < 0) { 1103 if (InsertNewPage(this, iPage, pDict, m_PageList) < 0) {
1104 ReleaseIndirectObject(dwObjNum); 1104 ReleaseIndirectObject(dwObjNum);
1105 return NULL; 1105 return NULL;
1106 } 1106 }
1107 return pDict; 1107 return pDict;
1108 } 1108 }
1109 int _PDF_GetStandardFontName(CFX_ByteString& name); 1109
1110 CPDF_Font* CPDF_Document::AddStandardFont(const FX_CHAR* font, 1110 CPDF_Font* CPDF_Document::AddStandardFont(const FX_CHAR* font,
1111 CPDF_FontEncoding* pEncoding) { 1111 CPDF_FontEncoding* pEncoding) {
1112 CFX_ByteString name(font, -1); 1112 CFX_ByteString name(font, -1);
1113 if (_PDF_GetStandardFontName(name) < 0) { 1113 if (PDF_GetStandardFontName(&name) < 0)
1114 return NULL; 1114 return nullptr;
1115 }
1116 return GetPageData()->GetStandardFont(name, pEncoding); 1115 return GetPageData()->GetStandardFont(name, pEncoding);
1117 } 1116 }
1117
1118 void CPDF_Document::DeletePage(int iPage) { 1118 void CPDF_Document::DeletePage(int iPage) {
1119 CPDF_Dictionary* pRoot = GetRoot(); 1119 CPDF_Dictionary* pRoot = GetRoot();
1120 if (pRoot == NULL) { 1120 if (pRoot == NULL) {
1121 return; 1121 return;
1122 } 1122 }
1123 CPDF_Dictionary* pPages = pRoot->GetDict("Pages"); 1123 CPDF_Dictionary* pPages = pRoot->GetDict("Pages");
1124 if (pPages == NULL) { 1124 if (pPages == NULL) {
1125 return; 1125 return;
1126 } 1126 }
1127 int nPages = pPages->GetInteger("Count"); 1127 int nPages = pPages->GetInteger("Count");
(...skipping 12 matching lines...) Expand all
1140 void FPDFAPI_FlatPageAttr(CPDF_Dictionary* pPageDict, 1140 void FPDFAPI_FlatPageAttr(CPDF_Dictionary* pPageDict,
1141 const CFX_ByteStringC& name) { 1141 const CFX_ByteStringC& name) {
1142 if (pPageDict->KeyExist(name)) { 1142 if (pPageDict->KeyExist(name)) {
1143 return; 1143 return;
1144 } 1144 }
1145 CPDF_Object* pObj = FPDFAPI_GetPageAttr(pPageDict, name); 1145 CPDF_Object* pObj = FPDFAPI_GetPageAttr(pPageDict, name);
1146 if (pObj) { 1146 if (pObj) {
1147 pPageDict->SetAt(name, pObj->Clone()); 1147 pPageDict->SetAt(name, pObj->Clone());
1148 } 1148 }
1149 } 1149 }
OLDNEW
« no previous file with comments | « core/include/fxge/fx_font.h ('k') | core/src/fpdfapi/fpdf_font/fpdf_font.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698