From a57ed88ee033129b06eb6dc806f11ebf675aad4e Mon Sep 17 00:00:00 2001 From: Christian Stimming Date: Sun, 3 Oct 2010 12:27:44 +0000 Subject: [PATCH] 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 --- src/app-utils/gnc-sx-instance-model.c | 16 ++- src/app-utils/gnc-sx-instance-model.h | 6 +- src/app-utils/gnc-ui-util.c | 2 +- src/backend/xml/io-gncxml-v2.c | 2 +- src/business/business-gnome/dialog-invoice.c | 8 +- src/core-utils/gnc-path.c | 2 +- src/engine/SchedXaction.c | 16 +-- src/engine/cap-gains.c | 14 +- src/engine/gncBusiness.c | 4 +- src/engine/gncIDSearch.c | 131 +++++++++--------- src/gnome-search/dialog-search.c | 39 ++++-- src/gnome-utils/dialog-account.c | 2 +- src/gnome-utils/gnc-file.c | 4 +- src/gnome-utils/gnc-tree-view.c | 2 +- src/gnome/dialog-print-check.c | 36 ++--- src/gnome/dialog-sx-editor.c | 4 +- src/gnome/gnc-plugin-page-register.c | 4 +- src/import-export/aqbanking/gnc-ab-utils.c | 16 +-- src/import-export/aqbanking/gnc-gwen-gui.c | 12 +- src/libqof/qof/gnc-date.c | 6 +- src/register/register-gnome/gnucash-header.c | 4 +- .../report-gnome/gnc-plugin-page-report.c | 4 +- 22 files changed, 179 insertions(+), 155 deletions(-) diff --git a/src/app-utils/gnc-sx-instance-model.c b/src/app-utils/gnc-sx-instance-model.c index 58346f3e6d..5cce141916 100644 --- a/src/app-utils/gnc-sx-instance-model.c +++ b/src/app-utils/gnc-sx-instance-model.c @@ -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; diff --git a/src/app-utils/gnc-sx-instance-model.h b/src/app-utils/gnc-sx-instance-model.h index dc1d9ebd53..b9ea284840 100644 --- a/src/app-utils/gnc-sx-instance-model.h +++ b/src/app-utils/gnc-sx-instance-model.h @@ -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) into the GHashTable 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 diff --git a/src/app-utils/gnc-ui-util.c b/src/app-utils/gnc-ui-util.c index e2d15c1583..6cb76388bb 100644 --- a/src/app-utils/gnc-ui-util.c +++ b/src/app-utils/gnc-ui-util.c @@ -495,7 +495,7 @@ gnc_ui_account_get_tax_info_string (const Account *account) { const gchar *num_code = NULL; const gchar *prefix = "N"; - + tax_type = gnc_get_current_book_tax_type (); if (tax_type == NULL || (safe_strcmp (tax_type, "") == 0)) return g_strdup (_("Tax entity type not specified")); diff --git a/src/backend/xml/io-gncxml-v2.c b/src/backend/xml/io-gncxml-v2.c index 43a158089a..f0e6199933 100644 --- a/src/backend/xml/io-gncxml-v2.c +++ b/src/backend/xml/io-gncxml-v2.c @@ -310,7 +310,7 @@ add_template_transaction_local( sixtp_gdv2 *data, /* replace the gnc_book_init-created root account */ gnc_book_set_template_root(book, (Account *)n->data); } - else + else { /* This is an old data file that doesn't have a template root account and this is a top level account. Make it a child diff --git a/src/business/business-gnome/dialog-invoice.c b/src/business/business-gnome/dialog-invoice.c index b3378a327d..3a5df4585c 100644 --- a/src/business/business-gnome/dialog-invoice.c +++ b/src/business/business-gnome/dialog-invoice.c @@ -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); } diff --git a/src/core-utils/gnc-path.c b/src/core-utils/gnc-path.c index 1ea511bebe..1503b27afa 100644 --- a/src/core-utils/gnc-path.c +++ b/src/core-utils/gnc-path.c @@ -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; diff --git a/src/engine/SchedXaction.c b/src/engine/SchedXaction.c index 92bdf1371b..450e3a37c0 100644 --- a/src/engine/SchedXaction.c +++ b/src/engine/SchedXaction.c @@ -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; } diff --git a/src/engine/cap-gains.c b/src/engine/cap-gains.c index e76eeea66c..b95527b260 100644 --- a/src/engine/cap-gains.c +++ b/src/engine/cap-gains.c @@ -974,7 +974,7 @@ xaccSplitComputeCapGains(Split *split, Account *gain_acc) { trans = lot_split->parent; gain_split = xaccSplitGetOtherSplit (lot_split); - + /* If the gains transaction has been edited so that it no longer has just two splits, ignore it and assume it's still correct. */ if (!gain_split) @@ -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; } diff --git a/src/engine/gncBusiness.c b/src/engine/gncBusiness.c index 7d81e56d62..1da29a89ef 100644 --- a/src/engine/gncBusiness.c +++ b/src/engine/gncBusiness.c @@ -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) { diff --git a/src/engine/gncIDSearch.c b/src/engine/gncIDSearch.c index 5d72754427..8941c39964 100644 --- a/src/engine/gncIDSearch.c +++ b/src/engine/gncIDSearch.c @@ -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; } diff --git a/src/gnome-search/dialog-search.c b/src/gnome-search/dialog-search.c index 5eb1e44b60..f0ea5c7eb3 100644 --- a/src/gnome-search/dialog-search.c +++ b/src/gnome-search/dialog-search.c @@ -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"); } diff --git a/src/gnome-utils/dialog-account.c b/src/gnome-utils/dialog-account.c index 510076fadc..d61a5fbc3a 100644 --- a/src/gnome-utils/dialog-account.c +++ b/src/gnome-utils/dialog-account.c @@ -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) diff --git a/src/gnome-utils/gnc-file.c b/src/gnome-utils/gnc-file.c index 313b1730f5..0187679387 100644 --- a/src/gnome-utils/gnc-file.c +++ b/src/gnome-utils/gnc-file.c @@ -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"); diff --git a/src/gnome-utils/gnc-tree-view.c b/src/gnome-utils/gnc-tree-view.c index e27afc8c86..62248e8973 100644 --- a/src/gnome-utils/gnc-tree-view.c +++ b/src/gnome-utils/gnc-tree-view.c @@ -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; } diff --git a/src/gnome/dialog-print-check.c b/src/gnome/dialog-print-check.c index 904e110ac8..ee90a7805e 100644 --- a/src/gnome/dialog-print-check.c +++ b/src/gnome/dialog-print-check.c @@ -520,7 +520,7 @@ check_format_has_address ( PrintCheckDialog *pcd ) /* If we're printing more than one check no addresses are allowed */ if (g_list_length(pcd->splits) != 1) return FALSE; - + /* if format is NULL, then the custom format is being used * which has an ADDRESS item by definition */ format = pcd->selected_format; @@ -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; @@ -2337,8 +2337,8 @@ draw_check_custom(GncPrintContext * context, gpointer user_data) pango_font_description_free(desc); } -/* Print a page of checks. This takes into account the number of checks to print, - * the number of checks on a page, and the starting check position on the page. +/* Print a page of checks. This takes into account the number of checks to print, + * the number of checks on a page, and the starting check position on the page. * This function is called once by the GtkPrint code once for each page to be printed. */ static void draw_page(GtkPrintOperation * operation, @@ -2357,7 +2357,7 @@ draw_page(GtkPrintOperation * operation, gint position = gtk_combo_box_get_active(GTK_COMBO_BOX(pcd->position_combobox)); gint checks_per_page; GList *next_split; - + position = gtk_combo_box_get_active(GTK_COMBO_BOX(pcd->position_combobox)); if (position == pcd->position_max) { @@ -2370,7 +2370,7 @@ draw_page(GtkPrintOperation * operation, checks_per_page = pcd->position_max; first_page_count = gtk_spin_button_get_value_as_int(pcd->first_page_count); } - + if (page_nr == 0) { first_check = 0; @@ -2386,9 +2386,9 @@ draw_page(GtkPrintOperation * operation, if (position < pcd->position_max) position = 0; } - - for (check_number = first_check; check_number <= last_check; - check_number++, position++) + + for (check_number = first_check; check_number <= last_check; + check_number++, position++) { pcd->split = (Split *) next_split->data; next_split = g_list_next(next_split); @@ -2417,11 +2417,11 @@ begin_print(GtkPrintOperation * operation, gint first_page_count; gint pages; gint position = gtk_combo_box_get_active(GTK_COMBO_BOX(pcd->position_combobox)); - + if (pcd->selected_format && pcd->position_max > 1 && position < pcd->position_max) { first_page_count = gtk_spin_button_get_value_as_int(pcd->first_page_count); - pages = ((check_count - first_page_count) + pcd->position_max - 1) / + pages = ((check_count - first_page_count) + pcd->position_max - 1) / pcd->position_max + 1; } else @@ -2517,7 +2517,7 @@ gnc_print_check_format_changed (GtkComboBox *widget, pcd->position_max = 0; } gtk_combo_box_append_text(GTK_COMBO_BOX(pcd->position_combobox), _("Custom")); - + /* If there's only one thing in the position combobox, make it insensitive */ sensitive = (pcd->position_max > 0); gtk_widget_set_sensitive(GTK_WIDGET(pcd->position_combobox), sensitive); @@ -2530,7 +2530,7 @@ gnc_print_check_format_changed (GtkComboBox *widget, gnc_print_check_set_sensitive, GINT_TO_POINTER(sensitive)); - /* Set the active entry in the position combo box, this will trigger a + /* Set the active entry in the position combo box, this will trigger a call to gnc_print_check_position_changed */ pnum = MAX(MIN(pnum, pcd->position_max), 0); gtk_combo_box_set_active(GTK_COMBO_BOX(pcd->position_combobox), pnum); @@ -2552,23 +2552,23 @@ 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)); - + /* Make the translation and rotation fields active if the position is "custom" */ sensitive = pnum == pcd->position_max; gtk_widget_set_sensitive(GTK_WIDGET(pcd->translation_x), sensitive); gtk_widget_set_sensitive(GTK_WIDGET(pcd->translation_y), sensitive); gtk_widget_set_sensitive(GTK_WIDGET(pcd->check_rotation), sensitive); gtk_widget_set_sensitive(GTK_WIDGET(pcd->units_combobox), sensitive); - + /* Set up the first page check count spin box */ check_count = g_list_length(pcd->splits); first_page_max = MAX(1, MIN(pcd->position_max - pnum, check_count)); first_page_min = 1; pnum = gtk_spin_button_get_value_as_int(pcd->first_page_count); - first_page_value = MAX(MIN(pnum, first_page_max), first_page_min); + first_page_value = MAX(MIN(pnum, first_page_max), first_page_min); gtk_spin_button_set_range(pcd->first_page_count, (gdouble)first_page_min, (gdouble)first_page_max); gtk_spin_button_set_value(pcd->first_page_count, (gdouble)first_page_value); sensitive = first_page_max > 1; diff --git a/src/gnome/dialog-sx-editor.c b/src/gnome/dialog-sx-editor.c index 97960bb01f..64f22ca232 100644 --- a/src/gnome/dialog-sx-editor.c +++ b/src/gnome/dialog-sx-editor.c @@ -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 diff --git a/src/gnome/gnc-plugin-page-register.c b/src/gnome/gnc-plugin-page-register.c index 3c74145015..aa8fef2f82 100644 --- a/src/gnome/gnc-plugin-page-register.c +++ b/src/gnome/gnc-plugin-page-register.c @@ -2106,7 +2106,7 @@ gnc_plugin_page_register_cmd_print_check (GtkAction *action, { split = gnc_split_register_get_current_split(reg); trans = xaccSplitGetParent(split); - + if (split && trans) { splits = g_list_append(splits, split); @@ -2162,7 +2162,7 @@ gnc_plugin_page_register_cmd_print_check (GtkAction *action, } else { - gnc_error_dialog(gnc_plugin_page_get_window(GNC_PLUGIN_PAGE(plugin_page)), "%s", + gnc_error_dialog(gnc_plugin_page_get_window(GNC_PLUGIN_PAGE(plugin_page)), "%s", _("You can only print checks from a bank account register or search results.")); LEAVE("Unsupported ledger type"); return; diff --git a/src/import-export/aqbanking/gnc-ab-utils.c b/src/import-export/aqbanking/gnc-ab-utils.c index c84b8bcaaf..130ade41ef 100644 --- a/src/import-export/aqbanking/gnc-ab-utils.c +++ b/src/import-export/aqbanking/gnc-ab-utils.c @@ -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,21 +168,21 @@ 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"); } } - } -#endif /* AQBANKING_VERSION_4_PLUS */ - + } +#endif /* AQBANKING_VERSION_4_PLUS */ + /* Init the API */ g_return_val_if_fail(AB_Banking_Init(api) == 0, NULL); diff --git a/src/import-export/aqbanking/gnc-gwen-gui.c b/src/import-export/aqbanking/gnc-gwen-gui.c index 76f869e093..c163c07383 100644 --- a/src/import-export/aqbanking/gnc-gwen-gui.c +++ b/src/import-export/aqbanking/gnc-gwen-gui.c @@ -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); diff --git a/src/libqof/qof/gnc-date.c b/src/libqof/qof/gnc-date.c index 31c1a9084e..523ce2e021 100644 --- a/src/libqof/qof/gnc-date.c +++ b/src/libqof/qof/gnc-date.c @@ -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 ; diff --git a/src/register/register-gnome/gnucash-header.c b/src/register/register-gnome/gnucash-header.c index 39eb8b3ffd..84eda7ae8c 100644 --- a/src/register/register-gnome/gnucash-header.c +++ b/src/register/register-gnome/gnucash-header.c @@ -563,14 +563,14 @@ gnc_header_event (GnomeCanvasItem *item, GdkEvent *event) &x, &y); on_line = pointer_on_resize_line (header, x, y, &ptr_col); - + /* If we're on a resize line and the column to the right is zero width, resize that one. */ if (on_line) resize_col = find_resize_col (header, ptr_col); else resize_col = ptr_col; - + if (resize_col > -1) { header->in_resize = FALSE; diff --git a/src/report/report-gnome/gnc-plugin-page-report.c b/src/report/report-gnome/gnc-plugin-page-report.c index badb1695c0..640ad87539 100644 --- a/src/report/report-gnome/gnc-plugin-page-report.c +++ b/src/report/report-gnome/gnc-plugin-page-report.c @@ -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);