Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1240)

Unified Diff: fpdfsdk/src/javascript/app.cpp

Issue 1504413002: Fix non-xfa build on xfa branch. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: whitespace Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/src/javascript/app.cpp
diff --git a/fpdfsdk/src/javascript/app.cpp b/fpdfsdk/src/javascript/app.cpp
index f195ae70bb9dc69178d0e3d65d8870dc6def47b7..cb1cc9b59258fc61630f20e5a4d2149cee34875f 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;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698