Commit e882a326 authored by Morten Welinder's avatar Morten Welinder

Cleanup.

parent 787d0225
......@@ -11,7 +11,6 @@ Jukka:
* Lots of test files added
Morten:
* Found everyone else's bugs.
* Reworked the insert/delete column/row again.
* Reworked the Goal Seek function to produce more accurate
results faster, and fail less often.
......@@ -19,10 +18,12 @@ Morten:
* Shined up date calculations.
* Added WEEKDAY(), DAYS360(), TIMEVALUE().
* Fixed PROPER(), FLOOR(), SERIESSUM(), ROUND(), ROUNDUP(),
ROUNDDOWN(), ATAN2().
ROUNDDOWN(), ATAN2(), MOD(), INT(), COUNT(), COUNTA(),
AND(), OR().
* Improved precision here and there.
* Fixed font-reusage when writing in Gnumeric's default file
format.
* Fixed cell editing code.
* Fixed many internationalisation bugs. Translators, please
make sure the default floating-point format, "0.0########",
has been translated for your locale. (German translators,
......
1999-06-21 Morten Welinder <terra@diku.dk>
* src/fn-math.c (gpow10): Rename from pow10 which colided with
something in Linux with libc5. (Thanks to Alexander Jolk.)
* src/utils.c (parse_cell_name): Don't use isdigit since we intend
to subtract '0' from the character.
* src/workbook.c (workbook_parse_and_jump): Cleanup.
1999-06-21 Jukka-Pekka Iivonen <iivonen@iki.fi>
* samples/infofuns.xls: Added a new file for testing information
......
1999-06-21 Morten Welinder <terra@diku.dk>
* src/fn-math.c (gpow10): Rename from pow10 which colided with
something in Linux with libc5. (Thanks to Alexander Jolk.)
* src/utils.c (parse_cell_name): Don't use isdigit since we intend
to subtract '0' from the character.
* src/workbook.c (workbook_parse_and_jump): Cleanup.
1999-06-21 Jukka-Pekka Iivonen <iivonen@iki.fi>
* samples/infofuns.xls: Added a new file for testing information
......
1999-06-21 Morten Welinder <terra@diku.dk>
* src/fn-math.c (gpow10): Rename from pow10 which colided with
something in Linux with libc5. (Thanks to Alexander Jolk.)
* src/utils.c (parse_cell_name): Don't use isdigit since we intend
to subtract '0' from the character.
* src/workbook.c (workbook_parse_and_jump): Cleanup.
1999-06-21 Jukka-Pekka Iivonen <iivonen@iki.fi>
* samples/infofuns.xls: Added a new file for testing information
......
1999-06-21 Morten Welinder <terra@diku.dk>
* src/fn-math.c (gpow10): Rename from pow10 which colided with
something in Linux with libc5. (Thanks to Alexander Jolk.)
* src/utils.c (parse_cell_name): Don't use isdigit since we intend
to subtract '0' from the character.
* src/workbook.c (workbook_parse_and_jump): Cleanup.
1999-06-21 Jukka-Pekka Iivonen <iivonen@iki.fi>
* samples/infofuns.xls: Added a new file for testing information
......
......@@ -51,7 +51,7 @@ gcd (int a, int b)
}
static float_t
pow10 (int n)
gpow10 (int n)
{
float_t res = 1.0;
float_t p;
......@@ -1630,7 +1630,7 @@ gnumeric_trunc (struct FunctionDefinition *i,
else
digits = value_get_as_int (argv[1]);
p10 = pow10 (digits);
p10 = gpow10 (digits);
if (number < 0)
return value_new_float (-floor (-number * p10) / p10);
else
......@@ -1871,7 +1871,7 @@ gnumeric_rounddown (struct FunctionDefinition *i,
else
digits = value_get_as_int (argv[1]);
p10 = pow10 (digits);
p10 = gpow10 (digits);
if (number < 0)
return value_new_float (-ceil (-number * p10) / p10);
else
......@@ -1910,7 +1910,7 @@ gnumeric_round (struct FunctionDefinition *i,
else
digits = value_get_as_int (argv[1]);
p10 = pow10 (digits);
p10 = gpow10 (digits);
return value_new_float (rint (number * p10) / p10);
}
......@@ -1946,7 +1946,7 @@ gnumeric_roundup (struct FunctionDefinition *i,
else
digits = value_get_as_int (argv[1]);
p10 = pow10 (digits);
p10 = gpow10 (digits);
if (number < 0)
return value_new_float (-floor (-number * p10) / p10);
else
......
......@@ -51,7 +51,7 @@ gcd (int a, int b)
}
static float_t
pow10 (int n)
gpow10 (int n)
{
float_t res = 1.0;
float_t p;
......@@ -1630,7 +1630,7 @@ gnumeric_trunc (struct FunctionDefinition *i,
else
digits = value_get_as_int (argv[1]);
p10 = pow10 (digits);
p10 = gpow10 (digits);
if (number < 0)
return value_new_float (-floor (-number * p10) / p10);
else
......@@ -1871,7 +1871,7 @@ gnumeric_rounddown (struct FunctionDefinition *i,
else
digits = value_get_as_int (argv[1]);
p10 = pow10 (digits);
p10 = gpow10 (digits);
if (number < 0)
return value_new_float (-ceil (-number * p10) / p10);
else
......@@ -1910,7 +1910,7 @@ gnumeric_round (struct FunctionDefinition *i,
else
digits = value_get_as_int (argv[1]);
p10 = pow10 (digits);
p10 = gpow10 (digits);
return value_new_float (rint (number * p10) / p10);
}
......@@ -1946,7 +1946,7 @@ gnumeric_roundup (struct FunctionDefinition *i,
else
digits = value_get_as_int (argv[1]);
p10 = pow10 (digits);
p10 = gpow10 (digits);
if (number < 0)
return value_new_float (-floor (-number * p10) / p10);
else
......
......@@ -51,7 +51,7 @@ gcd (int a, int b)
}
static float_t
pow10 (int n)
gpow10 (int n)
{
float_t res = 1.0;
float_t p;
......@@ -1630,7 +1630,7 @@ gnumeric_trunc (struct FunctionDefinition *i,
else
digits = value_get_as_int (argv[1]);
p10 = pow10 (digits);
p10 = gpow10 (digits);
if (number < 0)
return value_new_float (-floor (-number * p10) / p10);
else
......@@ -1871,7 +1871,7 @@ gnumeric_rounddown (struct FunctionDefinition *i,
else
digits = value_get_as_int (argv[1]);
p10 = pow10 (digits);
p10 = gpow10 (digits);
if (number < 0)
return value_new_float (-ceil (-number * p10) / p10);
else
......@@ -1910,7 +1910,7 @@ gnumeric_round (struct FunctionDefinition *i,
else
digits = value_get_as_int (argv[1]);
p10 = pow10 (digits);
p10 = gpow10 (digits);
return value_new_float (rint (number * p10) / p10);
}
......@@ -1946,7 +1946,7 @@ gnumeric_roundup (struct FunctionDefinition *i,
else
digits = value_get_as_int (argv[1]);
p10 = pow10 (digits);
p10 = gpow10 (digits);
if (number < 0)
return value_new_float (-floor (-number * p10) / p10);
else
......
......@@ -165,7 +165,7 @@ parse_cell_name (const char *cell_str, int *col, int *row)
/* Parse row number: a sequence of digits. */
for (*row = 0; *cell_str; cell_str++) {
if (!isdigit ((unsigned char)*cell_str))
if (*cell_str < '0' || *cell_str > '9')
return FALSE;
*row = *row * 10 + (*cell_str - '0');
if (*row > SHEET_MAX_ROWS) /* Note: ">" is deliberate. */
......
......@@ -165,7 +165,7 @@ parse_cell_name (const char *cell_str, int *col, int *row)
/* Parse row number: a sequence of digits. */
for (*row = 0; *cell_str; cell_str++) {
if (!isdigit ((unsigned char)*cell_str))
if (*cell_str < '0' || *cell_str > '9')
return FALSE;
*row = *row * 10 + (*cell_str - '0');
if (*row > SHEET_MAX_ROWS) /* Note: ">" is deliberate. */
......
......@@ -1153,8 +1153,6 @@ workbook_parse_and_jump (Workbook *wb, const char *text)
{
int col, row;
col = row = 0;
if (!parse_cell_name (text, &col, &row)){
gnumeric_notice (wb, GNOME_MESSAGE_BOX_ERROR,
_("You should introduce a valid cell name"));
......@@ -1162,6 +1160,8 @@ workbook_parse_and_jump (Workbook *wb, const char *text)
} else {
Sheet *sheet = workbook_get_current_sheet (wb);
#if 0
/* This cannot happen anymore, see parse_cell_name. */
if (col > SHEET_MAX_COLS-1){
gnumeric_notice (wb, GNOME_MESSAGE_BOX_ERROR,
_("Column out of range"));
......@@ -1173,6 +1173,7 @@ workbook_parse_and_jump (Workbook *wb, const char *text)
_("Row number out of range"));
return FALSE;
}
#endif
sheet_make_cell_visible (sheet, col, row);
sheet_cursor_move (sheet, col, row);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment