| OLD | NEW |
| 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 <limits.h> | 7 #include <limits.h> |
| 8 | 8 |
| 9 #include "core/fpdfapi/fpdf_font/include/cpdf_font.h" | 9 #include "core/fpdfapi/fpdf_font/include/cpdf_font.h" |
| 10 #include "core/fpdfapi/fpdf_font/include/cpdf_fontencoding.h" | 10 #include "core/fpdfapi/fpdf_font/include/cpdf_fontencoding.h" |
| (...skipping 1106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1117 return NULL; | 1117 return NULL; |
| 1118 } | 1118 } |
| 1119 return pDict; | 1119 return pDict; |
| 1120 } | 1120 } |
| 1121 | 1121 |
| 1122 CPDF_Font* CPDF_Document::AddStandardFont(const FX_CHAR* font, | 1122 CPDF_Font* CPDF_Document::AddStandardFont(const FX_CHAR* font, |
| 1123 CPDF_FontEncoding* pEncoding) { | 1123 CPDF_FontEncoding* pEncoding) { |
| 1124 CFX_ByteString name(font); | 1124 CFX_ByteString name(font); |
| 1125 if (PDF_GetStandardFontName(&name) < 0) | 1125 if (PDF_GetStandardFontName(&name) < 0) |
| 1126 return nullptr; | 1126 return nullptr; |
| 1127 return GetPageData()->GetStandardFont(name.AsByteStringC(), pEncoding); | 1127 return GetPageData()->GetStandardFont(name.AsStringC(), pEncoding); |
| 1128 } | 1128 } |
| 1129 | 1129 |
| 1130 void CPDF_Document::DeletePage(int iPage) { | 1130 void CPDF_Document::DeletePage(int iPage) { |
| 1131 CPDF_Dictionary* pRoot = GetRoot(); | 1131 CPDF_Dictionary* pRoot = GetRoot(); |
| 1132 if (!pRoot) { | 1132 if (!pRoot) { |
| 1133 return; | 1133 return; |
| 1134 } | 1134 } |
| 1135 CPDF_Dictionary* pPages = pRoot->GetDictBy("Pages"); | 1135 CPDF_Dictionary* pPages = pRoot->GetDictBy("Pages"); |
| 1136 if (!pPages) { | 1136 if (!pPages) { |
| 1137 return; | 1137 return; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 1151 void FPDFAPI_FlatPageAttr(CPDF_Dictionary* pPageDict, | 1151 void FPDFAPI_FlatPageAttr(CPDF_Dictionary* pPageDict, |
| 1152 const CFX_ByteStringC& name) { | 1152 const CFX_ByteStringC& name) { |
| 1153 if (pPageDict->KeyExist(name)) { | 1153 if (pPageDict->KeyExist(name)) { |
| 1154 return; | 1154 return; |
| 1155 } | 1155 } |
| 1156 CPDF_Object* pObj = FPDFAPI_GetPageAttr(pPageDict, name); | 1156 CPDF_Object* pObj = FPDFAPI_GetPageAttr(pPageDict, name); |
| 1157 if (pObj) { | 1157 if (pObj) { |
| 1158 pPageDict->SetAt(name, pObj->Clone()); | 1158 pPageDict->SetAt(name, pObj->Clone()); |
| 1159 } | 1159 } |
| 1160 } | 1160 } |
| OLD | NEW |