Author: jackson
Date: 2008-02-19 12:03:53 -0500 (Tue, 19 Feb 2008)
New Revision: 96165

Modified:
   trunk/moon/src/ChangeLog
   trunk/moon/src/xaml.cpp
Log:

        * xaml.cpp: Parser error if we can't find the owner type when
        setting properties.



Modified: trunk/moon/src/ChangeLog
===================================================================
--- trunk/moon/src/ChangeLog    2008-02-19 16:56:56 UTC (rev 96164)
+++ trunk/moon/src/ChangeLog    2008-02-19 17:03:53 UTC (rev 96165)
@@ -1,3 +1,8 @@
+2008-02-19  Jackson Harper  <[EMAIL PROTECTED]>
+
+       * xaml.cpp: Parser error if we can't find the owner type when
+       setting properties.
+
 2008-02-19  Sebastien Pouliot  <[EMAIL PROTECTED]> 
 
        * geometry.cpp|h: #if out GetOriginPoint which calls moon_get_origin

Modified: trunk/moon/src/xaml.cpp
===================================================================
--- trunk/moon/src/xaml.cpp     2008-02-19 16:56:56 UTC (rev 96164)
+++ trunk/moon/src/xaml.cpp     2008-02-19 17:03:53 UTC (rev 96165)
@@ -855,8 +855,12 @@
                if (!inst->item)
                        return;
 
-               if (p->current_element && p->current_element->info)
+               if (p->current_element && p->current_element->info) {
                        p->current_element->info->add_child (p, 
p->current_element, inst);
+                       if (p->error_args)
+                               return;
+               }
+                               
 
        } else {
                bool property = false;
@@ -1397,7 +1401,7 @@
        XamlParserInfo *parser_info = NULL;
        DependencyObject *res = NULL;
        char *start = (char*)xaml;
-       
+
        if (!p) {
 #ifdef DEBUG_XAML
                printf ("can not create parser\n");
@@ -2756,6 +2760,13 @@
        if (parent->element_type == XamlElementInstance::PROPERTY) {
                char **prop_name = g_strsplit (parent->element_name, ".", -1);
                Type *owner = Type::Find (prop_name [0]);
+
+               if (!owner) {
+                       g_strfreev (prop_name);
+                       parser_error (p, parent->element_name, NULL, 2007, 
g_strdup_printf ("Unknown element: %s.", parent->element_name));
+                       return;
+               }
+
                DependencyProperty *dep = 
DependencyObject::GetDependencyProperty (owner->type, prop_name [1]);
 
                g_strfreev (prop_name);

_______________________________________________
Mono-patches maillist  -  Mono-patches@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to