Author: jbevain
Date: 2007-11-20 10:12:40 -0500 (Tue, 20 Nov 2007)
New Revision: 89980

Modified:
   trunk/moon/plugin/ChangeLog
   trunk/moon/plugin/plugin-class.cpp
Log:
2007-11-20  Jb Evain  <[EMAIL PROTECTED]>

        * plugin-class.cpp( MoonlightContentObject::Invoke):
                return null instead of undefined, like SL 1.0 does.



Modified: trunk/moon/plugin/ChangeLog
===================================================================
--- trunk/moon/plugin/ChangeLog 2007-11-20 15:02:03 UTC (rev 89979)
+++ trunk/moon/plugin/ChangeLog 2007-11-20 15:12:40 UTC (rev 89980)
@@ -1,5 +1,10 @@
 2007-11-20  Jb Evain  <[EMAIL PROTECTED]>
 
+       * plugin-class.cpp( MoonlightContentObject::Invoke):
+               return null instead of undefined, like SL 1.0 does.
+
+2007-11-20  Jb Evain  <[EMAIL PROTECTED]>
+
        * plugin-class.h (html_get_element_text): add a function
        to get the `innerText` of an html element from its id.
        * plugin-class.cpp (html_get_element_text): implement it.

Modified: trunk/moon/plugin/plugin-class.cpp
===================================================================
--- trunk/moon/plugin/plugin-class.cpp  2007-11-20 15:02:03 UTC (rev 89979)
+++ trunk/moon/plugin/plugin-class.cpp  2007-11-20 15:12:40 UTC (rev 89980)
@@ -1635,19 +1635,19 @@
        case MoonId_FindName: {
                if (!argCount)
                        return true;
-               
+
                char *name = (char *) NPVARIANT_TO_STRING 
(args[0]).utf8characters;
-               
-               if (!plugin->surface || !plugin->surface->GetToplevel())
+
+               if (!plugin->surface || !plugin->surface->GetToplevel ())
                        return true;
-               
-               DependencyObject *element = 
plugin->surface->GetToplevel()->FindName (name);
-               if (!element)
+
+               DependencyObject *element = plugin->surface->GetToplevel 
()->FindName (name);
+               if (!element) {
+                       NULL_TO_NPVARIANT (*result);
                        return true;
-               
-               MoonlightEventObjectObject *depobj = EventObjectCreateWrapper 
(instance, element);
-               
-               OBJECT_TO_NPVARIANT (depobj, *result);
+               }
+
+               OBJECT_TO_NPVARIANT (EventObjectCreateWrapper (instance, 
element), *result);
                return true;
        }
 
@@ -1668,19 +1668,19 @@
                DependencyObject *dep = xaml_create_from_str (loader, xaml, 
create_namescope, &element_type);
                delete loader;
 
-               MoonlightEventObjectObject *depobj = NULL;
-               if (dep != NULL) {
-                       depobj = EventObjectCreateWrapper (instance, dep);
-                       dep->unref ();
+               if (!dep) {
+                       NULL_TO_NPVARIANT (*result);
+                       return true;
                }
-               
+
+               MoonlightEventObjectObject *depobj = EventObjectCreateWrapper 
(instance, dep);
+               dep->unref ();
+
                OBJECT_TO_NPVARIANT (depobj, *result);
                return true;
        }
 
        case MoonId_CreateFromXamlDownloader: {
-               NULL_TO_NPVARIANT (*result);
-
                if (argCount < 2)
                        return true;
 
@@ -1699,13 +1699,12 @@
                        g_free (fname);
                }
 
-               if (dep == NULL)
+               if (!dep) {
+                       NULL_TO_NPVARIANT (*result);
                        return true;
+               }
 
-               MoonlightEventObjectObject *depobj =
-                       EventObjectCreateWrapper (instance, dep);
-
-               OBJECT_TO_NPVARIANT (depobj, *result);
+               OBJECT_TO_NPVARIANT (EventObjectCreateWrapper (instance, dep), 
*result);
                return true;
        }
 

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to