r15608 - gnucash/trunk/src - Better behavior when the number-of-occurences field is blank.

Josh Sled jsled at cvs.gnucash.org
Sun Feb 18 15:52:58 EST 2007


Author: jsled
Date: 2007-02-18 15:52:57 -0500 (Sun, 18 Feb 2007)
New Revision: 15608
Trac: http://svn.gnucash.org/trac/changeset/15608

Modified:
   gnucash/trunk/src/doc/sx.rst
   gnucash/trunk/src/gnome/dialog-sx-from-trans.c
Log:
Better behavior when the number-of-occurences field is blank.


Modified: gnucash/trunk/src/doc/sx.rst
===================================================================
--- gnucash/trunk/src/doc/sx.rst	2007-02-18 20:27:24 UTC (rev 15607)
+++ gnucash/trunk/src/doc/sx.rst	2007-02-18 20:52:57 UTC (rev 15608)
@@ -63,12 +63,12 @@
     - [ ] display-using src/gnome-utils/test/test-sx.c
 
 - bugs
-  - [ ] sx-from-trans: "unknown get.type [3]" [dh20070120]_
-
   - [ ] auto-create (+notify) txns not in review list. [ve20070209]_
 
   - [ ] with SLR open (with instances), add variables to SX; only newly-created instances will have appropriate variable tables.
 
+  - [x] sx-from-trans: "unknown get.type [3]" [dh20070120]_
+
 ! - [x] crash with two sx lists open and SX mutation
     - I'm pretty sure this is due to SX lists not getting cleaned up on page close, somehow.
 

Modified: gnucash/trunk/src/gnome/dialog-sx-from-trans.c
===================================================================
--- gnucash/trunk/src/gnome/dialog-sx-from-trans.c	2007-02-18 20:27:24 UTC (rev 15607)
+++ gnucash/trunk/src/gnome/dialog-sx-from-trans.c	2007-02-18 20:52:57 UTC (rev 15608)
@@ -188,11 +188,19 @@
     guint n_occs;
     w = glade_xml_get_widget(sxfti->gxml, SXFTD_N_OCCURRENCES_ENTRY);
     text = gtk_editable_get_chars(GTK_EDITABLE(w), 0, -1);
-    
-    n_occs = strtoul(text, &endptr, 10);
-    if ( !endptr ) {
-      n_occs = -1;
+
+    if (text == NULL || strlen(text) == 0)
+    {
+        n_occs = 0;
     }
+    else
+    {
+        n_occs = strtoul(text, &endptr, 10);
+        if ( !endptr )
+        {
+            n_occs = -1;
+        }
+    }
 
     g_free(text);
 



More information about the gnucash-changes mailing list