[gnumeric] Complaltion: fix str.h related problems.
- From: Morten Welinder <mortenw src gnome org>
- To: svn-commits-list gnome org
- Subject: [gnumeric] Complaltion: fix str.h related problems.
- Date: Mon, 8 Jun 2009 09:48:53 -0400 (EDT)
commit fde230421e567ff3c45ef4877d6433d563111e0c
Author: Morten Welinder <terra gnome org>
Date: Mon Jun 8 09:48:27 2009 -0400
Complaltion: fix str.h related problems.
---
plugins/perl-loader/ChangeLog | 5 +++++
plugins/perl-loader/perl-gnumeric.c | 34 ++++++++++++++++++----------------
plugins/perl-loader/perl-gnumeric.h | 1 -
3 files changed, 23 insertions(+), 17 deletions(-)
diff --git a/plugins/perl-loader/ChangeLog b/plugins/perl-loader/ChangeLog
index e413848..e9c827f 100644
--- a/plugins/perl-loader/ChangeLog
+++ b/plugins/perl-loader/ChangeLog
@@ -1,3 +1,8 @@
+2009-06-08 Morten Welinder <terra gnome org>
+
+ * perl-gnumeric.c (value2perl): Don't try to look inside strings
+ directly.
+
2009-05-23 Morten Welinder <terra gnome org>
* Release 1.9.8
diff --git a/plugins/perl-loader/perl-gnumeric.c b/plugins/perl-loader/perl-gnumeric.c
index decd1ca..d341f63 100644
--- a/plugins/perl-loader/perl-gnumeric.c
+++ b/plugins/perl-loader/perl-gnumeric.c
@@ -3,26 +3,28 @@
SV *
value2perl(const GnmValue *v)
{
- SV *sv;
-
- switch (v->type) {
- case VALUE_BOOLEAN:
- sv = newSViv(v->v_bool.val);
- break;
-
- case VALUE_FLOAT:
- sv = newSVnv(value_get_as_float (v));
- break;
-
- case VALUE_STRING:
- sv = newSVpv(v->v_str.val->str, strlen(v->v_str.val->str));
- break;
-
- default:
- sv = NULL;
- break;
- }
- return sv;
+ SV *sv;
+
+ switch (v->type) {
+ case VALUE_BOOLEAN:
+ sv = newSViv(v->v_bool.val);
+ break;
+
+ case VALUE_FLOAT:
+ sv = newSVnv(value_get_as_float (v));
+ break;
+
+ case VALUE_STRING: {
+ const char *s = value_peek_string (v);
+ sv = newSVpv(s,strlen(s));
+ break;
+ }
+
+ default:
+ sv = NULL;
+ break;
+ }
+ return sv;
}
GnmValue *
diff --git a/plugins/perl-loader/perl-gnumeric.h b/plugins/perl-loader/perl-gnumeric.h
index e07bc16..0cc198b 100644
--- a/plugins/perl-loader/perl-gnumeric.h
+++ b/plugins/perl-loader/perl-gnumeric.h
@@ -31,7 +31,6 @@ typedef FILE * OutputStream;
#include <expr.h>
#include <func.h>
#include <value.h>
-#include <str.h>
SV* value2perl(const GnmValue *v);
GnmValue* perl2value(SV *sv);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]