From 4d6fa834ccc7fb8a7ada0db2235c866e20cd4b40 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Tue, 8 Dec 2015 11:31:59 -0800 Subject: Fix non-xfa build on xfa branch. Broken at 487d1a9/a0217b6. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1504413002 . --- fpdfsdk/src/javascript/app.cpp | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'fpdfsdk/src/javascript') 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(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(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; } -- cgit v1.2.3