| 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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 if (pRootDict->KeyExist("Names")) { | 156 if (pRootDict->KeyExist("Names")) { |
| 157 CPDF_Dictionary* pNameDict = pRootDict->GetDictBy("Names"); | 157 CPDF_Dictionary* pNameDict = pRootDict->GetDictBy("Names"); |
| 158 if (pNameDict && pNameDict->KeyExist("EmbeddedFiles")) { | 158 if (pNameDict && pNameDict->KeyExist("EmbeddedFiles")) { |
| 159 FPDF_UnSupportError(FPDF_UNSP_DOC_ATTACHMENT); | 159 FPDF_UnSupportError(FPDF_UNSP_DOC_ATTACHMENT); |
| 160 return; | 160 return; |
| 161 } | 161 } |
| 162 if (pNameDict && pNameDict->KeyExist("JavaScript")) { | 162 if (pNameDict && pNameDict->KeyExist("JavaScript")) { |
| 163 CPDF_Dictionary* pJSDict = pNameDict->GetDictBy("JavaScript"); | 163 CPDF_Dictionary* pJSDict = pNameDict->GetDictBy("JavaScript"); |
| 164 CPDF_Array* pArray = pJSDict ? pJSDict->GetArrayBy("Names") : NULL; | 164 CPDF_Array* pArray = pJSDict ? pJSDict->GetArrayBy("Names") : NULL; |
| 165 if (pArray) { | 165 if (pArray) { |
| 166 int nCount = pArray->GetCount(); | 166 for (size_t i = 0; i < pArray->GetCount(); i++) { |
| 167 for (int i = 0; i < nCount; i++) { | |
| 168 CFX_ByteString cbStr = pArray->GetStringAt(i); | 167 CFX_ByteString cbStr = pArray->GetStringAt(i); |
| 169 if (cbStr.Compare("com.adobe.acrobat.SharedReview.Register") == 0) { | 168 if (cbStr.Compare("com.adobe.acrobat.SharedReview.Register") == 0) { |
| 170 FPDF_UnSupportError(FPDF_UNSP_DOC_SHAREDREVIEW); | 169 FPDF_UnSupportError(FPDF_UNSP_DOC_SHAREDREVIEW); |
| 171 return; | 170 return; |
| 172 } | 171 } |
| 173 } | 172 } |
| 174 } | 173 } |
| 175 } | 174 } |
| 176 } | 175 } |
| 177 } | 176 } |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 return PAGEMODE_USETHUMBS; | 213 return PAGEMODE_USETHUMBS; |
| 215 if (strPageMode.EqualNoCase("FullScreen")) | 214 if (strPageMode.EqualNoCase("FullScreen")) |
| 216 return PAGEMODE_FULLSCREEN; | 215 return PAGEMODE_FULLSCREEN; |
| 217 if (strPageMode.EqualNoCase("UseOC")) | 216 if (strPageMode.EqualNoCase("UseOC")) |
| 218 return PAGEMODE_USEOC; | 217 return PAGEMODE_USEOC; |
| 219 if (strPageMode.EqualNoCase("UseAttachments")) | 218 if (strPageMode.EqualNoCase("UseAttachments")) |
| 220 return PAGEMODE_USEATTACHMENTS; | 219 return PAGEMODE_USEATTACHMENTS; |
| 221 | 220 |
| 222 return PAGEMODE_UNKNOWN; | 221 return PAGEMODE_UNKNOWN; |
| 223 } | 222 } |
| OLD | NEW |