allow null pointer to be safely passed as arg

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@8924 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Linas Vepstas
2003-07-26 04:30:15 +00:00
parent 66b45b6dc4
commit b7a526e646
2 changed files with 21 additions and 18 deletions

View File

@@ -564,7 +564,7 @@ gnc_frequency_setup( GNCFrequency *gf, FreqSpec *fs, GDate *startDate )
}
void
gnc_frequency_save_state( GNCFrequency *gf, FreqSpec *fs, GDate *outStartDate )
gnc_frequency_save_state( GNCFrequency *gf, FreqSpec *fs, GDate *outDate )
{
gint page;
struct tm *tmpTm;
@@ -578,24 +578,27 @@ gnc_frequency_save_state( GNCFrequency *gf, FreqSpec *fs, GDate *outStartDate )
GDate *gd2;
time_t tmpTimeT;
/* get the current tab */
page = gtk_notebook_get_current_page( gf->nb );
/* save into UIFreqSpec */
tmpTimeT = gnc_date_edit_get_date( gf->startDate );
if ( NULL != outDate )
{
g_date_set_time( outDate, tmpTimeT );
}
/* We're going to be creating/destroying FreqSpecs, which will cause GUI
refreshes. :( */
if (NULL == fs) return;
/* Get the current tab */
page = gtk_notebook_get_current_page( gf->nb );
/* We're going to be creating/destroying FreqSpecs,
* which will cause GUI refreshes. :( */
gnc_suspend_gui_refresh();
tmpTimeT = gnc_date_edit_get_date( gf->startDate );
gd = g_date_new();
g_date_set_time( gd, tmpTimeT );
if ( outStartDate != NULL ) {
g_date_set_time( outStartDate, tmpTimeT );
}
/*uift = xaccFreqSpecGetUIType( fs );*/
uift = PAGES[page].uiFTVal;
/* based on value, parse widget values into FreqSpec */
/* Based on value, parse widget values into FreqSpec */
switch ( uift ) {
case UIFREQ_NONE:
/* hmmm... shouldn't really be allowed. */
@@ -1142,7 +1145,7 @@ gnc_frequency_set_frequency_label_text (GNCFrequency *gf, const gchar *txt)
}
void
gnc_frequency_set_startdate_label_text (GNCFrequency *gf, const gchar *txt)
gnc_frequency_set_date_label_text (GNCFrequency *gf, const gchar *txt)
{
GtkLabel *lbl;
if (!gf || !txt) return;

View File

@@ -84,11 +84,11 @@ void gnc_frequency_init( GNCFrequency *gf );
void gnc_frequency_setup( GNCFrequency *gf, FreqSpec *fs, GDate *startDate );
/**
* Saves the state of the GNCFrequenecy widget into the given FreqSpec
* and UIFreqSpec.
* Places the start date in outStartDate, if it's not null.
* Saves the state of the GNCFrequenecy widget.
* Updates the given FreqSpec if it's not NULL.
* Places the date in outDate, if it's not NULL.
**/
void gnc_frequency_save_state( GNCFrequency *gf, FreqSpec *fs, GDate *outStartDate );
void gnc_frequency_save_state( GNCFrequency *gf, FreqSpec *fs, GDate *outDate);
/**
* Set the label text for the frequency option menu. In the current
@@ -96,10 +96,10 @@ void gnc_frequency_save_state( GNCFrequency *gf, FreqSpec *fs, GDate *outStartDa
*/
void gnc_frequency_set_frequency_label_text (GNCFrequency *gf, const gchar *txt);
/**
* Set the label text for the start-date entry widget. In the current
* Set the label text for the date entry widget. In the current
* impelmentation, the default label text is "Start Date:"
*/
void gnc_frequency_set_startdate_label_text (GNCFrequency *gf, const gchar *txt);
void gnc_frequency_set_date_label_text (GNCFrequency *gf, const gchar *txt);
END_GNOME_DECLS