r15609 - gnucash/trunk/src/backend/file - Complementary fix to the freqspec=once: the composite semi-monthly FS'es are written out that way as well. So hack-fix them too. :p

Josh Sled jsled at cvs.gnucash.org
Sun Feb 18 16:59:15 EST 2007


Author: jsled
Date: 2007-02-18 16:59:14 -0500 (Sun, 18 Feb 2007)
New Revision: 15609
Trac: http://svn.gnucash.org/trac/changeset/15609

Modified:
   gnucash/trunk/src/backend/file/gnc-freqspec-xml-v2.c
Log:
Complementary fix to the freqspec=once: the composite semi-monthly FS'es are written out that way as well.  So hack-fix them too. :p


Modified: gnucash/trunk/src/backend/file/gnc-freqspec-xml-v2.c
===================================================================
--- gnucash/trunk/src/backend/file/gnc-freqspec-xml-v2.c	2007-02-18 20:52:57 UTC (rev 15608)
+++ gnucash/trunk/src/backend/file/gnc-freqspec-xml-v2.c	2007-02-18 21:59:14 UTC (rev 15609)
@@ -146,6 +146,7 @@
         fspd->book    = NULL;
         fspd->recurrence = g_new0(Recurrence, 1);
         fspd->recurrence_list = NULL;
+        fspd->uift = UIFREQ_NONE;
         fspd->interval
                 = fspd->offset
                 = fspd->day
@@ -421,7 +422,15 @@
             GList *r_iter;
             for (r_iter = recurrences; r_iter != NULL; r_iter = r_iter->next)
             {
-                fspd->recurrence_list = g_list_append(fspd->recurrence_list, r_iter->data);
+                Recurrence *r = (Recurrence*)r_iter->data;
+                GDate recurrence_date;
+                if (fspd->uift == UIFREQ_SEMI_MONTHLY)
+                {
+                    // complementry hack around 'once' freqspects not being valid. :/
+                    recurrence_date = recurrenceGetDate(r);
+                    recurrenceSet(r, recurrenceGetMultiplier(r), PERIOD_MONTH, &recurrence_date);
+                }
+                fspd->recurrence_list = g_list_append(fspd->recurrence_list, r);
             }
         }
         return TRUE;



More information about the gnucash-changes mailing list