Skip to content

Commit

Permalink
Copy equation as ASCII text
Browse files Browse the repository at this point in the history
This ensures compatibility with pasting into software that cannot handle Unicode characters (e.g. LibreOffice)
  • Loading branch information
vkareh authored and raveit65 committed Aug 28, 2018
1 parent b9020a6 commit de4b0c4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/math-equation.c
Expand Up @@ -416,14 +416,14 @@ math_equation_copy(MathEquation *equation)
{
GtkTextIter start, end;
gchar *text;

g_return_if_fail(equation != NULL);

if (!gtk_text_buffer_get_selection_bounds(GTK_TEXT_BUFFER(equation), &start, &end))
gtk_text_buffer_get_bounds(GTK_TEXT_BUFFER(equation), &start, &end);

text = gtk_text_buffer_get_text(GTK_TEXT_BUFFER(equation), &start, &end, FALSE);
gtk_clipboard_set_text(gtk_clipboard_get(GDK_NONE), text, -1);
gtk_clipboard_set_text(gtk_clipboard_get(GDK_NONE), g_str_to_ascii (text, "C"), -1);
g_free(text);
}

Expand Down

0 comments on commit de4b0c4

Please sign in to comment.