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

Unified Diff: fpdfsdk/javascript/Document.cpp

Issue 2219183002: Add support to Document::URL property getter. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Add support to Document::URL property getter. Created 4 years, 4 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 | « fpdfsdk/javascript/Document.h ('k') | testing/resources/javascript/document_props.in » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/javascript/Document.cpp
diff --git a/fpdfsdk/javascript/Document.cpp b/fpdfsdk/javascript/Document.cpp
index 9c680de906471063a4a7e7ddf9250cb38022d985..161a5d09e97d31b522e8c3fca38b86a86d9f6da3 100644
--- a/fpdfsdk/javascript/Document.cpp
+++ b/fpdfsdk/javascript/Document.cpp
@@ -91,6 +91,7 @@ JS_STATIC_PROP_ENTRY(path)
JS_STATIC_PROP_ENTRY(producer)
JS_STATIC_PROP_ENTRY(subject)
JS_STATIC_PROP_ENTRY(title)
+JS_STATIC_PROP_ENTRY(URL)
JS_STATIC_PROP_ENTRY(zoom)
JS_STATIC_PROP_ENTRY(zoomType)
END_JS_STATIC_PROP()
@@ -904,6 +905,18 @@ FX_BOOL Document::mouseY(IJS_Context* cc,
return TRUE;
}
+FX_BOOL Document::URL(IJS_Context* cc,
+ CJS_PropValue& vp,
+ CFX_WideString& sError) {
+ if (vp.IsSetting()) {
+ CJS_Context* pContext = static_cast<CJS_Context*>(cc);
+ sError = JSGetStringFromID(pContext, IDS_STRING_JSREADONLY);
+ return FALSE;
+ }
+ vp << m_pDocument->GetPath();
+ return TRUE;
+}
+
FX_BOOL Document::baseURL(IJS_Context* cc,
CJS_PropValue& vp,
CFX_WideString& sError) {
« no previous file with comments | « fpdfsdk/javascript/Document.h ('k') | testing/resources/javascript/document_props.in » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698