| 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 "app.h" | 7 #include "app.h" |
| 8 | 8 |
| 9 #include "Document.h" | 9 #include "Document.h" |
| 10 #include "JS_Context.h" | 10 #include "JS_Context.h" |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 vp << JS_STR_PLATFORM; | 221 vp << JS_STR_PLATFORM; |
| 222 return TRUE; | 222 return TRUE; |
| 223 } | 223 } |
| 224 | 224 |
| 225 return FALSE; | 225 return FALSE; |
| 226 } | 226 } |
| 227 | 227 |
| 228 FX_BOOL app::language(IJS_Context* cc, | 228 FX_BOOL app::language(IJS_Context* cc, |
| 229 CJS_PropValue& vp, | 229 CJS_PropValue& vp, |
| 230 CFX_WideString& sError) { | 230 CFX_WideString& sError) { |
| 231 if (vp.IsGetting()) { | 231 if (!vp.IsGetting()) |
| 232 return FALSE; |
| 233 CPDFDoc_Environment* pEnv = |
| 234 static_cast<CJS_Context*>(cc)->GetJSRuntime()->GetReaderApp(); |
| 235 if (!pEnv) |
| 236 return FALSE; |
| 237 CFX_WideString language = pEnv->FFI_GetLanguage(); |
| 238 if (language.IsEmpty()) |
| 232 vp << JS_STR_LANGUANGE; | 239 vp << JS_STR_LANGUANGE; |
| 233 return TRUE; | 240 else |
| 234 } | 241 vp << language; |
| 235 | 242 |
| 236 return FALSE; | 243 return TRUE; |
| 237 } | 244 } |
| 238 | 245 |
| 239 // creates a new fdf object that contains no data | 246 // creates a new fdf object that contains no data |
| 240 // comment: need reader support | 247 // comment: need reader support |
| 241 // note: | 248 // note: |
| 242 // CFDF_Document * CPDFDoc_Environment::NewFDF(); | 249 // CFDF_Document * CPDFDoc_Environment::NewFDF(); |
| 243 FX_BOOL app::newFDF(IJS_Context* cc, | 250 FX_BOOL app::newFDF(IJS_Context* cc, |
| 244 const std::vector<CJS_Value>& params, | 251 const std::vector<CJS_Value>& params, |
| 245 CJS_Value& vRet, | 252 CJS_Value& vRet, |
| 246 CFX_WideString& sError) { | 253 CFX_WideString& sError) { |
| (...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 814 FX_BOOL app::media(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { | 821 FX_BOOL app::media(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { |
| 815 return FALSE; | 822 return FALSE; |
| 816 } | 823 } |
| 817 | 824 |
| 818 FX_BOOL app::execDialog(IJS_Context* cc, | 825 FX_BOOL app::execDialog(IJS_Context* cc, |
| 819 const std::vector<CJS_Value>& params, | 826 const std::vector<CJS_Value>& params, |
| 820 CJS_Value& vRet, | 827 CJS_Value& vRet, |
| 821 CFX_WideString& sError) { | 828 CFX_WideString& sError) { |
| 822 return TRUE; | 829 return TRUE; |
| 823 } | 830 } |
| OLD | NEW |