[gnumeric] sc import: support GOTO
- From: Andreas J. Guelzow <guelzow src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] sc import: support GOTO
- Date: Fri, 8 Oct 2010 18:20:26 +0000 (UTC)
commit 67a4555e4434dd4838e57f2bb606e65febf5e455
Author: Andreas J Guelzow <aguelzow pyrshep ca>
Date: Fri Oct 8 12:19:17 2010 -0600
sc import: support GOTO
2010-10-08 Andreas J. Guelzow <aguelzow pyrshep ca>
* sc.c (sc_parse_goto): new
(sc_cmd_list): connect sc_parse_goto
plugins/sc/ChangeLog | 5 +++++
plugins/sc/sc.c | 21 +++++++++++++++++++++
2 files changed, 26 insertions(+), 0 deletions(-)
---
diff --git a/plugins/sc/ChangeLog b/plugins/sc/ChangeLog
index 6b34f38..3329ed9 100644
--- a/plugins/sc/ChangeLog
+++ b/plugins/sc/ChangeLog
@@ -1,5 +1,10 @@
2010-10-08 Andreas J. Guelzow <aguelzow pyrshep ca>
+ * sc.c (sc_parse_goto): new
+ (sc_cmd_list): connect sc_parse_goto
+
+2010-10-08 Andreas J. Guelzow <aguelzow pyrshep ca>
+
* sc.c (sc_parse_coord_real): new, former part of sc_parse_coord
(sc_parse_coord): use sc_parse_coord_real
(sc_parse_fmt): new
diff --git a/plugins/sc/sc.c b/plugins/sc/sc.c
index 69018a6..05817ba 100644
--- a/plugins/sc/sc.c
+++ b/plugins/sc/sc.c
@@ -39,6 +39,8 @@
#include "expr.h"
#include "expr-name.h"
#include "func.h"
+#include "sheet-view.h"
+#include "selection.h"
#include <gsf/gsf-input.h>
#include <gsf/gsf-input-textline.h>
@@ -286,6 +288,24 @@ set_h_align (Sheet *sheet, GnmCellPos const *pos, GnmHAlign ha)
}
static gboolean
+sc_parse_goto (ScParseState *state, char const *cmd, char const *str,
+ GnmCellPos const *cpos)
+{
+ GnmCellPos pos = { -1, -1 };
+ gboolean res;
+
+ res = sc_parse_coord_real (state, str, &pos, strlen (str));
+ if (!res)
+ return FALSE;
+
+ SHEET_FOREACH_VIEW(state->sheet, sv,
+ sv_selection_set
+ (sv, &pos, pos.col, pos.row, pos.col, pos.row););
+
+ return TRUE;
+}
+
+static gboolean
sc_parse_fmt (ScParseState *state, char const *cmd, char const *str,
GnmCellPos const *cpos)
{
@@ -612,6 +632,7 @@ static sc_cmd_t const sc_cmd_list[] = {
{ "let", 3, sc_parse_let, TRUE },
{ "define", 6, sc_parse_define, FALSE },
{ "fmt", 3, sc_parse_fmt, FALSE },
+ { "goto", 4, sc_parse_goto, FALSE },
{ NULL, 0, NULL, 0 },
};
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]