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 1195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1206 } | 1206 } |
1207 | 1207 |
1208 FX_BOOL Document::documentFileName(IFXJS_Context* cc, CJS_PropValue& vp, CFX_Wid
eString& sError) | 1208 FX_BOOL Document::documentFileName(IFXJS_Context* cc, CJS_PropValue& vp, CFX_Wid
eString& sError) |
1209 { | 1209 { |
1210 if (vp.IsSetting()) { | 1210 if (vp.IsSetting()) { |
1211 CJS_Context* pContext = static_cast<CJS_Context*>(cc); | 1211 CJS_Context* pContext = static_cast<CJS_Context*>(cc); |
1212 sError = JSGetStringFromID(pContext, IDS_STRING_JSREADONLY); | 1212 sError = JSGetStringFromID(pContext, IDS_STRING_JSREADONLY); |
1213 return FALSE; | 1213 return FALSE; |
1214 } | 1214 } |
1215 CFX_WideString wsFilePath = m_pDocument->GetPath(); | 1215 CFX_WideString wsFilePath = m_pDocument->GetPath(); |
1216 » FX_INT32 i = wsFilePath.GetLength() - 1; | 1216 » int32_t i = wsFilePath.GetLength() - 1; |
1217 for ( ; i >= 0; i-- ) | 1217 for ( ; i >= 0; i-- ) |
1218 { | 1218 { |
1219 if ( wsFilePath.GetAt( i ) == L'\\' || wsFilePath.GetAt( i ) ==
L'/' ) | 1219 if ( wsFilePath.GetAt( i ) == L'\\' || wsFilePath.GetAt( i ) ==
L'/' ) |
1220 break; | 1220 break; |
1221 } | 1221 } |
1222 if ( i >= 0 && i < wsFilePath.GetLength() - 1 ) | 1222 if ( i >= 0 && i < wsFilePath.GetLength() - 1 ) |
1223 { | 1223 { |
1224 vp << ( wsFilePath.GetBuffer( wsFilePath.GetLength() ) + i + 1 )
; | 1224 vp << ( wsFilePath.GetBuffer( wsFilePath.GetLength() ) + i + 1 )
; |
1225 }else{ | 1225 }else{ |
1226 vp << L""; | 1226 vp << L""; |
(...skipping 734 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1961 { | 1961 { |
1962 m_DelayData.RemoveAt(DelArray[j]); | 1962 m_DelayData.RemoveAt(DelArray[j]); |
1963 } | 1963 } |
1964 } | 1964 } |
1965 | 1965 |
1966 CJS_Document* Document::GetCJSDoc() const | 1966 CJS_Document* Document::GetCJSDoc() const |
1967 { | 1967 { |
1968 return static_cast<CJS_Document*>(m_pJSObject); | 1968 return static_cast<CJS_Document*>(m_pJSObject); |
1969 } | 1969 } |
1970 | 1970 |
OLD | NEW |