gcalctool r2463 - trunk/gcalctool



Author: rancell
Date: Mon Mar 30 06:04:04 2009
New Revision: 2463
URL: http://svn.gnome.org/viewvc/gcalctool?rev=2463&view=rev

Log:
Added display_set_answer()


Modified:
   trunk/gcalctool/display.c
   trunk/gcalctool/display.h
   trunk/gcalctool/functions.c

Modified: trunk/gcalctool/display.c
==============================================================================
--- trunk/gcalctool/display.c	(original)
+++ trunk/gcalctool/display.c	Mon Mar 30 06:04:04 2009
@@ -246,6 +246,13 @@
 }
 
 
+void
+display_set_answer(GCDisplay *display)
+{
+    display_set_string(display, "Ans", -1);
+}
+
+
 static void
 display_refresh(GCDisplay *display)
 {
@@ -290,7 +297,7 @@
     free(e->expression);
     e->expression = strdup(value);
     e->cursor = cursor;
-
+    
     display_refresh(display);
 }
 

Modified: trunk/gcalctool/display.h
==============================================================================
--- trunk/gcalctool/display.h	(original)
+++ trunk/gcalctool/display.h	Mon Mar 30 06:04:04 2009
@@ -70,6 +70,7 @@
 int display_get_cursor(GCDisplay *);
 
 void display_set_number(GCDisplay *display, const int *);
+void display_set_answer(GCDisplay *display);
 void display_set_string(GCDisplay *display, const char *, int);
 void display_set_cursor(GCDisplay *display, int);
 void display_set_error(GCDisplay *display, const char *);

Modified: trunk/gcalctool/functions.c
==============================================================================
--- trunk/gcalctool/functions.c	(original)
+++ trunk/gcalctool/functions.c	Mon Mar 30 06:04:04 2009
@@ -194,7 +194,7 @@
     }
     else {
         mp_shift(MPval, display_get_answer(&v->display), count);
-        display_set_string(&v->display, "Ans", -1);
+        display_set_answer(&v->display);
     }
 }
 
@@ -213,7 +213,7 @@
                              "gtk-dialog-error");
         } else {
             mp_set_from_mp(MP, display_get_answer(&v->display));
-            display_set_string(&v->display, "Ans", -1);
+            display_set_answer(&v->display);
             clear_undo_history();
         }
     }
@@ -239,7 +239,7 @@
         register_get(index, MPtemp);
         register_set(index, MPexpr);
         mp_set_from_mp(MPtemp, display_get_answer(&v->display));
-        display_set_string(&v->display, "Ans", -1);
+        display_set_answer(&v->display);
         ui_make_registers();
     }
 }
@@ -259,7 +259,7 @@
                              "gtk-dialog-error");
         } else {
             mp_set_from_mp(MP, display_get_answer(&v->display));
-            display_set_string(&v->display, "Ans", -1);
+            display_set_answer(&v->display);
             clear_undo_history();
         }
     }
@@ -425,7 +425,7 @@
                 switch (result) {
                     case 0:
                         mp_set_from_mp(MPval, ans);
-                        display_set_string(&v->display, "Ans", -1);
+                        display_set_answer(&v->display);
                         break;
 
                     case -PARSER_ERR_INVALID_BASE:



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