| 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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 { | 165 { |
| 166 CFX_ByteString cbString; | 166 CFX_ByteString cbString; |
| 167 if(pRootDict->KeyExist("Collection")) | 167 if(pRootDict->KeyExist("Collection")) |
| 168 { | 168 { |
| 169 FPDF_UnSupportError(FPDF_UNSP_DOC_PORTABLECOLLECTION); | 169 FPDF_UnSupportError(FPDF_UNSP_DOC_PORTABLECOLLECTION); |
| 170 return ; | 170 return ; |
| 171 } | 171 } |
| 172 if(pRootDict->KeyExist("Names")) | 172 if(pRootDict->KeyExist("Names")) |
| 173 { | 173 { |
| 174 CPDF_Dictionary* pNameDict = pRootDict->GetDict("Names")
; | 174 CPDF_Dictionary* pNameDict = pRootDict->GetDict("Names")
; |
| 175 » » » if(pNameDict->KeyExist("EmbeddedFiles")) | 175 » » » if (pNameDict && pNameDict->KeyExist("EmbeddedFiles")) |
| 176 { | 176 { |
| 177 FPDF_UnSupportError(FPDF_UNSP_DOC_ATTACHMENT); | 177 FPDF_UnSupportError(FPDF_UNSP_DOC_ATTACHMENT); |
| 178 return; | 178 return; |
| 179 } | 179 } |
| 180 » » » else if(pNameDict->KeyExist("JavaScript")) | 180 » » » else if (pNameDict && pNameDict->KeyExist("JavaScript")) |
| 181 { | 181 { |
| 182 CPDF_Dictionary* pJSDict = pNameDict->GetDict("J
avaScript"); | 182 CPDF_Dictionary* pJSDict = pNameDict->GetDict("J
avaScript"); |
| 183 » » » » CPDF_Array * pArray = pJSDict->GetArray("Names")
; | 183 » » » » CPDF_Array * pArray = pJSDict ? pJSDict->GetArra
y("Names") : NULL; |
| 184 if (pArray) { | 184 if (pArray) { |
| 185 int nCount = pArray->GetCount(); | 185 int nCount = pArray->GetCount(); |
| 186 for(int i=0; i<nCount; i++) | 186 for(int i=0; i<nCount; i++) |
| 187 { | 187 { |
| 188 CFX_ByteString cbStr = pArray->G
etString(i); | 188 CFX_ByteString cbStr = pArray->G
etString(i); |
| 189 if(cbStr.Compare("com.adobe.acro
bat.SharedReview.Register") == 0) | 189 if(cbStr.Compare("com.adobe.acro
bat.SharedReview.Register") == 0) |
| 190 { | 190 { |
| 191 FPDF_UnSupportError(FPDF
_UNSP_DOC_SHAREDREVIEW); | 191 FPDF_UnSupportError(FPDF
_UNSP_DOC_SHAREDREVIEW); |
| 192 return; | 192 return; |
| 193 } | 193 } |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 return PAGEMODE_USETHUMBS; | 236 return PAGEMODE_USETHUMBS; |
| 237 else if (strPageMode.EqualNoCase(FX_BSTR("FullScreen"))) | 237 else if (strPageMode.EqualNoCase(FX_BSTR("FullScreen"))) |
| 238 return PAGEMODE_FULLSCREEN; | 238 return PAGEMODE_FULLSCREEN; |
| 239 else if (strPageMode.EqualNoCase(FX_BSTR("UseOC"))) | 239 else if (strPageMode.EqualNoCase(FX_BSTR("UseOC"))) |
| 240 return PAGEMODE_USEOC; | 240 return PAGEMODE_USEOC; |
| 241 else if (strPageMode.EqualNoCase(FX_BSTR("UseAttachments"))) | 241 else if (strPageMode.EqualNoCase(FX_BSTR("UseAttachments"))) |
| 242 return PAGEMODE_USEATTACHMENTS; | 242 return PAGEMODE_USEATTACHMENTS; |
| 243 | 243 |
| 244 return PAGEMODE_UNKNOWN; | 244 return PAGEMODE_UNKNOWN; |
| 245 } | 245 } |
| OLD | NEW |