[gcalctool/vala] Fix super/substring mode not locking on



commit db3b807bd98941f06924dcbafc3cc93f19620e00
Author: Robert Ancell <robert ancell canonical com>
Date:   Sat Oct 13 09:37:32 2012 +1300

    Fix super/substring mode not locking on

 src/math-equation.vala |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/src/math-equation.vala b/src/math-equation.vala
index d8f9173..a2426c7 100644
--- a/src/math-equation.vala
+++ b/src/math-equation.vala
@@ -739,7 +739,7 @@ public class MathEquation : Gtk.TextBuffer
             can_super_minus = false;
 
         /* Disable super/subscript mode when finished entering */
-        if ("ââÂÂÂââââââââââââââââ".index_of (text) >= 0)
+        if ("ââÂÂÂââââââââââââââââ".index_of (text) < 0)
             number_mode = NumberMode.NORMAL;
 
         delete_selection (false, false);
@@ -748,8 +748,8 @@ public class MathEquation : Gtk.TextBuffer
 
     public void insert_digit (uint digit)
     {
-        const string subscript_digits[] = {"â", "â", "â", "â", "â", "â", "â", "â", "â", "â"};
-        const string superscript_digits[] = {"â", "Â", "Â", "Â", "â", "â", "â", "â", "â", "â"};
+        const unichar subscript_digits[] = {'â', 'â', 'â', 'â', 'â', 'â', 'â', 'â', 'â', 'â'};
+        const unichar superscript_digits[] = {'â', 'Â', 'Â', 'Â', 'â', 'â', 'â', 'â', 'â', 'â'};
 
         if (digit >= 16)
             return;
@@ -757,9 +757,9 @@ public class MathEquation : Gtk.TextBuffer
         if (number_mode == NumberMode.NORMAL || digit >= 10)
             insert (get_digit_text (digit).to_string ());
         else if (number_mode == NumberMode.SUPERSCRIPT)
-            insert (superscript_digits[digit]);
+            insert (superscript_digits[digit].to_string ());
         else if (number_mode == NumberMode.SUBSCRIPT)
-            insert (subscript_digits[digit]);
+            insert (subscript_digits[digit].to_string ());
     }
 
     public void insert_numeric_point ()



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