gcalctool r2101 - in branches/gnome-2-22: . gcalctool
- From: rancell svn gnome org
- To: svn-commits-list gnome org
- Subject: gcalctool r2101 - in branches/gnome-2-22: . gcalctool
- Date: Tue, 27 May 2008 23:22:21 +0000 (UTC)
Author: rancell
Date: Tue May 27 23:22:21 2008
New Revision: 2101
URL: http://svn.gnome.org/viewvc/gcalctool?rev=2101&view=rev
Log:
Default to no thousands separator not ',' (Bug #527669)
Modified:
branches/gnome-2-22/ChangeLog
branches/gnome-2-22/gcalctool/calctool.c
branches/gnome-2-22/gcalctool/display.c
branches/gnome-2-22/gcalctool/functions.c
branches/gnome-2-22/gcalctool/get.c
branches/gnome-2-22/gcalctool/gtk.c
branches/gnome-2-22/gcalctool/ui.h
Modified: branches/gnome-2-22/gcalctool/calctool.c
==============================================================================
--- branches/gnome-2-22/gcalctool/calctool.c (original)
+++ branches/gnome-2-22/gcalctool/calctool.c Tue May 27 23:22:21 2008
@@ -743,15 +743,15 @@
v->appname = strdup(argv[0]);
}
- init_state();
-
get_options(argc, argv); /* Get command line arguments. */
- ui_init(&argc, &argv); /* Initialise UI */
- resources_init(); /* Initialise configuration */
-
+
v->radix = get_radix(); /* Locale specific radix string. */
v->tsep = get_tsep(); /* Locale specific thousands separator. */
v->tsep_count = get_tsep_count();
+
+ init_state();
+ ui_init(&argc, &argv); /* Initialise UI */
+ resources_init(); /* Initialise configuration */
init_text(); /* Setup text strings depending upon language. */
read_resources(); /* Read resources from merged database. */
Modified: branches/gnome-2-22/gcalctool/display.c
==============================================================================
--- branches/gnome-2-22/gcalctool/display.c (original)
+++ branches/gnome-2-22/gcalctool/display.c Tue May 27 23:22:21 2008
@@ -65,7 +65,7 @@
/* Remove separators if not supported */
clean = g_string_sized_new(strlen(src));
for (c = src, read_cursor = 1; *c; c++, read_cursor++) {
- if (strncmp(c, v->tsep, strlen(v->tsep)) == 0) {
+ if (v->tsep[0] != '\0' && strncmp(c, v->tsep, strlen(v->tsep)) == 0) {
c += strlen(v->tsep) - 1;
if (new_cursor >= read_cursor) {
new_cursor--;
Modified: branches/gnome-2-22/gcalctool/functions.c
==============================================================================
--- branches/gnome-2-22/gcalctool/functions.c (original)
+++ branches/gnome-2-22/gcalctool/functions.c Tue May 27 23:22:21 2008
@@ -564,7 +564,7 @@
/* Remove thousands separators and use english radix */
clean = g_string_sized_new(strlen(e->expression));
for (c = e->expression; *c; c++) {
- if (strncmp(c, v->tsep, strlen(v->tsep)) == 0) {
+ if (v->tsep[0] != '\0' && strncmp(c, v->tsep, strlen(v->tsep)) == 0) {
c += strlen(v->tsep) - 1;
} else if (strncmp(c, v->radix, strlen(v->radix)) == 0) {
g_string_append_c(clean, '.');
Modified: branches/gnome-2-22/gcalctool/get.c
==============================================================================
--- branches/gnome-2-22/gcalctool/get.c (original)
+++ branches/gnome-2-22/gcalctool/get.c Tue May 27 23:22:21 2008
@@ -218,7 +218,7 @@
}
if (tsep == NULL) {
- return(",");
+ return("");
} else {
return(tsep);
}
Modified: branches/gnome-2-22/gcalctool/gtk.c
==============================================================================
--- branches/gnome-2-22/gcalctool/gtk.c (original)
+++ branches/gnome-2-22/gcalctool/gtk.c Tue May 27 23:22:21 2008
@@ -1042,14 +1042,10 @@
}
-char *
+const char *
ui_get_localized_numeric_point(void)
{
- const char *decimal_point;
-
- decimal_point = localeconv()->decimal_point;
-
- return (g_locale_to_utf8(decimal_point, -1, NULL, NULL, NULL));
+ return strdup(v->radix);
}
Modified: branches/gnome-2-22/gcalctool/ui.h
==============================================================================
--- branches/gnome-2-22/gcalctool/ui.h (original)
+++ branches/gnome-2-22/gcalctool/ui.h Tue May 27 23:22:21 2008
@@ -51,6 +51,6 @@
void ui_set_statusbar(gchar *, const gchar *);
void ui_beep(void);
-char *ui_get_localized_numeric_point(void);
+const char *ui_get_localized_numeric_point(void);
#endif /* UI_H */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]