[balsa] address-view: drop almost duplicate code
- From: Peter Bloomfield <peterb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [balsa] address-view: drop almost duplicate code
- Date: Sun, 21 Apr 2019 23:03:08 +0000 (UTC)
commit 6f3efd4c5bb7304b30b271bacfb1c82a3672b22c
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date: Sun Apr 21 19:02:02 2019 -0400
address-view: drop almost duplicate code
* libbalsa/address-view.c (lbav_insert_text_cb): use
lbav_clean_text to replace non-printable chars by spaces,
instead of using almost duplicative code.
ChangeLog | 8 ++++++++
libbalsa/address-view.c | 14 +-------------
2 files changed, 9 insertions(+), 13 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 29dcf8ead..79ed2c20e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2019-04-21 Peter Bloomfield <pbloomfield bellsouth net>
+
+ address-view: drop almost duplicate code
+
+ * libbalsa/address-view.c (lbav_insert_text_cb): use
+ lbav_clean_text to replace non-printable chars by spaces,
+ instead of using almost duplicative code.
+
2019-04-20 Peter Bloomfield <pbloomfield bellsouth net>
send: Fix a compiler warning
diff --git a/libbalsa/address-view.c b/libbalsa/address-view.c
index 4759e6ffa..b70f0ffee 100644
--- a/libbalsa/address-view.c
+++ b/libbalsa/address-view.c
@@ -628,22 +628,10 @@ lbav_insert_text_cb(GtkEditable * editable,
gint length,
gint * position, LibBalsaAddressView * address_view)
{
- gchar *p;
gchar *ins_text = g_strndup(text, length);
/* replace non-printable chars by spaces */
- p = ins_text;
- while (*p != '\0') {
- gchar *next = g_utf8_next_char(p);
-
- if (g_unichar_isprint(g_utf8_get_char(p)))
- p = next;
- else {
- *p++ = ' ';
- if (p != next)
- memmove(p, next, strlen(next) + 1);
- }
- }
+ lbav_clean_text(ins_text);
/* insert */
g_signal_handlers_block_by_func(editable,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]