| 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 1449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1460 | 1460 |
| 1461 for (int i = 0; i < iIconTreeLength; i++) { | 1461 for (int i = 0; i < iIconTreeLength; i++) { |
| 1462 pIconElement = (*m_pIconTree)[i]; | 1462 pIconElement = (*m_pIconTree)[i]; |
| 1463 | 1463 |
| 1464 v8::Local<v8::Object> pObj = FXJS_NewFxDynamicObj( | 1464 v8::Local<v8::Object> pObj = FXJS_NewFxDynamicObj( |
| 1465 pRuntime->GetIsolate(), pContext, | 1465 pRuntime->GetIsolate(), pContext, |
| 1466 FXJS_GetObjDefnID(pRuntime->GetIsolate(), L"Icon")); | 1466 FXJS_GetObjDefnID(pRuntime->GetIsolate(), L"Icon")); |
| 1467 if (pObj.IsEmpty()) | 1467 if (pObj.IsEmpty()) |
| 1468 return FALSE; | 1468 return FALSE; |
| 1469 | 1469 |
| 1470 CJS_Icon* pJS_Icon = (CJS_Icon*)FXJS_GetPrivate(pObj); | 1470 CJS_Icon* pJS_Icon = (CJS_Icon*)FXJS_GetPrivate(m_isolate, pObj); |
| 1471 if (!pJS_Icon) | 1471 if (!pJS_Icon) |
| 1472 return FALSE; | 1472 return FALSE; |
| 1473 | 1473 |
| 1474 Icon* pIcon = (Icon*)pJS_Icon->GetEmbedObject(); | 1474 Icon* pIcon = (Icon*)pJS_Icon->GetEmbedObject(); |
| 1475 if (!pIcon) | 1475 if (!pIcon) |
| 1476 return FALSE; | 1476 return FALSE; |
| 1477 | 1477 |
| 1478 pIcon->SetStream(pIconElement->IconStream->GetStream()); | 1478 pIcon->SetStream(pIconElement->IconStream->GetStream()); |
| 1479 pIcon->SetIconName(pIconElement->IconName); | 1479 pIcon->SetIconName(pIconElement->IconName); |
| 1480 Icons.SetElement(i, CJS_Value(m_isolate, pJS_Icon)); | 1480 Icons.SetElement(i, CJS_Value(m_isolate, pJS_Icon)); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 1504 for (int i = 0; i < iIconCounts; i++) { | 1504 for (int i = 0; i < iIconCounts; i++) { |
| 1505 if ((*m_pIconTree)[i]->IconName == swIconName) { | 1505 if ((*m_pIconTree)[i]->IconName == swIconName) { |
| 1506 Icon* pRetIcon = (*m_pIconTree)[i]->IconStream; | 1506 Icon* pRetIcon = (*m_pIconTree)[i]->IconStream; |
| 1507 | 1507 |
| 1508 v8::Local<v8::Object> pObj = FXJS_NewFxDynamicObj( | 1508 v8::Local<v8::Object> pObj = FXJS_NewFxDynamicObj( |
| 1509 pRuntime->GetIsolate(), pContext, | 1509 pRuntime->GetIsolate(), pContext, |
| 1510 FXJS_GetObjDefnID(pRuntime->GetIsolate(), L"Icon")); | 1510 FXJS_GetObjDefnID(pRuntime->GetIsolate(), L"Icon")); |
| 1511 if (pObj.IsEmpty()) | 1511 if (pObj.IsEmpty()) |
| 1512 return FALSE; | 1512 return FALSE; |
| 1513 | 1513 |
| 1514 CJS_Icon* pJS_Icon = (CJS_Icon*)FXJS_GetPrivate(pObj); | 1514 CJS_Icon* pJS_Icon = (CJS_Icon*)FXJS_GetPrivate(m_isolate, pObj); |
| 1515 if (!pJS_Icon) | 1515 if (!pJS_Icon) |
| 1516 return FALSE; | 1516 return FALSE; |
| 1517 | 1517 |
| 1518 Icon* pIcon = (Icon*)pJS_Icon->GetEmbedObject(); | 1518 Icon* pIcon = (Icon*)pJS_Icon->GetEmbedObject(); |
| 1519 if (!pIcon) | 1519 if (!pIcon) |
| 1520 return FALSE; | 1520 return FALSE; |
| 1521 | 1521 |
| 1522 pIcon->SetIconName(swIconName); | 1522 pIcon->SetIconName(swIconName); |
| 1523 pIcon->SetStream(pRetIcon->GetStream()); | 1523 pIcon->SetStream(pRetIcon->GetStream()); |
| 1524 vRet = pJS_Icon; | 1524 vRet = pJS_Icon; |
| (...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1929 CFX_DWordArray DelArray; | 1929 CFX_DWordArray DelArray; |
| 1930 | 1930 |
| 1931 for (int j = DelArray.GetSize() - 1; j >= 0; j--) { | 1931 for (int j = DelArray.GetSize() - 1; j >= 0; j--) { |
| 1932 m_DelayData.RemoveAt(DelArray[j]); | 1932 m_DelayData.RemoveAt(DelArray[j]); |
| 1933 } | 1933 } |
| 1934 } | 1934 } |
| 1935 | 1935 |
| 1936 CJS_Document* Document::GetCJSDoc() const { | 1936 CJS_Document* Document::GetCJSDoc() const { |
| 1937 return static_cast<CJS_Document*>(m_pJSObject); | 1937 return static_cast<CJS_Document*>(m_pJSObject); |
| 1938 } | 1938 } |
| OLD | NEW |