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

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

Issue 1482253002: Fix an issue that no response from the call back function of FFI_GetLanguage() (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 d18e0322abff79c17035657eb85f9a354cc11913..869a478387cda63868fa6e7dc15302fb82ab9b27 100644
--- a/fpdfsdk/src/javascript/app.cpp
+++ b/fpdfsdk/src/javascript/app.cpp
@@ -228,12 +228,19 @@ FX_BOOL app::platform(IJS_Context* cc,
FX_BOOL app::language(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 language = pEnv->FFI_GetLanguage();
+ if (language.IsEmpty())
vp << JS_STR_LANGUANGE;
- return TRUE;
- }
+ else
+ vp << language;
- return FALSE;
+ return TRUE;
}
// creates a new fdf object that contains no data
« 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