| 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 1205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1216 } | 1216 } |
| 1217 | 1217 |
| 1218 FX_BOOL Document::documentFileName(IFXJS_Context* cc, CJS_PropValue& vp, CFX_Wid
eString& sError) | 1218 FX_BOOL Document::documentFileName(IFXJS_Context* cc, CJS_PropValue& vp, CFX_Wid
eString& sError) |
| 1219 { | 1219 { |
| 1220 if (vp.IsSetting()) { | 1220 if (vp.IsSetting()) { |
| 1221 CJS_Context* pContext = static_cast<CJS_Context*>(cc); | 1221 CJS_Context* pContext = static_cast<CJS_Context*>(cc); |
| 1222 sError = JSGetStringFromID(pContext, IDS_STRING_JSREADONLY); | 1222 sError = JSGetStringFromID(pContext, IDS_STRING_JSREADONLY); |
| 1223 return FALSE; | 1223 return FALSE; |
| 1224 } | 1224 } |
| 1225 CFX_WideString wsFilePath = m_pDocument->GetPath(); | 1225 CFX_WideString wsFilePath = m_pDocument->GetPath(); |
| 1226 » FX_INT32 i = wsFilePath.GetLength() - 1; | 1226 » int32_t i = wsFilePath.GetLength() - 1; |
| 1227 for ( ; i >= 0; i-- ) | 1227 for ( ; i >= 0; i-- ) |
| 1228 { | 1228 { |
| 1229 if ( wsFilePath.GetAt( i ) == L'\\' || wsFilePath.GetAt( i ) ==
L'/' ) | 1229 if ( wsFilePath.GetAt( i ) == L'\\' || wsFilePath.GetAt( i ) ==
L'/' ) |
| 1230 break; | 1230 break; |
| 1231 } | 1231 } |
| 1232 if ( i >= 0 && i < wsFilePath.GetLength() - 1 ) | 1232 if ( i >= 0 && i < wsFilePath.GetLength() - 1 ) |
| 1233 { | 1233 { |
| 1234 vp << ( wsFilePath.GetBuffer( wsFilePath.GetLength() ) + i + 1 )
; | 1234 vp << ( wsFilePath.GetBuffer( wsFilePath.GetLength() ) + i + 1 )
; |
| 1235 }else{ | 1235 }else{ |
| 1236 vp << L""; | 1236 vp << L""; |
| (...skipping 742 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1979 { | 1979 { |
| 1980 m_DelayData.RemoveAt(DelArray[j]); | 1980 m_DelayData.RemoveAt(DelArray[j]); |
| 1981 } | 1981 } |
| 1982 } | 1982 } |
| 1983 | 1983 |
| 1984 CJS_Document* Document::GetCJSDoc() const | 1984 CJS_Document* Document::GetCJSDoc() const |
| 1985 { | 1985 { |
| 1986 return static_cast<CJS_Document*>(m_pJSObject); | 1986 return static_cast<CJS_Document*>(m_pJSObject); |
| 1987 } | 1987 } |
| 1988 | 1988 |
| OLD | NEW |