Fix two issues shown by bug 489995
[pdfium.git] / fpdfsdk / src / javascript / Icon.cpp
index 418fcd5..0e96a05 100644 (file)
@@ -1,67 +1,58 @@
-// Copyright 2014 PDFium Authors. All rights reserved.\r
-// Use of this source code is governed by a BSD-style license that can be\r
-// found in the LICENSE file.\r
\r
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com\r
-\r
-#include "../../include/javascript/JavaScript.h"\r
-#include "../../include/javascript/IJavaScript.h"\r
-#include "../../include/javascript/JS_Define.h"\r
-#include "../../include/javascript/JS_Object.h"\r
-#include "../../include/javascript/JS_Value.h"\r
-#include "../../include/javascript/Icon.h"\r
-\r
-/* ---------------------- Icon ---------------------- */\r
-\r
-BEGIN_JS_STATIC_CONST(CJS_Icon)\r
-END_JS_STATIC_CONST()\r
-\r
-BEGIN_JS_STATIC_PROP(CJS_Icon)\r
-       JS_STATIC_PROP_ENTRY(name)\r
-END_JS_STATIC_PROP()\r
-\r
-BEGIN_JS_STATIC_METHOD(CJS_Icon) \r
-END_JS_STATIC_METHOD()\r
-\r
-IMPLEMENT_JS_CLASS(CJS_Icon,Icon)\r
-\r
-Icon::Icon(CJS_Object* pJSObject) : CJS_EmbedObj(pJSObject),\r
-       m_pIconStream(NULL),\r
-       m_swIconName(L"")\r
-{\r
-}\r
-\r
-Icon::~Icon()\r
-{\r
-\r
-}\r
-\r
-void Icon::SetStream(CPDF_Stream* pIconStream)\r
-{\r
-       if(pIconStream)\r
-               m_pIconStream = pIconStream;\r
-}\r
-\r
-CPDF_Stream* Icon::GetStream()\r
-{\r
-       return m_pIconStream;\r
-}\r
-\r
-void Icon::SetIconName(CFX_WideString name)\r
-{\r
-       m_swIconName = name;\r
-}\r
-\r
-CFX_WideString Icon::GetIconName()\r
-{\r
-       return m_swIconName;\r
-}\r
-\r
-FX_BOOL Icon::name(OBJ_PROP_PARAMS)\r
-{\r
-       if(!vp.IsGetting())return FALSE;\r
-\r
-       vp << m_swIconName;\r
-       return TRUE;\r
-}\r
-\r
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#include "../../include/javascript/JavaScript.h"
+#include "../../include/javascript/IJavaScript.h"
+#include "../../include/javascript/JS_Define.h"
+#include "../../include/javascript/JS_Object.h"
+#include "../../include/javascript/JS_Value.h"
+#include "../../include/javascript/Icon.h"
+
+/* ---------------------- Icon ---------------------- */
+
+BEGIN_JS_STATIC_CONST(CJS_Icon)
+END_JS_STATIC_CONST()
+
+BEGIN_JS_STATIC_PROP(CJS_Icon)
+JS_STATIC_PROP_ENTRY(name)
+END_JS_STATIC_PROP()
+
+BEGIN_JS_STATIC_METHOD(CJS_Icon)
+END_JS_STATIC_METHOD()
+
+IMPLEMENT_JS_CLASS(CJS_Icon, Icon)
+
+Icon::Icon(CJS_Object* pJSObject)
+    : CJS_EmbedObj(pJSObject), m_pIconStream(NULL), m_swIconName(L"") {}
+
+Icon::~Icon() {}
+
+void Icon::SetStream(CPDF_Stream* pIconStream) {
+  if (pIconStream)
+    m_pIconStream = pIconStream;
+}
+
+CPDF_Stream* Icon::GetStream() {
+  return m_pIconStream;
+}
+
+void Icon::SetIconName(CFX_WideString name) {
+  m_swIconName = name;
+}
+
+CFX_WideString Icon::GetIconName() {
+  return m_swIconName;
+}
+
+FX_BOOL Icon::name(IFXJS_Context* cc,
+                   CJS_PropValue& vp,
+                   CFX_WideString& sError) {
+  if (!vp.IsGetting())
+    return FALSE;
+
+  vp << m_swIconName;
+  return TRUE;
+}