| 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 "../include/fsdk_define.h" | 7 #include "../include/fsdk_define.h" |
| 8 #include "../include/fpdf_ext.h" | 8 #include "../include/fpdf_ext.h" |
| 9 | 9 |
| 10 #define FPDFSDK_UNSUPPORT_CALL 100 | 10 #define FPDFSDK_UNSUPPORT_CALL 100 |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 } | 197 } |
| 198 } | 198 } |
| 199 | 199 |
| 200 // SharedForm | 200 // SharedForm |
| 201 CPDF_Metadata metaData; | 201 CPDF_Metadata metaData; |
| 202 metaData.LoadDoc(pDoc); | 202 metaData.LoadDoc(pDoc); |
| 203 CXML_Element * pElement = metaData.GetRoot(); | 203 CXML_Element * pElement = metaData.GetRoot(); |
| 204 if(pElement) | 204 if(pElement) |
| 205 CheckSharedForm(pElement, "workflowType"); | 205 CheckSharedForm(pElement, "workflowType"); |
| 206 | 206 |
| 207 | |
| 208 // XFA Forms | 207 // XFA Forms |
| 209 » CPDF_InterForm * pInterForm = FX_NEW CPDF_InterForm(pDoc,FALSE); | 208 » CPDF_InterForm * pInterForm = new CPDF_InterForm(pDoc,FALSE); |
| 210 » if (pInterForm) | 209 » if (pInterForm->HasXFAForm()) |
| 211 { | 210 { |
| 212 » » if(pInterForm->HasXFAForm()) | 211 » » FPDF_UnSupportError(FPDF_UNSP_DOC_XFAFORM); |
| 213 » » { | |
| 214 » » » FPDF_UnSupportError(FPDF_UNSP_DOC_XFAFORM); | |
| 215 » » } | |
| 216 » » delete pInterForm; | |
| 217 } | 212 } |
| 213 delete pInterForm; |
| 218 } | 214 } |
| 219 | 215 |
| 220 DLLEXPORT int FPDFDoc_GetPageMode(FPDF_DOCUMENT document) | 216 DLLEXPORT int FPDFDoc_GetPageMode(FPDF_DOCUMENT document) |
| 221 { | 217 { |
| 222 if (!document) return PAGEMODE_UNKNOWN; | 218 if (!document) return PAGEMODE_UNKNOWN; |
| 223 CPDF_Dictionary *pRoot = ((CPDF_Document*)document)->GetRoot(); | 219 CPDF_Dictionary *pRoot = ((CPDF_Document*)document)->GetRoot(); |
| 224 if (!pRoot) | 220 if (!pRoot) |
| 225 return PAGEMODE_UNKNOWN; | 221 return PAGEMODE_UNKNOWN; |
| 226 CPDF_Object* pName = pRoot->GetElement("PageMode"); | 222 CPDF_Object* pName = pRoot->GetElement("PageMode"); |
| 227 if (!pName) | 223 if (!pName) |
| 228 return PAGEMODE_USENONE; | 224 return PAGEMODE_USENONE; |
| 229 CFX_ByteString strPageMode = pName->GetString(); | 225 CFX_ByteString strPageMode = pName->GetString(); |
| 230 | 226 |
| 231 if (strPageMode.IsEmpty()||strPageMode.EqualNoCase(FX_BSTR("UseNone"))) | 227 if (strPageMode.IsEmpty()||strPageMode.EqualNoCase(FX_BSTR("UseNone"))) |
| 232 return PAGEMODE_USENONE; | 228 return PAGEMODE_USENONE; |
| 233 else if (strPageMode.EqualNoCase(FX_BSTR("UseOutlines"))) | 229 else if (strPageMode.EqualNoCase(FX_BSTR("UseOutlines"))) |
| 234 return PAGEMODE_USEOUTLINES; | 230 return PAGEMODE_USEOUTLINES; |
| 235 else if (strPageMode.EqualNoCase(FX_BSTR("UseThumbs"))) | 231 else if (strPageMode.EqualNoCase(FX_BSTR("UseThumbs"))) |
| 236 return PAGEMODE_USETHUMBS; | 232 return PAGEMODE_USETHUMBS; |
| 237 else if (strPageMode.EqualNoCase(FX_BSTR("FullScreen"))) | 233 else if (strPageMode.EqualNoCase(FX_BSTR("FullScreen"))) |
| 238 return PAGEMODE_FULLSCREEN; | 234 return PAGEMODE_FULLSCREEN; |
| 239 else if (strPageMode.EqualNoCase(FX_BSTR("UseOC"))) | 235 else if (strPageMode.EqualNoCase(FX_BSTR("UseOC"))) |
| 240 return PAGEMODE_USEOC; | 236 return PAGEMODE_USEOC; |
| 241 else if (strPageMode.EqualNoCase(FX_BSTR("UseAttachments"))) | 237 else if (strPageMode.EqualNoCase(FX_BSTR("UseAttachments"))) |
| 242 return PAGEMODE_USEATTACHMENTS; | 238 return PAGEMODE_USEATTACHMENTS; |
| 243 | 239 |
| 244 return PAGEMODE_UNKNOWN; | 240 return PAGEMODE_UNKNOWN; |
| 245 } | 241 } |
| OLD | NEW |