gnucash master: Fix SX Editor not being able to change the Repeat type from "Until".

John Ralls jralls at code.gnucash.org
Fri Feb 28 20:01:02 EST 2014


Updated	 via  https://github.com/Gnucash/gnucash/commit/594aa326 (commit)
	from  https://github.com/Gnucash/gnucash/commit/9f5d62d4 (commit)



commit 594aa3263df87c09c27a6436a49ac8e47522b194
Author: John Ralls <jralls at ceridwen.us>
Date:   Fri Feb 28 16:59:01 2014 -0800

    Fix SX Editor not being able to change the Repeat type from "Until".
    
    The way this is stored depends upon the SX End Date being invalid, but
    xaccSchedXActionSetLastOccurDate() rejected invalid dates, so once a valid
    date had been created, it was impossible to change, except to another valid
    date.

diff --git a/src/engine/SchedXaction.c b/src/engine/SchedXaction.c
index 0943c2b..ceb30b0 100644
--- a/src/engine/SchedXaction.c
+++ b/src/engine/SchedXaction.c
@@ -629,9 +629,11 @@ xaccSchedXactionGetEndDate(const SchedXaction *sx )
 void
 xaccSchedXactionSetEndDate( SchedXaction *sx, const GDate *newEnd )
 {
-    if (newEnd == NULL
-	|| !g_date_valid( newEnd )
-	|| g_date_compare( newEnd, &sx->start_date ) < 0 )
+/* Note that an invalid GDate IS a permissable value: It means that
+ * the SX is to run "forever". See gnc_sxed_save_sx() and
+ * schedXact_editor_populate() in dialog-sx-editor.c.
+ */
+    if (newEnd == NULL || g_date_compare( newEnd, &sx->start_date ) < 0 )
     {
         /* XXX: I reject the bad data - is this the right
          * thing to do <rgmerk>.



Summary of changes:
 src/engine/SchedXaction.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)



More information about the gnucash-changes mailing list