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.
This commit is contained in:
John Ralls 2014-02-28 16:59:01 -08:00
parent 9f5d62d4f7
commit 594aa3263d

View File

@ -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>.