diff --git a/gnucash/gnome-utils/gnc-tree-view-account.c b/gnucash/gnome-utils/gnc-tree-view-account.c
index 37bb523a2a..a4e9a020d7 100644
--- a/gnucash/gnome-utils/gnc-tree-view-account.c
+++ b/gnucash/gnome-utils/gnc-tree-view-account.c
@@ -2844,7 +2844,7 @@ gboolean gnc_tree_view_search_compare (GtkTreeModel *model, gint column,
gchar *case_normalized_key = NULL;
gboolean match = FALSE;
- normalized_key = g_utf8_normalize (key, -1, G_NORMALIZE_ALL);
+ normalized_key = g_utf8_normalize (key, -1, G_NORMALIZE_NFC);
if (normalized_key)
case_normalized_key = g_utf8_casefold (normalized_key, -1);
if (case_normalized_key)
@@ -2873,7 +2873,7 @@ gboolean gnc_tree_view_search_compare (GtkTreeModel *model, gint column,
if (!str)
continue;
- normalized_string = g_utf8_normalize (str, -1, G_NORMALIZE_ALL);
+ normalized_string = g_utf8_normalize (str, -1, G_NORMALIZE_NFC);
if (normalized_string)
case_normalized_string = g_utf8_casefold (normalized_string, -1);
if (case_normalized_string&&NULL!=strstr(case_normalized_string,case_normalized_key))
diff --git a/gnucash/gnome/assistant-stock-transaction.cpp b/gnucash/gnome/assistant-stock-transaction.cpp
index c0022757cd..077ef428a2 100644
--- a/gnucash/gnome/assistant-stock-transaction.cpp
+++ b/gnucash/gnome/assistant-stock-transaction.cpp
@@ -1005,23 +1005,10 @@ forward_page_func (gint current_page, gpointer user_data)
}
static void
-create_split (Transaction *trans, FieldMask splitfield,
- const gchar *action, Account *account,
+create_split (Transaction *trans, const gchar *action, Account *account,
AccountVec& account_commits, GtkWidget *memo_entry,
- gnc_numeric amount_numeric, gnc_numeric value_numeric,
- bool skip_if_zero, StockTransactionInfo *info)
+ gnc_numeric amount_numeric, gnc_numeric value_numeric)
{
- if (skip_if_zero && gnc_numeric_zero_p (value_numeric))
- return;
-
- if (info->txn_type->input_new_balance)
- amount_numeric = gnc_numeric_sub_fixed (amount_numeric, info->balance_at_date);
- else if (splitfield & FieldMask::ENABLED_CREDIT)
- {
- amount_numeric = gnc_numeric_neg (amount_numeric);
- value_numeric = gnc_numeric_neg (value_numeric);
- }
-
auto split = xaccMallocSplit (gnc_get_current_book ());
xaccSplitSetParent (split, trans);
xaccAccountBeginEdit (account);
@@ -1096,55 +1083,68 @@ stock_assistant_finish (GtkAssistant *assistant, gpointer user_data)
gae_amount (info->stock_amount_edit) : gnc_numeric_zero ();
auto stock_value = info->txn_type->stock_value != FieldMask::DISABLED ?
gae_amount (info->stock_value_edit) : gnc_numeric_zero ();
- create_split (trans, info->txn_type->stock_amount | info->txn_type->stock_value,
- NC_ ("Stock Assistant: Action field", "Stock"),
+ if (info->txn_type->input_new_balance)
+ stock_amount = gnc_numeric_sub_fixed (stock_amount, info->balance_at_date);
+ else
+ {
+ if (info->txn_type->stock_amount & FieldMask::ENABLED_CREDIT)
+ stock_amount = gnc_numeric_neg (stock_amount);
+ if (info->txn_type->stock_value & FieldMask::ENABLED_CREDIT)
+ stock_value = gnc_numeric_neg (stock_value);
+ }
+
+ create_split (trans, NC_ ("Stock Assistant: Action field", "Stock"),
info->acct, account_commits, info->stock_memo_edit,
- stock_amount, stock_value, false, info);
+ stock_amount, stock_value);
if (info->txn_type->cash_value != FieldMask::DISABLED)
{
auto cash = gae_amount (info->cash_value);
- create_split (trans, info->txn_type->cash_value,
- NC_ ("Stock Assistant: Action field", "Cash"),
+ if (info->txn_type->cash_value & FieldMask::ENABLED_CREDIT)
+ cash = gnc_numeric_neg (cash);
+
+ create_split (trans, NC_ ("Stock Assistant: Action field", "Cash"),
gas_account (info->cash_account), account_commits,
- info->cash_memo_edit, cash, cash, false, info);
+ info->cash_memo_edit, cash, cash);
}
if (info->txn_type->fees_value != FieldMask::DISABLED)
{
auto fees = gae_amount (info->fees_value);
- auto capitalize = gtk_toggle_button_get_active
- (GTK_TOGGLE_BUTTON (info->capitalize_fees_checkbox));
- create_split (trans, info->txn_type->fees_value,
- NC_ ("Stock Assistant: Action field", "Fees"),
- capitalize ? info->acct : gas_account (info->fees_account),
- account_commits, info->fees_memo_edit,
- capitalize ? gnc_numeric_zero () : fees, fees, true, info);
+ if (!gnc_numeric_zero_p (fees))
+ {
+ auto capitalize = gtk_toggle_button_get_active
+ (GTK_TOGGLE_BUTTON (info->capitalize_fees_checkbox));
+
+ create_split (trans, NC_ ("Stock Assistant: Action field", "Fees"),
+ capitalize ? info->acct : gas_account (info->fees_account),
+ account_commits, info->fees_memo_edit,
+ capitalize ? gnc_numeric_zero () : fees, fees);
+ }
}
if (info->txn_type->dividend_value != FieldMask::DISABLED)
{
auto dividend = gae_amount (info->dividend_value);
- create_split (trans, info->txn_type->dividend_value,
- NC_ ("Stock Assistant: Action field", "Dividend"),
+ if (info->txn_type->dividend_value & FieldMask::ENABLED_CREDIT)
+ dividend = gnc_numeric_neg (dividend);
+
+ create_split (trans, NC_ ("Stock Assistant: Action field", "Dividend"),
gas_account (info->dividend_account), account_commits,
- info->dividend_memo_edit, dividend, dividend, false, info);
+ info->dividend_memo_edit, dividend, dividend);
}
if (info->txn_type->capgains_value != FieldMask::DISABLED)
{
auto capgains = gae_amount (info->capgains_value);
- create_split (trans, info->txn_type->capgains_value,
- NC_ ("Stock Assistant: Action field", "Capital Gain"),
- gas_account (info->capgains_account),
- account_commits, info->capgains_memo_edit,
- capgains, capgains, false, info);
-
- create_split (trans,
- info->txn_type->capgains_value ^ (FieldMask::ENABLED_CREDIT | FieldMask::ENABLED_DEBIT),
- NC_ ("Stock Assistant: Action field", "Capital Gain"),
+ create_split (trans, NC_ ("Stock Assistant: Action field", "Capital Gain"),
info->acct, account_commits, info->capgains_memo_edit,
- gnc_numeric_zero (), capgains, false, info);
+ gnc_numeric_zero (), capgains);
+
+ capgains = gnc_numeric_neg (capgains);
+ create_split (trans, NC_ ("Stock Assistant: Action field", "Capital Gain"),
+ gas_account (info->capgains_account), account_commits,
+ info->capgains_memo_edit, capgains, capgains);
}
add_price (info, date);
diff --git a/gnucash/gnome/gnc-plugin-page-report.cpp b/gnucash/gnome/gnc-plugin-page-report.cpp
index 162cab99cd..a7417ba7dd 100644
--- a/gnucash/gnome/gnc-plugin-page-report.cpp
+++ b/gnucash/gnome/gnc-plugin-page-report.cpp
@@ -411,6 +411,7 @@ gnc_plugin_page_report_load_uri (GncPluginPage *page)
{
GncPluginPageReport *report;
GncPluginPageReportPrivate *priv;
+ GncPluginPage *weak_page = page;
URLType type;
char * id_name;
char * child_name;
@@ -434,6 +435,7 @@ gnc_plugin_page_report_load_uri (GncPluginPage *page)
g_free(id_name);
g_free(child_name);
+ g_object_add_weak_pointer(G_OBJECT(page), (gpointer*)(&weak_page));
gtk_widget_show_all( GTK_WIDGET(priv->container) );
priv->loaded = TRUE;
@@ -447,7 +449,11 @@ gnc_plugin_page_report_load_uri (GncPluginPage *page)
gnc_html_show_url(priv->html, type, url_location, url_label, 0);
g_free(url_location);
- gnc_plugin_page_report_set_progressbar( page, FALSE );
+ if (weak_page)
+ {
+ gnc_plugin_page_report_set_progressbar( page, FALSE );
+ g_object_remove_weak_pointer(G_OBJECT(page), (gpointer*)(&weak_page));
+ }
// this resets the window for the progressbar to nullptr
gnc_window_set_progressbar_window( nullptr );
diff --git a/gnucash/gtkbuilder/assistant-csv-price-import.glade b/gnucash/gtkbuilder/assistant-csv-price-import.glade
index 2b11c57b65..d1258bd3e7 100644
--- a/gnucash/gtkbuilder/assistant-csv-price-import.glade
+++ b/gnucash/gtkbuilder/assistant-csv-price-import.glade
@@ -85,7 +85,7 @@ Click on "Next" to proceed or "Cancel" to Abort Import.
True
False
-Select location and file name for the Import, then click "OK"…
+Select location and file name for the Import, then click "Next"...
True
diff --git a/gnucash/gtkbuilder/assistant-csv-trans-import.glade b/gnucash/gtkbuilder/assistant-csv-trans-import.glade
index ee898ab61c..15d8c5b0e6 100644
--- a/gnucash/gtkbuilder/assistant-csv-trans-import.glade
+++ b/gnucash/gtkbuilder/assistant-csv-trans-import.glade
@@ -75,7 +75,7 @@ Lastly, for repeated imports the preview page has buttons to Load and Save the s
True
False
-Select location and file name for the Import, then click "OK"…
+Select location and file name for the Import, then click "Next"...
True
diff --git a/gnucash/html/gnc-html-webkit1.c b/gnucash/html/gnc-html-webkit1.c
index 4d5034caf5..6db5dfc0e5 100644
--- a/gnucash/html/gnc-html-webkit1.c
+++ b/gnucash/html/gnc-html-webkit1.c
@@ -465,7 +465,7 @@ handle_embedded_object( GncHtmlWebkit* self, gchar* html_str )
* widget.
********************************************************************/
-static void
+static gboolean
load_to_stream( GncHtmlWebkit* self, URLType type,
const gchar* location, const gchar* label )
{
@@ -485,30 +485,45 @@ load_to_stream( GncHtmlWebkit* self, URLType type,
stream_handler = g_hash_table_lookup( gnc_html_stream_handlers, type );
if ( stream_handler )
{
- gboolean ok = stream_handler( location, &fdata, &fdata_len );
+ GncHtml *weak_html = GNC_HTML(self);
+ gboolean ok;
- if ( ok )
- {
- fdata = fdata ? fdata : g_strdup( "" );
+ g_object_add_weak_pointer(G_OBJECT(self), (gpointer *)(&weak_html));
- // Until webkitgtk supports download requests, look for "