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

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

Issue 1486583002: Fix the issue that no response from the call back function of FFI_GetPlatform() (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: 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 009e03b0029d064dff5eccfd303f7314141b5dd7..9250c2919a1eb97c4580d43437762c4341370f30 100644
--- a/fpdfsdk/src/javascript/app.cpp
+++ b/fpdfsdk/src/javascript/app.cpp
@@ -217,12 +217,18 @@ FX_BOOL app::viewerVersion(IJS_Context* cc,
FX_BOOL app::platform(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 platfrom = pEnv->FFI_GetPlatform();
+ if (platfrom.IsEmpty())
vp << JS_STR_PLATFORM;
- return TRUE;
- }
-
- return FALSE;
+ else
+ vp << platfrom;
+ return TRUE;
}
FX_BOOL app::language(IJS_Context* cc,
« 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