Re-indentation of source code.

This re-indentation was done using astyle-1.24 using the following options:

 astyle --indent=spaces=4 --brackets=break --pad-oper --pad-header --suffix=none

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@19627 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Christian Stimming 2010-10-03 12:27:44 +00:00
parent 752b94a8b9
commit a57ed88ee0
22 changed files with 179 additions and 155 deletions

View File

@ -962,7 +962,7 @@ _get_sx_formula_value(const SchedXaction* sx, const Split *template_split, gnc_n
NULL);
*numeric = kvp_value_get_numeric(kvp_val);
if ((gnc_numeric_check(*numeric) == GNC_ERROR_OK)
&& !gnc_numeric_zero_p(*numeric))
&& !gnc_numeric_zero_p(*numeric))
{
/* Already a valid non-zero result? Then return and don't
* parse the string. Luckily we avoid any locale problems with
@ -1482,7 +1482,8 @@ GHashTable* gnc_g_hash_new_guid_numeric()
NULL, gnc_numeric_free);
}
typedef struct {
typedef struct
{
GHashTable *hash;
GList **creation_errors;
const SchedXaction *sx;
@ -1571,8 +1572,8 @@ create_cashflow_helper(Transaction *template_txn, void *user_data)
}
for (;
template_splits;
template_splits = template_splits->next)
template_splits;
template_splits = template_splits->next)
{
Account *split_acct;
const gnc_commodity *split_cmdty = NULL;
@ -1653,8 +1654,8 @@ create_cashflow_helper(Transaction *template_txn, void *user_data)
static void
instantiate_cashflow_internal(const SchedXaction* sx,
GHashTable* map,
GList **creation_errors, gint count)
GHashTable* map,
GList **creation_errors, gint count)
{
SxCashflowData create_cashflow_data;
Account* sx_template_account = gnc_sx_get_template_transaction_account(sx);
@ -1685,7 +1686,8 @@ void gnc_sx_instantiate_cashflow(const SchedXaction* sx,
instantiate_cashflow_internal(sx, map, creation_errors, 1);
}
typedef struct {
typedef struct
{
GHashTable *hash;
GList **creation_errors;
const GDate *range_start;

View File

@ -240,7 +240,7 @@ GHashTable* gnc_g_hash_new_guid_numeric(void);
* occurred during creation, similar as in
* gnc_sx_instance_model_effect_change(). */
void gnc_sx_instantiate_cashflow(const SchedXaction* sx,
GHashTable* map, GList **creation_errors);
GHashTable* map, GList **creation_errors);
/** Instantiates the cash flow of all given SXs (in the given
* GList<SchedXAction*>) into the GHashTable<GUID*, gnc_numeric*> for the
@ -251,8 +251,8 @@ void gnc_sx_instantiate_cashflow(const SchedXaction* sx,
* occurred during creation, similar as in
* gnc_sx_instance_model_effect_change(). */
void gnc_sx_all_instantiate_cashflow(GList *all_sxes,
const GDate *range_start, const GDate *range_end,
GHashTable* map, GList **creation_errors);
const GDate *range_start, const GDate *range_end,
GHashTable* map, GList **creation_errors);
/** Simplified wrapper around gnc_sx_all_instantiate_cashflow(): Run
* that function on all SX of the current book for the given date

View File

@ -676,7 +676,7 @@ gnc_invoice_window_postCB (GtkWidget *widget, gpointer data)
acct_commodities = gnc_business_commodities(&(iw->owner));
/* Get the due date and posted account */
postdate=gncInvoiceGetDateOpened (invoice);
postdate = gncInvoiceGetDateOpened (invoice);
ddue = postdate;
memo = NULL;
@ -2586,10 +2586,10 @@ gnc_invoice_search (GncInvoice *start, GncOwner *owner, QofBook *book)
else
{
QofQueryPredData *inv_type_pred;
GSList *param_list=NULL;
GSList *param_list = NULL;
inv_type_pred = qof_query_string_predicate(QOF_COMPARE_EQUAL,
gncInvoiceGetTypeFromOwnerType(owner_type),
QOF_STRING_MATCH_NORMAL, FALSE);
gncInvoiceGetTypeFromOwnerType(owner_type),
QOF_STRING_MATCH_NORMAL, FALSE);
param_list = g_slist_prepend (param_list, INVOICE_TYPE);
gncQueryAddTerm (q, param_list, inv_type_pred, QOF_QUERY_AND);
}

View File

@ -133,7 +133,7 @@ gchar *gnc_path_get_reportdir()
{
gchar *pkgdatadir = gnc_path_get_pkgdatadir ();
gchar *result = g_build_filename (pkgdatadir, "guile-modules",
"gnucash", "report", (char*)NULL);
"gnucash", "report", (char*)NULL);
g_free (pkgdatadir);
//printf("Returning stdreportsdir %s\n", result);
return result;

View File

@ -697,9 +697,9 @@ gint gnc_sx_get_num_occur_daterange(const SchedXaction *sx, const GDate* start_d
/* SX still active? If not, return now. */
if ((xaccSchedXactionHasOccurDef(sx)
&& xaccSchedXactionGetRemOccur(sx) <= 0)
|| (xaccSchedXactionHasEndDate(sx)
&& g_date_compare(xaccSchedXactionGetEndDate(sx), start_date) < 0))
&& xaccSchedXactionGetRemOccur(sx) <= 0)
|| (xaccSchedXactionHasEndDate(sx)
&& g_date_compare(xaccSchedXactionGetEndDate(sx), start_date) < 0))
{
return result;
}
@ -710,7 +710,7 @@ gint gnc_sx_get_num_occur_daterange(const SchedXaction *sx, const GDate* start_d
* SX has not yet occurred so far, or if its last valid date was
* before the start date. */
countFirstDate = !g_date_valid(&tmpState->last_date)
|| (g_date_compare(&tmpState->last_date, start_date) < 0);
|| (g_date_compare(&tmpState->last_date, start_date) < 0);
/* No valid date? SX has never occurred so far. */
if (!g_date_valid(&tmpState->last_date))
@ -740,16 +740,16 @@ gint gnc_sx_get_num_occur_daterange(const SchedXaction *sx, const GDate* start_d
/* Now we are in our interval of interest. Increment the
* occurrence date until we are beyond the end of our interval. */
while ((g_date_compare(&tmpState->last_date, end_date) <= 0)
&& (!xaccSchedXactionHasEndDate(sx)
|| g_date_compare(&tmpState->last_date, xaccSchedXactionGetEndDate(sx)) <= 0))
&& (!xaccSchedXactionHasEndDate(sx)
|| g_date_compare(&tmpState->last_date, xaccSchedXactionGetEndDate(sx)) <= 0))
{
++result;
gnc_sx_incr_temporal_state (sx, tmpState);
/* Make sure to check for invalid dates here: It means the SX
* has ended. */
if (!g_date_valid(&tmpState->last_date)
|| (xaccSchedXactionHasOccurDef(sx)
&& tmpState->num_occur_rem <= 0))
|| (xaccSchedXactionHasOccurDef(sx)
&& tmpState->num_occur_rem <= 0))
{
break;
}

View File

@ -986,12 +986,12 @@ xaccSplitComputeCapGains(Split *split, Account *gain_acc)
* gnc_book_partition_txn and depending on the order in which things
* happen some splits may be in the wrong book at that time. */
else if (split->gains_split == lot_split &&
lot_split->gains_split == split &&
gain_split->gains_split == split &&
gnc_numeric_equal (xaccSplitGetValue (lot_split), value) &&
gnc_numeric_zero_p (xaccSplitGetAmount (lot_split)) &&
gnc_numeric_equal (xaccSplitGetValue (gain_split), negvalue) &&
gnc_numeric_equal (xaccSplitGetAmount (gain_split), negvalue))
lot_split->gains_split == split &&
gain_split->gains_split == split &&
gnc_numeric_equal (xaccSplitGetValue (lot_split), value) &&
gnc_numeric_zero_p (xaccSplitGetAmount (lot_split)) &&
gnc_numeric_equal (xaccSplitGetValue (gain_split), negvalue) &&
gnc_numeric_equal (xaccSplitGetAmount (gain_split), negvalue))
{
new_gain_split = FALSE;
}

View File

@ -31,8 +31,8 @@
struct _get_list_userdata
{
GList *result;
QofAccessFunc is_active_accessor_func;
GList *result;
QofAccessFunc is_active_accessor_func;
};
static void get_list_cb (QofInstance *inst, gpointer user_data)
{

View File

@ -34,38 +34,38 @@ static void * search(QofBook * book, const gchar *id, void * object, GNCIdType t
GncCustomer *
gnc_search_customer_on_id (QofBook * book, const gchar *id)
{
GncCustomer *customer = NULL;
GNCIdType type = GNC_CUSTOMER_MODULE_NAME;
customer = (GncCustomer*)search(book, id, customer, type);
return customer;
GncCustomer *customer = NULL;
GNCIdType type = GNC_CUSTOMER_MODULE_NAME;
customer = (GncCustomer*)search(book, id, customer, type);
return customer;
}
GncInvoice *
gnc_search_invoice_on_id (QofBook * book, const gchar *id)
{
GncInvoice *invoice = NULL;
GNCIdType type = GNC_INVOICE_MODULE_NAME;
invoice = (GncInvoice*)search(book,id, invoice, type);
return invoice;
}
GncInvoice *invoice = NULL;
GNCIdType type = GNC_INVOICE_MODULE_NAME;
invoice = (GncInvoice*)search(book, id, invoice, type);
return invoice;
}
/* Essentially identical to above.*/
GncInvoice *
gnc_search_bill_on_id (QofBook * book, const gchar *id)
{
GncInvoice *bill = NULL;
GNCIdType type = GNC_INVOICE_MODULE_NAME;
bill = (GncInvoice*)search(book, id, bill, type);
return bill;
}
GncInvoice *bill = NULL;
GNCIdType type = GNC_INVOICE_MODULE_NAME;
bill = (GncInvoice*)search(book, id, bill, type);
return bill;
}
GncVendor *
gnc_search_vendor_on_id (QofBook * book, const gchar *id)
{
GncVendor *vendor = NULL;
GNCIdType type = GNC_VENDOR_MODULE_NAME;
vendor = (GncVendor*)search(book, id, vendor, type);
return vendor;
GncVendor *vendor = NULL;
GNCIdType type = GNC_VENDOR_MODULE_NAME;
vendor = (GncVendor*)search(book, id, vendor, type);
return vendor;
}
@ -75,54 +75,57 @@ gnc_search_vendor_on_id (QofBook * book, const gchar *id)
****************************************************************/
static void * search(QofBook * book, const gchar *id, void * object, GNCIdType type)
{
void *c;
GList *result;
QueryNew *q;
gint len;
QueryPredData_t string_pred_data;
g_return_val_if_fail (type, NULL);
g_return_val_if_fail (id, NULL);
g_return_val_if_fail (book, NULL);
void *c;
GList *result;
QueryNew *q;
gint len;
QueryPredData_t string_pred_data;
g_return_val_if_fail (type, NULL);
g_return_val_if_fail (id, NULL);
g_return_val_if_fail (book, NULL);
// Build the query
q = gncQueryCreateFor (type);
gncQuerySetBook (q, book);
// Search only the id field
string_pred_data = gncQueryStringPredicate (COMPARE_EQUAL, id, STRING_MATCH_NORMAL, FALSE);
// Build the query
q = gncQueryCreateFor (type);
gncQuerySetBook (q, book);
// Search only the id field
string_pred_data = gncQueryStringPredicate (COMPARE_EQUAL, id, STRING_MATCH_NORMAL, FALSE);
if (strcmp(type,GNC_CUSTOMER_MODULE_NAME))
{
GncCustomer *c = NULL;
gncQueryAddTerm (q, gncQueryBuildParamList("CUSTOMER_ID"), string_pred_data, QUERY_AND);
}
else if (strcmp(type,GNC_INVOICE_MODULE_NAME))
{
GncInvoice *c = NULL;
gncQueryAddTerm (q, gncQueryBuildParamList("INVOICE_ID"), string_pred_data, QUERY_AND);
}
else if (strcmp(type,GNC_VENDOR_MODULE_NAME))
{
GncVendor *c = NULL;
gncQueryAddTerm (q, gncQueryBuildParamList("VENDOR_ID"), string_pred_data, QUERY_AND);
}
if (strcmp(type, GNC_CUSTOMER_MODULE_NAME))
{
GncCustomer *c = NULL;
gncQueryAddTerm (q, gncQueryBuildParamList("CUSTOMER_ID"), string_pred_data, QUERY_AND);
}
else if (strcmp(type, GNC_INVOICE_MODULE_NAME))
{
GncInvoice *c = NULL;
gncQueryAddTerm (q, gncQueryBuildParamList("INVOICE_ID"), string_pred_data, QUERY_AND);
}
else if (strcmp(type, GNC_VENDOR_MODULE_NAME))
{
GncVendor *c = NULL;
gncQueryAddTerm (q, gncQueryBuildParamList("VENDOR_ID"), string_pred_data, QUERY_AND);
}
// Run the query
result = gncQueryRun (q);
// Run the query
result = gncQueryRun (q);
// now compare _exactly_
len = g_list_length (result);
if (result && (len>0)) {
result = g_list_first (result);
while (result) {
c = result->data;
if (strcmp(id,gncCustomerGetID(c)) == 0) {
// correct id found
object = c;
break;
}
result = g_list_next (result);
}
}
gncQueryDestroy (q);
return object;
// now compare _exactly_
len = g_list_length (result);
if (result && (len > 0))
{
result = g_list_first (result);
while (result)
{
c = result->data;
if (strcmp(id, gncCustomerGetID(c)) == 0)
{
// correct id found
object = c;
break;
}
result = g_list_next (result);
}
}
gncQueryDestroy (q);
return object;
}

View File

@ -827,25 +827,44 @@ close_handler (gpointer data)
static const gchar *
type_label_to_new_button(const gchar* type_label)
{
if (g_strcmp0(type_label, "Bill") == 0) {
if (g_strcmp0(type_label, "Bill") == 0)
{
return _("New Bill");
} else if (g_strcmp0(type_label, "Customer") == 0) {
}
else if (g_strcmp0(type_label, "Customer") == 0)
{
return _("New Customer");
} else if (g_strcmp0(type_label, "Employee") == 0) {
}
else if (g_strcmp0(type_label, "Employee") == 0)
{
return _("New Employee");
} else if (g_strcmp0(type_label, "Expense Voucher") == 0) {
}
else if (g_strcmp0(type_label, "Expense Voucher") == 0)
{
return _("New Expense Voucher");
} else if (g_strcmp0(type_label, "Invoice") == 0) {
}
else if (g_strcmp0(type_label, "Invoice") == 0)
{
return _("New Invoice");
} else if (g_strcmp0(type_label, "Job") == 0) {
}
else if (g_strcmp0(type_label, "Job") == 0)
{
return _("New Job");
} else if (g_strcmp0(type_label, "Order") == 0) {
}
else if (g_strcmp0(type_label, "Order") == 0)
{
return _("New Order");
} else if (g_strcmp0(type_label, "Transaction") == 0) {
}
else if (g_strcmp0(type_label, "Transaction") == 0)
{
return _("New Transaction");
} else if (g_strcmp0(type_label, "Vendor") == 0) {
}
else if (g_strcmp0(type_label, "Vendor") == 0)
{
return _("New Vendor");
} else {
}
else
{
PWARN("No translatable new-button label found for search type \"%s\", please add one into dialog-search.c!", type_label);
return _("New item");
}

View File

@ -373,7 +373,7 @@ gnc_ui_to_account(AccountWindow *aw)
string = g_strdup_printf("#%04X%04X%04X", color.red, color.green, color.blue);
#endif
if (safe_strcmp (string, DEFAULT_COLOR) == 0)
string = "Not Set";
string = "Not Set";
old_string = xaccAccountGetColor (account);
if (safe_strcmp (string, old_string) != 0)

View File

@ -981,7 +981,7 @@ gnc_file_do_export(const char * filename)
/* Save As can't use the generic 'file' protocol. If the user didn't set
* a specific protocol, assume the default 'xml'.
*/
if (g_strcmp0 (protocol,"file") == 0)
if (g_strcmp0 (protocol, "file") == 0)
{
g_free (protocol);
protocol = g_strdup ("xml");
@ -1193,7 +1193,7 @@ gnc_file_do_save_as (const char* filename)
/* Save As can't use the generic 'file' protocol. If the user didn't set
* a specific protocol, assume the default 'xml'.
*/
if (g_strcmp0 (protocol,"file") == 0)
if (g_strcmp0 (protocol, "file") == 0)
{
g_free (protocol);
protocol = g_strdup ("xml");

View File

@ -1819,7 +1819,7 @@ gnc_tree_view_column_properties (GncTreeView *view,
visible = gnc_tree_view_column_visible(view, NULL, pref_name);
/* Get width */
if(default_width == 0)
if (default_width == 0)
{
sizing = GTK_TREE_VIEW_COLUMN_AUTOSIZE;
}

View File

@ -2193,7 +2193,7 @@ draw_page_boxes(GncPrintContext * context,
* pattern (if requested), and calls a helper function to print all check items */
static void
draw_check_format(GncPrintContext * context, gint position,
check_format_t * format, gpointer user_data)
check_format_t * format, gpointer user_data)
{
PrintCheckDialog *pcd = (PrintCheckDialog *) user_data;
cairo_t *cr;
@ -2388,7 +2388,7 @@ draw_page(GtkPrintOperation * operation,
}
for (check_number = first_check; check_number <= last_check;
check_number++, position++)
check_number++, position++)
{
pcd->split = (Split *) next_split->data;
next_split = g_list_next(next_split);
@ -2552,7 +2552,7 @@ gnc_print_check_position_changed (GtkComboBox *widget,
gint pnum;
guint check_count;
gint first_page_max, first_page_min, first_page_value;
gdouble fpmin,fpmax;
gdouble fpmin, fpmax;
pnum = gtk_combo_box_get_active(GTK_COMBO_BOX(pcd->position_combobox));

View File

@ -218,8 +218,8 @@ sxed_confirmed_cancel(GncSxEditorDialog *sxed)
_( "This SX has changed; are you "
"sure you want to cancel?" );
#else
/* Translators: This message is currently not yet used; it
* will be used once the 2.4.0 string freeze is lifted. */
/* Translators: This message is currently not yet used; it
* will be used once the 2.4.0 string freeze is lifted. */
_( "This Scheduled Transaction has changed; are you "
"sure you want to cancel?" );
#endif

View File

@ -146,20 +146,20 @@ gnc_AB_BANKING_new(void)
# ifndef AQBANKING_VERSION_5_PLUS
, 0
# endif
) != 0)
) != 0)
{
if (AB_Banking_HasConf3(api
# ifndef AQBANKING_VERSION_5_PLUS
, 0
# endif
) == 0)
) == 0)
{
g_message("gnc_AB_BANKING_new: importing aqbanking3 configuration\n");
if (AB_Banking_ImportConf3(api
# ifndef AQBANKING_VERSION_5_PLUS
, 0
# endif
) < 0)
) < 0)
{
g_message("gnc_AB_BANKING_new: unable to import aqbanking3 configuration\n");
}
@ -168,14 +168,14 @@ gnc_AB_BANKING_new(void)
# ifndef AQBANKING_VERSION_5_PLUS
, 0
# endif
) == 0)
) == 0)
{
g_message("gnc_AB_BANKING_new: importing aqbanking2 configuration\n");
if (AB_Banking_ImportConf2(api
# ifndef AQBANKING_VERSION_5_PLUS
, 0
# endif
) < 0)
) < 0)
{
g_message("gnc_AB_BANKING_new: unable to import aqbanking2 configuration\n");
}

View File

@ -174,18 +174,18 @@ static gint progress_log_cb(GWEN_GUI *gwen_gui, guint32 id,
GWEN_LOGGER_LEVEL level, const gchar *text);
static gint progress_end_cb(GWEN_GUI *gwen_gui, guint32 id);
static gint GNC_GWENHYWFAR_CB getpassword_cb(GWEN_GUI *gwen_gui, guint32 flags, const gchar *token,
const gchar *title, const gchar *text, gchar *buffer,
gint min_len, gint max_len, guint32 guiid);
const gchar *title, const gchar *text, gchar *buffer,
gint min_len, gint max_len, guint32 guiid);
static gint GNC_GWENHYWFAR_CB setpasswordstatus_cb(GWEN_GUI *gwen_gui, const gchar *token,
const gchar *pin,
GWEN_GUI_PASSWORD_STATUS status, guint32 guiid);
const gchar *pin,
GWEN_GUI_PASSWORD_STATUS status, guint32 guiid);
static gint GNC_GWENHYWFAR_CB loghook_cb(GWEN_GUI *gwen_gui, const gchar *log_domain,
GWEN_LOGGER_LEVEL priority, const gchar *text);
GWEN_LOGGER_LEVEL priority, const gchar *text);
#ifdef AQBANKING_VERSION_5_PLUS
typedef GWEN_SYNCIO GWEN_IO_LAYER;
#endif
static gint GNC_GWENHYWFAR_CB checkcert_cb(GWEN_GUI *gwen_gui, const GWEN_SSLCERTDESCR *cert,
GWEN_IO_LAYER *io, guint32 guiid);
GWEN_IO_LAYER *io, guint32 guiid);
gboolean ggg_delete_event_cb(GtkWidget *widget, GdkEvent *event,
gpointer user_data);

View File

@ -72,11 +72,11 @@
const char *gnc_default_strftime_date_format =
#ifdef G_OS_WIN32
/* The default date format for use with strftime in Win32. */
/* The default date format for use with strftime in Win32. */
N_("%B %#d, %Y")
#else
/* The default date format for use with strftime in other OS. */
/* Translators: call "man strftime" for possible values. */
/* The default date format for use with strftime in other OS. */
/* Translators: call "man strftime" for possible values. */
N_("%B %e, %Y")
#endif
;

View File

@ -1407,8 +1407,8 @@ gnc_get_export_filename (SCM choice)
filepath = gnc_file_dialog (title, NULL, default_dir, GNC_FILE_DIALOG_EXPORT);
/* Try to test for extension on file name, add if missing */
if (g_strrstr(filepath,".") == NULL)
filepath = g_strconcat(filepath,".",g_ascii_strdown(type,strlen(type)),NULL);
if (g_strrstr(filepath, ".") == NULL)
filepath = g_strconcat(filepath, ".", g_ascii_strdown(type, strlen(type)), NULL);
g_free (title);
g_free (default_dir);