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/javascript/JavaScript.h" | 7 #include "../../include/javascript/JavaScript.h" |
8 #include "../../include/javascript/IJavaScript.h" | 8 #include "../../include/javascript/IJavaScript.h" |
9 #include "../../include/javascript/JS_Define.h" | 9 #include "../../include/javascript/JS_Define.h" |
10 #include "../../include/javascript/JS_Object.h" | 10 #include "../../include/javascript/JS_Object.h" |
(...skipping 1410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1421 | 1421 |
1422 for (int i = 0; i < iIconTreeLength; i++) { | 1422 for (int i = 0; i < iIconTreeLength; i++) { |
1423 pIconElement = (*m_pIconTree)[i]; | 1423 pIconElement = (*m_pIconTree)[i]; |
1424 | 1424 |
1425 v8::Local<v8::Object> pObj = FXJS_NewFxDynamicObj( | 1425 v8::Local<v8::Object> pObj = FXJS_NewFxDynamicObj( |
1426 pRuntime->GetIsolate(), pContext, | 1426 pRuntime->GetIsolate(), pContext, |
1427 FXJS_GetObjDefnID(pRuntime->GetIsolate(), L"Icon")); | 1427 FXJS_GetObjDefnID(pRuntime->GetIsolate(), L"Icon")); |
1428 if (pObj.IsEmpty()) | 1428 if (pObj.IsEmpty()) |
1429 return FALSE; | 1429 return FALSE; |
1430 | 1430 |
1431 CJS_Icon* pJS_Icon = (CJS_Icon*)FXJS_GetPrivate(pObj); | 1431 CJS_Icon* pJS_Icon = (CJS_Icon*)FXJS_GetPrivate(m_isolate, pObj); |
1432 if (!pJS_Icon) | 1432 if (!pJS_Icon) |
1433 return FALSE; | 1433 return FALSE; |
1434 | 1434 |
1435 Icon* pIcon = (Icon*)pJS_Icon->GetEmbedObject(); | 1435 Icon* pIcon = (Icon*)pJS_Icon->GetEmbedObject(); |
1436 if (!pIcon) | 1436 if (!pIcon) |
1437 return FALSE; | 1437 return FALSE; |
1438 | 1438 |
1439 pIcon->SetStream(pIconElement->IconStream->GetStream()); | 1439 pIcon->SetStream(pIconElement->IconStream->GetStream()); |
1440 pIcon->SetIconName(pIconElement->IconName); | 1440 pIcon->SetIconName(pIconElement->IconName); |
1441 Icons.SetElement(i, CJS_Value(m_isolate, pJS_Icon)); | 1441 Icons.SetElement(i, CJS_Value(m_isolate, pJS_Icon)); |
(...skipping 23 matching lines...) Expand all Loading... |
1465 for (int i = 0; i < iIconCounts; i++) { | 1465 for (int i = 0; i < iIconCounts; i++) { |
1466 if ((*m_pIconTree)[i]->IconName == swIconName) { | 1466 if ((*m_pIconTree)[i]->IconName == swIconName) { |
1467 Icon* pRetIcon = (*m_pIconTree)[i]->IconStream; | 1467 Icon* pRetIcon = (*m_pIconTree)[i]->IconStream; |
1468 | 1468 |
1469 v8::Local<v8::Object> pObj = FXJS_NewFxDynamicObj( | 1469 v8::Local<v8::Object> pObj = FXJS_NewFxDynamicObj( |
1470 pRuntime->GetIsolate(), pContext, | 1470 pRuntime->GetIsolate(), pContext, |
1471 FXJS_GetObjDefnID(pRuntime->GetIsolate(), L"Icon")); | 1471 FXJS_GetObjDefnID(pRuntime->GetIsolate(), L"Icon")); |
1472 if (pObj.IsEmpty()) | 1472 if (pObj.IsEmpty()) |
1473 return FALSE; | 1473 return FALSE; |
1474 | 1474 |
1475 CJS_Icon* pJS_Icon = (CJS_Icon*)FXJS_GetPrivate(pObj); | 1475 CJS_Icon* pJS_Icon = (CJS_Icon*)FXJS_GetPrivate(m_isolate, pObj); |
1476 if (!pJS_Icon) | 1476 if (!pJS_Icon) |
1477 return FALSE; | 1477 return FALSE; |
1478 | 1478 |
1479 Icon* pIcon = (Icon*)pJS_Icon->GetEmbedObject(); | 1479 Icon* pIcon = (Icon*)pJS_Icon->GetEmbedObject(); |
1480 if (!pIcon) | 1480 if (!pIcon) |
1481 return FALSE; | 1481 return FALSE; |
1482 | 1482 |
1483 pIcon->SetIconName(swIconName); | 1483 pIcon->SetIconName(swIconName); |
1484 pIcon->SetStream(pRetIcon->GetStream()); | 1484 pIcon->SetStream(pRetIcon->GetStream()); |
1485 vRet = pJS_Icon; | 1485 vRet = pJS_Icon; |
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1850 CFX_DWordArray DelArray; | 1850 CFX_DWordArray DelArray; |
1851 | 1851 |
1852 for (int j = DelArray.GetSize() - 1; j >= 0; j--) { | 1852 for (int j = DelArray.GetSize() - 1; j >= 0; j--) { |
1853 m_DelayData.RemoveAt(DelArray[j]); | 1853 m_DelayData.RemoveAt(DelArray[j]); |
1854 } | 1854 } |
1855 } | 1855 } |
1856 | 1856 |
1857 CJS_Document* Document::GetCJSDoc() const { | 1857 CJS_Document* Document::GetCJSDoc() const { |
1858 return static_cast<CJS_Document*>(m_pJSObject); | 1858 return static_cast<CJS_Document*>(m_pJSObject); |
1859 } | 1859 } |
OLD | NEW |