Author: spouliot
Date: 2007-06-07 14:45:26 -0400 (Thu, 07 Jun 2007)
New Revision: 78880
Modified:
trunk/moon/src/ChangeLog
trunk/moon/src/brush.cpp
trunk/moon/src/geometry.cpp
trunk/moon/src/shape.cpp
Log:
2007-06-07 Sebastien Pouliot <[EMAIL PROTECTED]>
* brush.cpp, geometry.cpp, shape.cpp: Protect against NULL properties.
Modified: trunk/moon/src/ChangeLog
===================================================================
--- trunk/moon/src/ChangeLog 2007-06-07 18:44:03 UTC (rev 78879)
+++ trunk/moon/src/ChangeLog 2007-06-07 18:45:26 UTC (rev 78880)
@@ -1,3 +1,7 @@
+2007-06-07 Sebastien Pouliot <[EMAIL PROTECTED]>
+
+ * brush.cpp, geometry.cpp, shape.cpp: Protect against NULL properties.
+
2007-06-07 Sebastien Pouliot <[EMAIL PROTECTED]>
* geometry.cpp: #if-out transforms, it crash the xaml samples
Modified: trunk/moon/src/brush.cpp
===================================================================
--- trunk/moon/src/brush.cpp 2007-06-07 18:44:03 UTC (rev 78879)
+++ trunk/moon/src/brush.cpp 2007-06-07 18:45:26 UTC (rev 78880)
@@ -45,7 +45,8 @@
TransformGroup*
brush_get_relative_transform (Brush *brush)
{
- return (TransformGroup*) brush->GetValue
(Brush::RelativeTransformProperty)->u.dependency_object;
+ Value *value = brush->GetValue (Brush::RelativeTransformProperty);
+ return (TransformGroup*) (value ? value->u.dependency_object : NULL);
}
void
@@ -57,7 +58,8 @@
TransformGroup*
brush_get_transform (Brush *brush)
{
- return (TransformGroup*) brush->GetValue
(Brush::TransformProperty)->u.dependency_object;
+ Value *value = brush->GetValue (Brush::TransformProperty);
+ return (TransformGroup*) (value ? value->u.dependency_object : NULL);
}
void
Modified: trunk/moon/src/geometry.cpp
===================================================================
--- trunk/moon/src/geometry.cpp 2007-06-07 18:44:03 UTC (rev 78879)
+++ trunk/moon/src/geometry.cpp 2007-06-07 18:45:26 UTC (rev 78880)
@@ -42,7 +42,8 @@
Transform*
geometry_get_transform (Geometry *geometry)
{
- return (Transform*) geometry->GetValue
(Geometry::TransformProperty)->u.dependency_object;
+ Value *value = geometry->GetValue (Geometry::TransformProperty);
+ return (Transform*) (value ? value->u.dependency_object : NULL);
}
void
@@ -55,14 +56,12 @@
Geometry::Draw (Surface *s)
{
cairo_set_fill_rule (s->cairo, convert_fill_rule
(geometry_get_fill_rule (this)));
-#if false
Transform* transform = geometry_get_transform (this);
if (transform) {
cairo_matrix_t matrix;
transform->GetTransform (&matrix);
cairo_transform (s->cairo, &matrix);
}
-#endif
}
//
Modified: trunk/moon/src/shape.cpp
===================================================================
--- trunk/moon/src/shape.cpp 2007-06-07 18:44:03 UTC (rev 78879)
+++ trunk/moon/src/shape.cpp 2007-06-07 18:45:26 UTC (rev 78880)
@@ -643,7 +643,8 @@
Geometry*
path_get_data (Path *path)
{
- return (Geometry*) path->GetValue
(Path::DataProperty)->u.dependency_object;
+ Value *value = path->GetValue (Path::DataProperty);
+ return (Geometry*) (value ? value->u.dependency_object : NULL);
}
void
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches