| 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 "public/fpdf_ext.h" | 7 #include "public/fpdf_ext.h" |
| 8 | 8 |
| 9 #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" | 9 #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" |
| 10 #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" | 10 #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 #ifndef PDF_ENABLE_XFA | 184 #ifndef PDF_ENABLE_XFA |
| 185 // XFA Forms | 185 // XFA Forms |
| 186 CPDF_InterForm* pInterForm = new CPDF_InterForm(pDoc, FALSE); | 186 CPDF_InterForm* pInterForm = new CPDF_InterForm(pDoc, FALSE); |
| 187 if (pInterForm->HasXFAForm()) { | 187 if (pInterForm->HasXFAForm()) { |
| 188 FPDF_UnSupportError(FPDF_UNSP_DOC_XFAFORM); | 188 FPDF_UnSupportError(FPDF_UNSP_DOC_XFAFORM); |
| 189 } | 189 } |
| 190 delete pInterForm; | 190 delete pInterForm; |
| 191 #endif // PDF_ENABLE_XFA | 191 #endif // PDF_ENABLE_XFA |
| 192 } | 192 } |
| 193 | 193 |
| 194 DLLEXPORT int FPDFDoc_GetPageMode(FPDF_DOCUMENT document) { | 194 DLLEXPORT int STDCALL FPDFDoc_GetPageMode(FPDF_DOCUMENT document) { |
| 195 CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document); | 195 CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document); |
| 196 if (!pDoc) | 196 if (!pDoc) |
| 197 return PAGEMODE_UNKNOWN; | 197 return PAGEMODE_UNKNOWN; |
| 198 | 198 |
| 199 CPDF_Dictionary* pRoot = pDoc->GetRoot(); | 199 CPDF_Dictionary* pRoot = pDoc->GetRoot(); |
| 200 if (!pRoot) | 200 if (!pRoot) |
| 201 return PAGEMODE_UNKNOWN; | 201 return PAGEMODE_UNKNOWN; |
| 202 | 202 |
| 203 CPDF_Object* pName = pRoot->GetObjectBy("PageMode"); | 203 CPDF_Object* pName = pRoot->GetObjectBy("PageMode"); |
| 204 if (!pName) | 204 if (!pName) |
| 205 return PAGEMODE_USENONE; | 205 return PAGEMODE_USENONE; |
| 206 | 206 |
| 207 CFX_ByteString strPageMode = pName->GetString(); | 207 CFX_ByteString strPageMode = pName->GetString(); |
| 208 if (strPageMode.IsEmpty() || strPageMode.EqualNoCase("UseNone")) | 208 if (strPageMode.IsEmpty() || strPageMode.EqualNoCase("UseNone")) |
| 209 return PAGEMODE_USENONE; | 209 return PAGEMODE_USENONE; |
| 210 if (strPageMode.EqualNoCase("UseOutlines")) | 210 if (strPageMode.EqualNoCase("UseOutlines")) |
| 211 return PAGEMODE_USEOUTLINES; | 211 return PAGEMODE_USEOUTLINES; |
| 212 if (strPageMode.EqualNoCase("UseThumbs")) | 212 if (strPageMode.EqualNoCase("UseThumbs")) |
| 213 return PAGEMODE_USETHUMBS; | 213 return PAGEMODE_USETHUMBS; |
| 214 if (strPageMode.EqualNoCase("FullScreen")) | 214 if (strPageMode.EqualNoCase("FullScreen")) |
| 215 return PAGEMODE_FULLSCREEN; | 215 return PAGEMODE_FULLSCREEN; |
| 216 if (strPageMode.EqualNoCase("UseOC")) | 216 if (strPageMode.EqualNoCase("UseOC")) |
| 217 return PAGEMODE_USEOC; | 217 return PAGEMODE_USEOC; |
| 218 if (strPageMode.EqualNoCase("UseAttachments")) | 218 if (strPageMode.EqualNoCase("UseAttachments")) |
| 219 return PAGEMODE_USEATTACHMENTS; | 219 return PAGEMODE_USEATTACHMENTS; |
| 220 | 220 |
| 221 return PAGEMODE_UNKNOWN; | 221 return PAGEMODE_UNKNOWN; |
| 222 } | 222 } |
| OLD | NEW |