diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-12-08 11:31:59 -0800 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-12-08 11:31:59 -0800 |
commit | 4d6fa834ccc7fb8a7ada0db2235c866e20cd4b40 (patch) | |
tree | db3dad26340b9cba3df85ef8a53c72e109f508b5 /fpdfsdk | |
parent | 77221d4b4288ada80e34464ef4a402ea232b402b (diff) | |
download | pdfium-4d6fa834ccc7fb8a7ada0db2235c866e20cd4b40.tar.xz |
Fix non-xfa build on xfa branch.
Broken at 487d1a9/a0217b6.
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1504413002 .
Diffstat (limited to 'fpdfsdk')
-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; } |