| 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/fpdfdoc/fpdf_doc.h" | 7 #include "../../include/fpdfdoc/fpdf_doc.h" |
| 8 CPDF_Dest CPDF_Action::GetDest(CPDF_Document* pDoc) const { | 8 CPDF_Dest CPDF_Action::GetDest(CPDF_Document* pDoc) const { |
| 9 if (!m_pDict) { | 9 if (!m_pDict) { |
| 10 return CPDF_Dest(); | 10 return CPDF_Dest(); |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 int iType = pFields->GetType(); | 172 int iType = pFields->GetType(); |
| 173 if (iType == PDFOBJ_DICTIONARY || iType == PDFOBJ_STRING) { | 173 if (iType == PDFOBJ_DICTIONARY || iType == PDFOBJ_STRING) { |
| 174 if (iIndex == 0) { | 174 if (iIndex == 0) { |
| 175 pFindObj = pFields; | 175 pFindObj = pFields; |
| 176 } | 176 } |
| 177 } else if (iType == PDFOBJ_ARRAY) { | 177 } else if (iType == PDFOBJ_ARRAY) { |
| 178 pFindObj = ((CPDF_Array*)pFields)->GetElementValue(iIndex); | 178 pFindObj = ((CPDF_Array*)pFields)->GetElementValue(iIndex); |
| 179 } | 179 } |
| 180 return pFindObj; | 180 return pFindObj; |
| 181 } | 181 } |
| 182 CPDF_LWinParam CPDF_Action::GetWinParam() const { | 182 |
| 183 if (m_pDict == NULL) { | |
| 184 return NULL; | |
| 185 } | |
| 186 if (m_pDict->GetString("S") != "Launch") { | |
| 187 return NULL; | |
| 188 } | |
| 189 return m_pDict->GetDict("Win"); | |
| 190 } | |
| 191 CFX_WideString CPDF_Action::GetJavaScript() const { | 183 CFX_WideString CPDF_Action::GetJavaScript() const { |
| 192 CFX_WideString csJS; | 184 CFX_WideString csJS; |
| 193 if (m_pDict == NULL) { | 185 if (m_pDict == NULL) { |
| 194 return csJS; | 186 return csJS; |
| 195 } | 187 } |
| 196 CPDF_Object* pJS = m_pDict->GetElementValue("JS"); | 188 CPDF_Object* pJS = m_pDict->GetElementValue("JS"); |
| 197 if (pJS != NULL) { | 189 if (pJS != NULL) { |
| 198 return pJS->GetUnicodeText(); | 190 return pJS->GetUnicodeText(); |
| 199 } | 191 } |
| 200 return csJS; | 192 return csJS; |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 if (pAction == NULL || pAction->GetType() != PDFOBJ_DICTIONARY) { | 333 if (pAction == NULL || pAction->GetType() != PDFOBJ_DICTIONARY) { |
| 342 return CPDF_Action(); | 334 return CPDF_Action(); |
| 343 } | 335 } |
| 344 return CPDF_Action(pAction->GetDict()); | 336 return CPDF_Action(pAction->GetDict()); |
| 345 } | 337 } |
| 346 int CPDF_DocJSActions::FindJSAction(const CFX_ByteString& csName) const { | 338 int CPDF_DocJSActions::FindJSAction(const CFX_ByteString& csName) const { |
| 347 ASSERT(m_pDocument != NULL); | 339 ASSERT(m_pDocument != NULL); |
| 348 CPDF_NameTree name_tree(m_pDocument, FX_BSTRC("JavaScript")); | 340 CPDF_NameTree name_tree(m_pDocument, FX_BSTRC("JavaScript")); |
| 349 return name_tree.GetIndex(csName); | 341 return name_tree.GetIndex(csName); |
| 350 } | 342 } |
| OLD | NEW |