diff options
-rw-r--r-- | fpdfsdk/src/javascript/app.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/fpdfsdk/src/javascript/app.cpp b/fpdfsdk/src/javascript/app.cpp index 009e03b002..ab4c777d2b 100644 --- a/fpdfsdk/src/javascript/app.cpp +++ b/fpdfsdk/src/javascript/app.cpp @@ -228,12 +228,19 @@ FX_BOOL app::platform(IJS_Context* cc, FX_BOOL app::language(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { - if (vp.IsGetting()) { + if (!vp.IsGetting()) + return FALSE; + CPDFDoc_Environment* pEnv = + static_cast<CJS_Context*>(cc)->GetJSRuntime()->GetReaderApp(); + if (!pEnv) + return FALSE; + CFX_WideString language = pEnv->FFI_GetLanguage(); + if (language.IsEmpty()) vp << JS_STR_LANGUANGE; - return TRUE; - } + else + vp << language; - return FALSE; + return TRUE; } // creates a new fdf object that contains no data |