Chromium Code Reviews| 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 CJS_Context* pContext = static_cast<CJS_Context*>(cc); | |
|
Tom Sepez
2015/11/30 17:08:39
Can these actually be null? we don't check it in o
| |
| 234 if (!pContext) | |
| 235 return FALSE; | |
| 236 CJS_Runtime* pRuntime = pContext->GetJSRuntime(); | |
| 237 if (!pRuntime) | |
| 238 return FALSE; | |
| 239 CPDFDoc_Environment* pEnv = pRuntime->GetReaderApp(); | |
| 240 if (!pEnv) | |
| 241 return FALSE; | |
| 242 CFX_WideString language = pEnv->FFI_GetLanguage(); | |
| 243 if (language.IsEmpty()) | |
| 232 vp << JS_STR_LANGUANGE; | 244 vp << JS_STR_LANGUANGE; |
| 233 return TRUE; | 245 else |
| 234 } | 246 vp << language; |
| 235 | 247 |
| 236 return FALSE; | 248 return TRUE; |
| 237 } | 249 } |
| 238 | 250 |
| 239 // creates a new fdf object that contains no data | 251 // creates a new fdf object that contains no data |
| 240 // comment: need reader support | 252 // comment: need reader support |
| 241 // note: | 253 // note: |
| 242 // CFDF_Document * CPDFDoc_Environment::NewFDF(); | 254 // CFDF_Document * CPDFDoc_Environment::NewFDF(); |
| 243 FX_BOOL app::newFDF(IJS_Context* cc, | 255 FX_BOOL app::newFDF(IJS_Context* cc, |
| 244 const std::vector<CJS_Value>& params, | 256 const std::vector<CJS_Value>& params, |
| 245 CJS_Value& vRet, | 257 CJS_Value& vRet, |
| 246 CFX_WideString& sError) { | 258 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) { | 826 FX_BOOL app::media(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { |
| 815 return FALSE; | 827 return FALSE; |
| 816 } | 828 } |
| 817 | 829 |
| 818 FX_BOOL app::execDialog(IJS_Context* cc, | 830 FX_BOOL app::execDialog(IJS_Context* cc, |
| 819 const std::vector<CJS_Value>& params, | 831 const std::vector<CJS_Value>& params, |
| 820 CJS_Value& vRet, | 832 CJS_Value& vRet, |
| 821 CFX_WideString& sError) { | 833 CFX_WideString& sError) { |
| 822 return TRUE; | 834 return TRUE; |
| 823 } | 835 } |
| OLD | NEW |