diff --git a/src/selection/html.c b/src/selection/html.c
index ab5b940..79fe00c 100644
--- a/src/selection/html.c
+++ b/src/selection/html.c
@@ -147,19 +147,13 @@ static gchar * get_as_div(v3270 * terminal)
static gchar * get_as_table(v3270 * terminal)
{
GList * element = terminal->selection.blocks;
- GString * string = g_string_new("");
+ GString * string = g_string_new("
");
unsigned int width = lib3270_get_width(terminal->host);
g_autofree gchar * line = g_malloc0(width+1);
GList * column;
- g_string_append_printf(
- string,
- "",
- terminal->font.family
- );
-
// Get contents
GList * columns = v3270_getColumns_from_selection(terminal);
@@ -220,7 +214,6 @@ static gchar * get_as_table(v3270 * terminal)
}
-
gchar * v3270_get_copy_as_html(v3270 * terminal)
{
g_autofree char * text = NULL;
diff --git a/src/selection/linux/copy.c b/src/selection/linux/copy.c
index d7d98c9..bda1502 100644
--- a/src/selection/linux/copy.c
+++ b/src/selection/linux/copy.c
@@ -57,19 +57,8 @@ static void clipboard_get(G_GNUC_UNUSED GtkClipboard *clipboard, GtkSelectionDa
{
case CLIPBOARD_TYPE_TEXT: // Get clipboard contents as text
{
- gchar *text;
-
-#ifdef DEBUG
- text = v3270_get_copy_as_html(terminal);
-#else
- if(terminal->selection.format == V3270_SELECT_TABLE)
- text = v3270_get_copy_as_table(terminal,"\t");
- else
- text = v3270_get_copy_as_text(terminal);
-#endif // DEBUG
-
+ g_autofree gchar *text = v3270_get_copy_as_text(terminal);
gtk_selection_data_set_text(selection,text,-1);
- g_free(text);
}
break;
diff --git a/src/selection/text.c b/src/selection/text.c
index 79737e5..34e3748 100644
--- a/src/selection/text.c
+++ b/src/selection/text.c
@@ -33,7 +33,7 @@
/*--[ Implement ]------------------------------------------------------------------------------------*/
/// @brief Get formatted contents as single text.
-gchar * v3270_get_copy_as_text(v3270 * terminal)
+static gchar * get_as_text(v3270 * terminal)
{
GList * element = terminal->selection.blocks;
GString * string = g_string_new("");
@@ -64,6 +64,13 @@ gchar * v3270_get_copy_as_text(v3270 * terminal)
}
+gchar * v3270_get_copy_as_text(v3270 * terminal)
+{
+ if(terminal->selection.format == V3270_SELECT_TABLE)
+ return v3270_get_copy_as_table(terminal,"\t");
+
+ return get_as_text(terminal);
+}
LIB3270_EXPORT void v3270_input_text(GtkWidget *widget, const gchar *text, const gchar *encoding)
{
--
libgit2 0.21.2