| 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 <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 FSDK_SetUnSpObjProcessHandler(UNSUPPORT_INFO* unsp_info) { | 39 FSDK_SetUnSpObjProcessHandler(UNSUPPORT_INFO* unsp_info) { |
| 40 if (!unsp_info || unsp_info->version != 1) | 40 if (!unsp_info || unsp_info->version != 1) |
| 41 return FALSE; | 41 return FALSE; |
| 42 | 42 |
| 43 CPDF_ModuleMgr::Get()->SetUnsupportInfoAdapter( | 43 CPDF_ModuleMgr::Get()->SetUnsupportInfoAdapter( |
| 44 WrapUnique(new CFSDK_UnsupportInfo_Adapter(unsp_info))); | 44 WrapUnique(new CFSDK_UnsupportInfo_Adapter(unsp_info))); |
| 45 return TRUE; | 45 return TRUE; |
| 46 } | 46 } |
| 47 | 47 |
| 48 void CheckUnSupportAnnot(CPDF_Document* pDoc, const CPDF_Annot* pPDFAnnot) { | 48 void CheckUnSupportAnnot(CPDF_Document* pDoc, const CPDF_Annot* pPDFAnnot) { |
| 49 CFX_ByteString cbSubType = pPDFAnnot->GetSubtype(); | 49 CPDF_Annot::Subtype nAnnotSubtype = pPDFAnnot->GetSubtype(); |
| 50 if (cbSubType.Compare("3D") == 0) { | 50 if (nAnnotSubtype == CPDF_Annot::Subtype::THREED) { |
| 51 FPDF_UnSupportError(FPDF_UNSP_ANNOT_3DANNOT); | 51 FPDF_UnSupportError(FPDF_UNSP_ANNOT_3DANNOT); |
| 52 } else if (cbSubType.Compare("Screen") == 0) { | 52 } else if (nAnnotSubtype == CPDF_Annot::Subtype::SCREEN) { |
| 53 const CPDF_Dictionary* pAnnotDict = pPDFAnnot->GetAnnotDict(); | 53 const CPDF_Dictionary* pAnnotDict = pPDFAnnot->GetAnnotDict(); |
| 54 CFX_ByteString cbString; | 54 CFX_ByteString cbString; |
| 55 if (pAnnotDict->KeyExist("IT")) | 55 if (pAnnotDict->KeyExist("IT")) |
| 56 cbString = pAnnotDict->GetStringBy("IT"); | 56 cbString = pAnnotDict->GetStringBy("IT"); |
| 57 if (cbString.Compare("Img") != 0) | 57 if (cbString.Compare("Img") != 0) |
| 58 FPDF_UnSupportError(FPDF_UNSP_ANNOT_SCREEN_MEDIA); | 58 FPDF_UnSupportError(FPDF_UNSP_ANNOT_SCREEN_MEDIA); |
| 59 } else if (cbSubType.Compare("Movie") == 0) { | 59 } else if (nAnnotSubtype == CPDF_Annot::Subtype::MOVIE) { |
| 60 FPDF_UnSupportError(FPDF_UNSP_ANNOT_MOVIE); | 60 FPDF_UnSupportError(FPDF_UNSP_ANNOT_MOVIE); |
| 61 } else if (cbSubType.Compare("Sound") == 0) { | 61 } else if (nAnnotSubtype == CPDF_Annot::Subtype::SOUND) { |
| 62 FPDF_UnSupportError(FPDF_UNSP_ANNOT_SOUND); | 62 FPDF_UnSupportError(FPDF_UNSP_ANNOT_SOUND); |
| 63 } else if (cbSubType.Compare("RichMedia") == 0) { | 63 } else if (nAnnotSubtype == CPDF_Annot::Subtype::RICHMEDIA) { |
| 64 FPDF_UnSupportError(FPDF_UNSP_ANNOT_SCREEN_RICHMEDIA); | 64 FPDF_UnSupportError(FPDF_UNSP_ANNOT_SCREEN_RICHMEDIA); |
| 65 } else if (cbSubType.Compare("FileAttachment") == 0) { | 65 } else if (nAnnotSubtype == CPDF_Annot::Subtype::FILEATTACHMENT) { |
| 66 FPDF_UnSupportError(FPDF_UNSP_ANNOT_ATTACHMENT); | 66 FPDF_UnSupportError(FPDF_UNSP_ANNOT_ATTACHMENT); |
| 67 } else if (cbSubType.Compare("Widget") == 0) { | 67 } else if (nAnnotSubtype == CPDF_Annot::Subtype::WIDGET) { |
| 68 const CPDF_Dictionary* pAnnotDict = pPDFAnnot->GetAnnotDict(); | 68 const CPDF_Dictionary* pAnnotDict = pPDFAnnot->GetAnnotDict(); |
| 69 CFX_ByteString cbString; | 69 CFX_ByteString cbString; |
| 70 if (pAnnotDict->KeyExist("FT")) { | 70 if (pAnnotDict->KeyExist("FT")) |
| 71 cbString = pAnnotDict->GetStringBy("FT"); | 71 cbString = pAnnotDict->GetStringBy("FT"); |
| 72 } | 72 if (cbString.Compare("Sig") == 0) |
| 73 if (cbString.Compare("Sig") == 0) { | |
| 74 FPDF_UnSupportError(FPDF_UNSP_ANNOT_SIG); | 73 FPDF_UnSupportError(FPDF_UNSP_ANNOT_SIG); |
| 75 } | |
| 76 } | 74 } |
| 77 } | 75 } |
| 78 | 76 |
| 79 FX_BOOL CheckSharedForm(const CXML_Element* pElement, CFX_ByteString cbName) { | 77 FX_BOOL CheckSharedForm(const CXML_Element* pElement, CFX_ByteString cbName) { |
| 80 int count = pElement->CountAttrs(); | 78 int count = pElement->CountAttrs(); |
| 81 int i = 0; | 79 int i = 0; |
| 82 for (i = 0; i < count; i++) { | 80 for (i = 0; i < count; i++) { |
| 83 CFX_ByteString space, name; | 81 CFX_ByteString space, name; |
| 84 CFX_WideString value; | 82 CFX_WideString value; |
| 85 pElement->GetAttrByIndex(i, space, name, value); | 83 pElement->GetAttrByIndex(i, space, name, value); |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 return PAGEMODE_USETHUMBS; | 190 return PAGEMODE_USETHUMBS; |
| 193 if (strPageMode.EqualNoCase("FullScreen")) | 191 if (strPageMode.EqualNoCase("FullScreen")) |
| 194 return PAGEMODE_FULLSCREEN; | 192 return PAGEMODE_FULLSCREEN; |
| 195 if (strPageMode.EqualNoCase("UseOC")) | 193 if (strPageMode.EqualNoCase("UseOC")) |
| 196 return PAGEMODE_USEOC; | 194 return PAGEMODE_USEOC; |
| 197 if (strPageMode.EqualNoCase("UseAttachments")) | 195 if (strPageMode.EqualNoCase("UseAttachments")) |
| 198 return PAGEMODE_USEATTACHMENTS; | 196 return PAGEMODE_USEATTACHMENTS; |
| 199 | 197 |
| 200 return PAGEMODE_UNKNOWN; | 198 return PAGEMODE_UNKNOWN; |
| 201 } | 199 } |
| OLD | NEW |