Commit dc345aa0cfc51d60ca5a728eea31d615ea1a5a78
1 parent
ff8a1c99
Exists in
master
and in
1 other branch
Removing font definitions in the html table.
Showing
3 changed files
with
10 additions
and
21 deletions
Show diff stats
src/selection/html.c
... | ... | @@ -147,19 +147,13 @@ static gchar * get_as_div(v3270 * terminal) |
147 | 147 | static gchar * get_as_table(v3270 * terminal) |
148 | 148 | { |
149 | 149 | GList * element = terminal->selection.blocks; |
150 | - GString * string = g_string_new(""); | |
150 | + GString * string = g_string_new("<table><tbody>"); | |
151 | 151 | |
152 | 152 | unsigned int width = lib3270_get_width(terminal->host); |
153 | 153 | g_autofree gchar * line = g_malloc0(width+1); |
154 | 154 | |
155 | 155 | GList * column; |
156 | 156 | |
157 | - g_string_append_printf( | |
158 | - string, | |
159 | - "<table style=\"font-family:%s,monospace\"><tbody>", | |
160 | - terminal->font.family | |
161 | - ); | |
162 | - | |
163 | 157 | // Get contents |
164 | 158 | GList * columns = v3270_getColumns_from_selection(terminal); |
165 | 159 | |
... | ... | @@ -220,7 +214,6 @@ static gchar * get_as_table(v3270 * terminal) |
220 | 214 | |
221 | 215 | } |
222 | 216 | |
223 | - | |
224 | 217 | gchar * v3270_get_copy_as_html(v3270 * terminal) |
225 | 218 | { |
226 | 219 | g_autofree char * text = NULL; | ... | ... |
src/selection/linux/copy.c
... | ... | @@ -57,19 +57,8 @@ static void clipboard_get(G_GNUC_UNUSED GtkClipboard *clipboard, GtkSelectionDa |
57 | 57 | { |
58 | 58 | case CLIPBOARD_TYPE_TEXT: // Get clipboard contents as text |
59 | 59 | { |
60 | - gchar *text; | |
61 | - | |
62 | -#ifdef DEBUG | |
63 | - text = v3270_get_copy_as_html(terminal); | |
64 | -#else | |
65 | - if(terminal->selection.format == V3270_SELECT_TABLE) | |
66 | - text = v3270_get_copy_as_table(terminal,"\t"); | |
67 | - else | |
68 | - text = v3270_get_copy_as_text(terminal); | |
69 | -#endif // DEBUG | |
70 | - | |
60 | + g_autofree gchar *text = v3270_get_copy_as_text(terminal); | |
71 | 61 | gtk_selection_data_set_text(selection,text,-1); |
72 | - g_free(text); | |
73 | 62 | } |
74 | 63 | break; |
75 | 64 | ... | ... |
src/selection/text.c
... | ... | @@ -33,7 +33,7 @@ |
33 | 33 | /*--[ Implement ]------------------------------------------------------------------------------------*/ |
34 | 34 | |
35 | 35 | /// @brief Get formatted contents as single text. |
36 | -gchar * v3270_get_copy_as_text(v3270 * terminal) | |
36 | +static gchar * get_as_text(v3270 * terminal) | |
37 | 37 | { |
38 | 38 | GList * element = terminal->selection.blocks; |
39 | 39 | GString * string = g_string_new(""); |
... | ... | @@ -64,6 +64,13 @@ gchar * v3270_get_copy_as_text(v3270 * terminal) |
64 | 64 | |
65 | 65 | } |
66 | 66 | |
67 | +gchar * v3270_get_copy_as_text(v3270 * terminal) | |
68 | +{ | |
69 | + if(terminal->selection.format == V3270_SELECT_TABLE) | |
70 | + return v3270_get_copy_as_table(terminal,"\t"); | |
71 | + | |
72 | + return get_as_text(terminal); | |
73 | +} | |
67 | 74 | |
68 | 75 | LIB3270_EXPORT void v3270_input_text(GtkWidget *widget, const gchar *text, const gchar *encoding) |
69 | 76 | { | ... | ... |