| 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 "../../core/include/fxcrt/fx_xml.h" | 7 #include "../../core/include/fxcrt/fx_xml.h" |
| 8 #include "../../public/fpdf_ext.h" | 8 #include "../../public/fpdf_ext.h" |
| 9 #include "../include/fsdk_define.h" | 9 #include "../include/fsdk_define.h" |
| 10 | 10 |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 | 176 |
| 177 // XFA Forms | 177 // XFA Forms |
| 178 CPDF_InterForm* pInterForm = new CPDF_InterForm(pDoc, FALSE); | 178 CPDF_InterForm* pInterForm = new CPDF_InterForm(pDoc, FALSE); |
| 179 if (pInterForm->HasXFAForm()) { | 179 if (pInterForm->HasXFAForm()) { |
| 180 FPDF_UnSupportError(FPDF_UNSP_DOC_XFAFORM); | 180 FPDF_UnSupportError(FPDF_UNSP_DOC_XFAFORM); |
| 181 } | 181 } |
| 182 delete pInterForm; | 182 delete pInterForm; |
| 183 } | 183 } |
| 184 | 184 |
| 185 DLLEXPORT int FPDFDoc_GetPageMode(FPDF_DOCUMENT document) { | 185 DLLEXPORT int FPDFDoc_GetPageMode(FPDF_DOCUMENT document) { |
| 186 CPDF_Document* pDoc = CPDF_Document::FromFPDFDocument(document); | 186 CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document); |
| 187 if (!pDoc) | 187 if (!pDoc) |
| 188 return PAGEMODE_UNKNOWN; | 188 return PAGEMODE_UNKNOWN; |
| 189 | 189 |
| 190 CPDF_Dictionary* pRoot = pDoc->GetRoot(); | 190 CPDF_Dictionary* pRoot = pDoc->GetRoot(); |
| 191 if (!pRoot) | 191 if (!pRoot) |
| 192 return PAGEMODE_UNKNOWN; | 192 return PAGEMODE_UNKNOWN; |
| 193 | 193 |
| 194 CPDF_Object* pName = pRoot->GetElement("PageMode"); | 194 CPDF_Object* pName = pRoot->GetElement("PageMode"); |
| 195 if (!pName) | 195 if (!pName) |
| 196 return PAGEMODE_USENONE; | 196 return PAGEMODE_USENONE; |
| 197 | 197 |
| 198 CFX_ByteString strPageMode = pName->GetString(); | 198 CFX_ByteString strPageMode = pName->GetString(); |
| 199 if (strPageMode.IsEmpty() || strPageMode.EqualNoCase("UseNone")) | 199 if (strPageMode.IsEmpty() || strPageMode.EqualNoCase("UseNone")) |
| 200 return PAGEMODE_USENONE; | 200 return PAGEMODE_USENONE; |
| 201 if (strPageMode.EqualNoCase("UseOutlines")) | 201 if (strPageMode.EqualNoCase("UseOutlines")) |
| 202 return PAGEMODE_USEOUTLINES; | 202 return PAGEMODE_USEOUTLINES; |
| 203 if (strPageMode.EqualNoCase("UseThumbs")) | 203 if (strPageMode.EqualNoCase("UseThumbs")) |
| 204 return PAGEMODE_USETHUMBS; | 204 return PAGEMODE_USETHUMBS; |
| 205 if (strPageMode.EqualNoCase("FullScreen")) | 205 if (strPageMode.EqualNoCase("FullScreen")) |
| 206 return PAGEMODE_FULLSCREEN; | 206 return PAGEMODE_FULLSCREEN; |
| 207 if (strPageMode.EqualNoCase("UseOC")) | 207 if (strPageMode.EqualNoCase("UseOC")) |
| 208 return PAGEMODE_USEOC; | 208 return PAGEMODE_USEOC; |
| 209 if (strPageMode.EqualNoCase("UseAttachments")) | 209 if (strPageMode.EqualNoCase("UseAttachments")) |
| 210 return PAGEMODE_USEATTACHMENTS; | 210 return PAGEMODE_USEATTACHMENTS; |
| 211 | 211 |
| 212 return PAGEMODE_UNKNOWN; | 212 return PAGEMODE_UNKNOWN; |
| 213 } | 213 } |
| OLD | NEW |