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

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

Issue 1056583002: Merge to XFA: doc.external - Check direction of property access before blindly getting. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 years, 9 months 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/Document.cpp
diff --git a/fpdfsdk/src/javascript/Document.cpp b/fpdfsdk/src/javascript/Document.cpp
index a73ff8e237489473d4735eb8e2021f10c1db0570..1df4453e427f98ea8f8dafe9868fd05a0855a670 100644
--- a/fpdfsdk/src/javascript/Document.cpp
+++ b/fpdfsdk/src/javascript/Document.cpp
@@ -1139,7 +1139,9 @@ FX_BOOL Document::numPages(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString&
FX_BOOL Document::external(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
//In Chrome case,should always return true.
- vp << TRUE;
+ if (vp.IsGetting()) {
+ vp << TRUE;
+ }
return TRUE;
}
@@ -1169,13 +1171,12 @@ FX_BOOL Document::baseURL(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString&
if (vp.IsGetting())
{
vp << m_cwBaseURL;
- return TRUE;
}
else
{
vp >> m_cwBaseURL;
- return TRUE;
}
+ return TRUE;
}
FX_BOOL Document::calculate(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
@@ -1302,11 +1303,6 @@ FX_BOOL Document::addLink(IFXJS_Context* cc, const CJS_Parameters& params, CJS_V
FX_BOOL Document::closeDoc(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
-
-
-
-
-
return TRUE;
}
@@ -1315,7 +1311,6 @@ FX_BOOL Document::getPageBox(IFXJS_Context* cc, const CJS_Parameters& params, CJ
return TRUE;
}
-
FX_BOOL Document::getAnnot(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
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