diff options
Diffstat (limited to 'fpdfsdk/src/javascript/app.cpp')
-rw-r--r-- | fpdfsdk/src/javascript/app.cpp | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/fpdfsdk/src/javascript/app.cpp b/fpdfsdk/src/javascript/app.cpp index f195ae70bb..cb1cc9b592 100644 --- a/fpdfsdk/src/javascript/app.cpp +++ b/fpdfsdk/src/javascript/app.cpp @@ -199,7 +199,6 @@ FX_BOOL app::viewerVersion(IJS_Context* cc, CFX_WideString& sError) { if (!vp.IsGetting()) return FALSE; - #ifdef PDF_ENABLE_XFA CJS_Context* pContext = (CJS_Context*)cc; CPDFSDK_Document* pCurDoc = pContext->GetReaderDocument(); @@ -209,7 +208,6 @@ FX_BOOL app::viewerVersion(IJS_Context* cc, return TRUE; } #endif // PDF_ENABLE_XFA - vp << JS_NUM_VIEWERVERSION; return TRUE; } @@ -219,15 +217,18 @@ FX_BOOL app::platform(IJS_Context* cc, CFX_WideString& sError) { if (!vp.IsGetting()) return FALSE; +#ifdef PDF_ENABLE_XFA CPDFDoc_Environment* pEnv = static_cast<CJS_Context*>(cc)->GetJSRuntime()->GetReaderApp(); if (!pEnv) return FALSE; CFX_WideString platfrom = pEnv->FFI_GetPlatform(); - if (platfrom.IsEmpty()) - vp << JS_STR_PLATFORM; - else + if (!platfrom.IsEmpty()) { vp << platfrom; + return TRUE; + } +#endif + vp << JS_STR_PLATFORM; return TRUE; } @@ -236,16 +237,18 @@ FX_BOOL app::language(IJS_Context* cc, CFX_WideString& sError) { if (!vp.IsGetting()) return FALSE; +#ifdef PDF_ENABLE_XFA 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; - else + if (!language.IsEmpty()) { vp << language; - + return TRUE; + } +#endif + vp << JS_STR_LANGUANGE; return TRUE; } |