summaryrefslogtreecommitdiff
blob: 1f515f9ef3cb5b090ab92363413b721f7e635db8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
diff -udBbr kdegraphics-3.2.3/work/kdegraphics-3.2.3/ksvg/ecma/ksvg_bridge.h kdegraphics-3.2.3-fix1/work/kdegraphics-3.2.3/ksvg/ecma/ksvg_bridge.h
--- kdegraphics-3.2.3/work/kdegraphics-3.2.3/ksvg/ecma/ksvg_bridge.h	2003-10-26 13:52:36.000000000 +0300
+++ kdegraphics-3.2.3-fix1/work/kdegraphics-3.2.3/ksvg/ecma/ksvg_bridge.h	2004-04-22 00:12:13.212404080 +0400
@@ -90,7 +90,7 @@
 //			kdDebug(26004) << "KSVGBridge::put(), " << propertyName.qstring() << " Name: " << classInfo()->className << " Object: " << m_impl << endl;
 
 		// Try to see if we know this property (and need to take special action)
-		if(m_impl->put(exec, propertyName, value, attr))
+		if(this->m_impl->put(exec, propertyName, value, attr))
 			return;
 
 		// We don't -> set property in ObjectImp.
diff -udBbr kdegraphics-3.2.3/work/kdegraphics-3.2.3/ksvg/ecma/ksvg_lookup.h kdegraphics-3.2.3-fix1/work/kdegraphics-3.2.3/ksvg/ecma/ksvg_lookup.h
--- kdegraphics-3.2.3/work/kdegraphics-3.2.3/ksvg/ecma/ksvg_lookup.h	2003-08-17 15:49:23.000000000 +0400
+++ kdegraphics-3.2.3-fix1/work/kdegraphics-3.2.3/ksvg/ecma/ksvg_lookup.h	2004-04-21 23:34:50.954279128 +0400
@@ -21,10 +21,13 @@
 #ifndef KSVG_LOOKUP_H
 #define KSVG_LOOKUP_H
 
+#include <kdebug.h>
+
 #include <kjs/object.h>
 #include <kjs/lookup.h>
 #include <kjs/interpreter.h> // for ExecState
 
+//#include "ksvg_scriptinterpreter.h"
 class KSVGScriptInterpreter;
 
 #define KSVG_GET_COMMON \
@@ -188,6 +191,7 @@
 	 * The "this" class must implement putValueProperty.
 	 * If it returns false, put() will return false, and KSVGRequest will set a dynamic property in ObjectImp
 	 */
+/*
 	template <class ThisImp>
 	inline bool lookupPut(KJS::ExecState *exec,
 						  const KJS::Identifier &propertyName,
@@ -218,6 +222,7 @@
 			return true;
 		}
 	}
+*/ /* moved to ksvg_scriptinterpreter.h */
 }
 
 // Same as kjs' DEFINE_PROTOTYPE, but with a pointer to the hashtable too, and no ClassName here
diff -udBbr kdegraphics-3.2.3/work/kdegraphics-3.2.3/ksvg/ecma/ksvg_scriptinterpreter.h kdegraphics-3.2.3-fix1/work/kdegraphics-3.2.3/ksvg/ecma/ksvg_scriptinterpreter.h
--- kdegraphics-3.2.3/work/kdegraphics-3.2.3/ksvg/ecma/ksvg_scriptinterpreter.h	2003-05-10 13:32:50.000000000 +0400
+++ kdegraphics-3.2.3-fix1/work/kdegraphics-3.2.3/ksvg/ecma/ksvg_scriptinterpreter.h	2004-04-21 23:40:36.693718744 +0400
@@ -68,6 +68,47 @@
 	QPtrDict<KJS::ObjectImp> m_domObjects;
 };
 
+namespace KSVG
+{
+
+    /**
+	 * This one is for "put".
+	 * Lookup hash entry for property to be set, and set the value.
+	 * The "this" class must implement putValueProperty.
+	 * If it returns false, put() will return false, and KSVGRequest will set a dynamic property in ObjectImp
+	 */
+	template <class ThisImp>
+	inline bool lookupPut(KJS::ExecState *exec,
+						  const KJS::Identifier &propertyName,
+						  const KJS::Value &value,
+						  int attr,
+						  const KJS::HashTable *table,
+						  ThisImp *thisObj)
+    {
+		const KJS::HashEntry *entry = KJS::Lookup::findEntry(table, propertyName);
+
+		if(!entry) // not found, forward to parents
+			return thisObj->putInParents(exec, propertyName, value, attr);
+		else if(entry->attr & KJS::Function) // Function: put as override property
+			return false;
+		else if(entry->attr & KJS::ReadOnly && !(attr & KJS::Internal)) // readonly! Can't put!
+		{
+#ifdef KJS_VERBOSE
+			kdWarning(26004) <<" Attempt to change value of readonly property '" << propertyName.qstring() << "'" << endl;
+#endif
+			return true; // "we did it" -> don't put override property
+		}
+		else
+		{
+			if(static_cast<KSVGScriptInterpreter *>(exec->interpreter())->attributeSetMode())
+				thisObj->m_attrFlags |= (1 << entry->value);
+
+			thisObj->putValueProperty(exec, entry->value, value, attr);
+			return true;
+		}
+	}
+}
+
 // Lookup or create JS object around an existing "DOM Object"
 template<class DOMObj, class KJSDOMObj>
 inline KJS::Value cacheDOMObject(KJS::ExecState *exec, DOMObj *domObj)
@@ -100,7 +141,7 @@
 	{
 		ClassCtor* ctor = new ClassCtor(exec); // create the ClassCtor instance
 		KJS::Object newObject(new KSVGBridge<ClassCtor>(exec, ctor)); // create the bridge around it
-		exec->interpreter()->globalObject().put(exec, propertyName, newObject, Internal);
+		exec->interpreter()->globalObject().put(exec, propertyName, newObject, KJS::Internal);
 		return newObject;
 	}
 }
diff -udBbr kdegraphics-3.2.3/work/kdegraphics-3.2.3/ksvg/impl/SVGHelperImpl.h kdegraphics-3.2.3-fix1/work/kdegraphics-3.2.3/ksvg/impl/SVGHelperImpl.h
--- kdegraphics-3.2.3/work/kdegraphics-3.2.3/ksvg/impl/SVGHelperImpl.h	2003-08-28 00:08:25.000000000 +0400
+++ kdegraphics-3.2.3-fix1/work/kdegraphics-3.2.3/ksvg/impl/SVGHelperImpl.h	2004-04-22 00:04:58.029561928 +0400
@@ -23,6 +23,7 @@
 
 #include <dom/dom_element.h>
 
+#include "SVGElementImpl.h"
 #include "SVGLengthImpl.h"
 
 #include "ksvg_lookup.h"
@@ -56,7 +57,7 @@
 		{
 			T *cast = dynamic_cast<T *>(element->ownerDoc()->getElementFromHandle(node.handle()));
 			if(cast)
-				cast->putValueProperty(element->ownerDoc()->ecmaEngine()->globalExec(), token, KJS::String(value), Internal);
+				cast->putValueProperty(element->ownerDoc()->ecmaEngine()->globalExec(), token, KJS::String(value), KJS::Internal);
 		}
 	}
 
diff -udBbr kdegraphics-3.2.3/work/kdegraphics-3.2.3/ksvg/impl/SVGList.h kdegraphics-3.2.3-fix1/work/kdegraphics-3.2.3/ksvg/impl/SVGList.h
--- kdegraphics-3.2.3/work/kdegraphics-3.2.3/ksvg/impl/SVGList.h	2004-01-17 15:52:40.000000000 +0300
+++ kdegraphics-3.2.3-fix1/work/kdegraphics-3.2.3/ksvg/impl/SVGList.h	2004-04-21 23:41:08.040953240 +0400
@@ -48,7 +48,7 @@
 {
 public:
 	SVGList() { m_impl.setAutoDelete(false); }
-	SVGList(const SVGList &) { *this = other; }
+	SVGList(const SVGList &other) { *this = other; }
 	~SVGList() { clear(); }
 
 	SVGList<T> &operator=(const SVGList<T> &other)
diff -udBbr kdegraphics-3.2.3/work/kdegraphics-3.2.3/ksvg/plugin/backends/libart/LibartCanvas.cpp kdegraphics-3.2.3-fix1/work/kdegraphics-3.2.3/ksvg/plugin/backends/libart/LibartCanvas.cpp
--- kdegraphics-3.2.3/work/kdegraphics-3.2.3/ksvg/plugin/backends/libart/LibartCanvas.cpp	2003-11-30 12:46:17.000000000 +0300
+++ kdegraphics-3.2.3-fix1/work/kdegraphics-3.2.3/ksvg/plugin/backends/libart/LibartCanvas.cpp	2004-04-22 00:15:04.624345504 +0400
@@ -176,7 +176,7 @@
 
 CanvasPaintServer *LibartCanvas::createPaintServer(SVGElementImpl *pserver)
 {
-	LibartPaintServer *result;
+	LibartPaintServer *result = NULL;
 	if(dynamic_cast<SVGLinearGradientElementImpl *>(pserver))
 		result = new LibartLinearGradient(dynamic_cast<SVGLinearGradientElementImpl *>(pserver));
 	else if(dynamic_cast<SVGRadialGradientElementImpl *>(pserver))
diff -udBbr kdegraphics-3.2.3/work/kdegraphics-3.2.3/ksvg/core/CanvasFactory.cpp kdegraphics-3.2.3-fix1/work/kdegraphics-3.2.3/ksvg/core/CanvasFactory.cpp
--- kdegraphics-3.2.3/work/kdegraphics-3.2.3/ksvg/core/CanvasFactory.cpp	2003-11-30 12:46:12.000000000 +0300
+++ kdegraphics-3.2.3-fix1/work/kdegraphics-3.2.3/ksvg/core/CanvasFactory.cpp	2004-04-22 00:48:56.135508864 +0400
@@ -26,6 +26,7 @@
 
 #include "KSVGCanvas.h"
 #include "CanvasFactory.h"
+#include "CanvasItem.h"
 
 using namespace KSVG;