Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
GNOME
gnumeric
Commits
1ae8e0a9
Commit
1ae8e0a9
authored
Jun 21, 1999
by
Morten Welinder
Browse files
Misc. fixes.
parent
9232cb8e
Changes
8
Hide whitespace changes
Inline
Side-by-side
ChangeLog-1999-07-09
View file @
1ae8e0a9
1999-06-20 Morten Welinder <terra@diku.dk>
* src/fn-math.c (gnumeric_mod): Another try.
(gnumeric_int): Fix for negative numbers.
* src/sheet.c (sheet_set_text): Set value directly, not via text. Also
improve entry when a format is already set.
(sheet_cancel_pending_input): Fixed behavior of canceling a cell
entry. [From Bake Timmon.]
1999-06-18 Jukka-Pekka Iivonen <iivonen@iki.fi>
* samples/dbfuns.xls: Added new file for database functions.
...
...
ChangeLog-2000-02-23
View file @
1ae8e0a9
1999-06-20 Morten Welinder <terra@diku.dk>
* src/fn-math.c (gnumeric_mod): Another try.
(gnumeric_int): Fix for negative numbers.
* src/sheet.c (sheet_set_text): Set value directly, not via text. Also
improve entry when a format is already set.
(sheet_cancel_pending_input): Fixed behavior of canceling a cell
entry. [From Bake Timmon.]
1999-06-18 Jukka-Pekka Iivonen <iivonen@iki.fi>
* samples/dbfuns.xls: Added new file for database functions.
...
...
OChangeLog-1999-07-09
View file @
1ae8e0a9
1999-06-20 Morten Welinder <terra@diku.dk>
* src/fn-math.c (gnumeric_mod): Another try.
(gnumeric_int): Fix for negative numbers.
* src/sheet.c (sheet_set_text): Set value directly, not via text. Also
improve entry when a format is already set.
(sheet_cancel_pending_input): Fixed behavior of canceling a cell
entry. [From Bake Timmon.]
1999-06-18 Jukka-Pekka Iivonen <iivonen@iki.fi>
* samples/dbfuns.xls: Added new file for database functions.
...
...
OChangeLog-2000-02-23
View file @
1ae8e0a9
1999-06-20 Morten Welinder <terra@diku.dk>
* src/fn-math.c (gnumeric_mod): Another try.
(gnumeric_int): Fix for negative numbers.
* src/sheet.c (sheet_set_text): Set value directly, not via text. Also
improve entry when a format is already set.
(sheet_cancel_pending_input): Fixed behavior of canceling a cell
entry. [From Bake Timmon.]
1999-06-18 Jukka-Pekka Iivonen <iivonen@iki.fi>
* samples/dbfuns.xls: Added new file for database functions.
...
...
plugins/fn-math/functions.c
View file @
1ae8e0a9
...
...
@@ -943,13 +943,8 @@ static Value *
gnumeric_int
(
struct
FunctionDefinition
*
i
,
Value
*
argv
[],
char
**
error_string
)
{
float_t
t
;
/* FIXME: What about strings and empty cells? */
t
=
value_get_as_float
(
argv
[
0
]);
return
value_new_float
(
t
>
0
.
0
?
floor
(
t
)
:
ceil
(
t
));
return
value_new_float
(
floor
(
value_get_as_float
(
argv
[
0
])));
}
static
char
*
help_log
=
{
...
...
@@ -1098,7 +1093,7 @@ static char *help_mod = {
"@DESCRIPTION="
"Implements modulo arithmetic."
"Returns the remainder when divisor is divided into
abs(
number
)
."
"Returns the remainder when
@
divisor is divided into
@
number."
"
\n
"
"Returns #DIV/0! if divisor is zero."
"@SEEALSO=INT,FLOOR,CEIL"
)
...
...
@@ -1112,27 +1107,24 @@ gnumeric_mod (struct FunctionDefinition *i,
a
=
value_get_as_int
(
argv
[
0
]);
b
=
value_get_as_int
(
argv
[
1
]);
/* Obscure handling of C's mod function */
if
(
a
<
0
)
a
=
-
a
;
if
(
a
<
0
){
/* -0 */
*
error_string
=
gnumeric_err_
NUM
;
if
(
b
==
0
)
{
*
error_string
=
gnumeric_err_
DIV0
;
return
NULL
;
}
if
(
b
<
0
){
if
(
b
<
0
)
{
a
=
-
a
;
b
=
-
b
;
}
if
(
b
<
0
)
{
/* -0 */
*
error_string
=
gnumeric_err_NUM
;
return
NULL
;
}
if
(
b
==
0
)
{
*
error_string
=
gnumeric_err_DIV0
;
return
NULL
;
/* FIXME: check for overflow. */
}
return
value_new_int
(
a
%
b
);
if
(
a
>=
0
)
return
value_new_int
(
a
%
b
);
else
{
int
invres
=
(
-
a
)
%
b
;
return
value_new_int
(
invres
==
0
?
0
:
b
-
invres
);
}
}
static
char
*
help_radians
=
{
...
...
src/fn-math.c
View file @
1ae8e0a9
...
...
@@ -943,13 +943,8 @@ static Value *
gnumeric_int
(
struct
FunctionDefinition
*
i
,
Value
*
argv
[],
char
**
error_string
)
{
float_t
t
;
/* FIXME: What about strings and empty cells? */
t
=
value_get_as_float
(
argv
[
0
]);
return
value_new_float
(
t
>
0
.
0
?
floor
(
t
)
:
ceil
(
t
));
return
value_new_float
(
floor
(
value_get_as_float
(
argv
[
0
])));
}
static
char
*
help_log
=
{
...
...
@@ -1098,7 +1093,7 @@ static char *help_mod = {
"@DESCRIPTION="
"Implements modulo arithmetic."
"Returns the remainder when divisor is divided into
abs(
number
)
."
"Returns the remainder when
@
divisor is divided into
@
number."
"
\n
"
"Returns #DIV/0! if divisor is zero."
"@SEEALSO=INT,FLOOR,CEIL"
)
...
...
@@ -1112,27 +1107,24 @@ gnumeric_mod (struct FunctionDefinition *i,
a
=
value_get_as_int
(
argv
[
0
]);
b
=
value_get_as_int
(
argv
[
1
]);
/* Obscure handling of C's mod function */
if
(
a
<
0
)
a
=
-
a
;
if
(
a
<
0
){
/* -0 */
*
error_string
=
gnumeric_err_
NUM
;
if
(
b
==
0
)
{
*
error_string
=
gnumeric_err_
DIV0
;
return
NULL
;
}
if
(
b
<
0
){
if
(
b
<
0
)
{
a
=
-
a
;
b
=
-
b
;
}
if
(
b
<
0
)
{
/* -0 */
*
error_string
=
gnumeric_err_NUM
;
return
NULL
;
}
if
(
b
==
0
)
{
*
error_string
=
gnumeric_err_DIV0
;
return
NULL
;
/* FIXME: check for overflow. */
}
return
value_new_int
(
a
%
b
);
if
(
a
>=
0
)
return
value_new_int
(
a
%
b
);
else
{
int
invres
=
(
-
a
)
%
b
;
return
value_new_int
(
invres
==
0
?
0
:
b
-
invres
);
}
}
static
char
*
help_radians
=
{
...
...
src/functions/fn-math.c
View file @
1ae8e0a9
...
...
@@ -943,13 +943,8 @@ static Value *
gnumeric_int
(
struct
FunctionDefinition
*
i
,
Value
*
argv
[],
char
**
error_string
)
{
float_t
t
;
/* FIXME: What about strings and empty cells? */
t
=
value_get_as_float
(
argv
[
0
]);
return
value_new_float
(
t
>
0
.
0
?
floor
(
t
)
:
ceil
(
t
));
return
value_new_float
(
floor
(
value_get_as_float
(
argv
[
0
])));
}
static
char
*
help_log
=
{
...
...
@@ -1098,7 +1093,7 @@ static char *help_mod = {
"@DESCRIPTION="
"Implements modulo arithmetic."
"Returns the remainder when divisor is divided into
abs(
number
)
."
"Returns the remainder when
@
divisor is divided into
@
number."
"
\n
"
"Returns #DIV/0! if divisor is zero."
"@SEEALSO=INT,FLOOR,CEIL"
)
...
...
@@ -1112,27 +1107,24 @@ gnumeric_mod (struct FunctionDefinition *i,
a
=
value_get_as_int
(
argv
[
0
]);
b
=
value_get_as_int
(
argv
[
1
]);
/* Obscure handling of C's mod function */
if
(
a
<
0
)
a
=
-
a
;
if
(
a
<
0
){
/* -0 */
*
error_string
=
gnumeric_err_
NUM
;
if
(
b
==
0
)
{
*
error_string
=
gnumeric_err_
DIV0
;
return
NULL
;
}
if
(
b
<
0
){
if
(
b
<
0
)
{
a
=
-
a
;
b
=
-
b
;
}
if
(
b
<
0
)
{
/* -0 */
*
error_string
=
gnumeric_err_NUM
;
return
NULL
;
}
if
(
b
==
0
)
{
*
error_string
=
gnumeric_err_DIV0
;
return
NULL
;
/* FIXME: check for overflow. */
}
return
value_new_int
(
a
%
b
);
if
(
a
>=
0
)
return
value_new_int
(
a
%
b
);
else
{
int
invres
=
(
-
a
)
%
b
;
return
value_new_int
(
invres
==
0
?
0
:
b
-
invres
);
}
}
static
char
*
help_radians
=
{
...
...
src/sheet.c
View file @
1ae8e0a9
...
...
@@ -729,7 +729,7 @@ sheet_set_text (Sheet *sheet, int col, int row, const char *str)
* a rendered version of the text, if they compare equally, then
* use that.
*/
if
(
!
CELL_IS_FORMAT_SET
(
cell
)
&&
*
text
!=
'='
)
{
if
(
*
text
!=
'='
)
{
char
*
end
,
*
format
;
double
v
;
...
...
@@ -741,22 +741,21 @@ sheet_set_text (Sheet *sheet, int col, int row, const char *str)
}
else
if
(
format_match
(
text
,
&
v
,
&
format
))
{
StyleFormat
*
sf
;
char
*
new_text
;
char
buffer
[
50
];
Value
*
vf
=
value_new_float
(
v
);
/* Render it */
sf
=
style_format_new
(
format
);
new_text
=
format_value
(
sf
,
vf
,
NULL
);
value_release
(
vf
);
style_format_unref
(
sf
);
/* Compare it */
if
(
strcasecmp
(
new_text
,
text
)
==
0
){
cell_set_format_simple
(
cell
,
format
);
sprintf
(
buffer
,
"%f"
,
v
);
cell_set_
text
(
cell
,
buffer
);
if
(
!
CELL_IS_FORMAT_SET
(
cell
))
cell_set_format_simple
(
cell
,
format
);
cell_set_
value
(
cell
,
vf
);
text_set
=
TRUE
;
}
}
else
value_release
(
vf
);
g_free
(
new_text
);
}
}
...
...
@@ -840,6 +839,7 @@ sheet_cancel_pending_input (Sheet *sheet)
gnumeric_sheet_destroy_editing_cursor
(
gsheet
);
}
sheet
->
editing
=
FALSE
;
}
void
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment