[gnome-calculator] gnome-calculator : Replaces '\n' chars by ' ' chars while pasting text in gnome-calculator.



commit 76e7f0a65c76cc9d88679f8a2b24bf631ca97abb
Author: Kevin THIERRY <kevin thierry kaiwen me>
Date:   Mon Oct 28 14:58:03 2013 +0100

    gnome-calculator : Replaces '\n' chars by ' ' chars while pasting text in gnome-calculator.
    
    RETURN chars cannot be entered using the keyboard but can be entered using
    the copy/paste function. This patch prevents that from happening.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=707061

 src/math-equation.vala |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/src/math-equation.vala b/src/math-equation.vala
index da415fa..a621915 100644
--- a/src/math-equation.vala
+++ b/src/math-equation.vala
@@ -470,7 +470,8 @@ public class MathEquation : Gtk.SourceBuffer
     private void on_paste (Gtk.Clipboard clipboard, string? text)
     {
         if (text != null)
-            insert (text);
+            /* Replaces '\n' characters by ' ' in text before pasting it. */
+            insert (text.delimit ("\n", ' '));
     }
 
     public override void undo ()


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]