diff options
author | andmarti1424 <scim.spreadsheet@gmail.com> | 2016-07-03 10:30:25 -0300 |
---|---|---|
committer | andmarti1424 <scim.spreadsheet@gmail.com> | 2016-07-03 10:30:25 -0300 |
commit | cdcbcd884c10e7883471a6dd1ce5a06bd5bfd373 (patch) | |
tree | 51b779c053cd0379c30a5a9f02f81f14b79ef76d | |
parent | acfb6613421b95a72a5a556b7cdecc9f264fa127 (diff) |
Fix bug with cmd_multiplier. Thanks to @mcrucifix
-rw-r--r-- | src/cmds_normal.c | 19 | ||||
-rw-r--r-- | src/sc.h | 1 |
2 files changed, 16 insertions, 4 deletions
diff --git a/src/cmds_normal.c b/src/cmds_normal.c index 02a5afd..17e9789 100644 --- a/src/cmds_normal.c +++ b/src/cmds_normal.c @@ -33,13 +33,25 @@ void do_normalmode(struct block * buf) { struct ent * e; switch (buf->value) { - // TEST + /* TEST case L'A': { struct ent * p = *ATBL(tbl, currow, curcol); if (!p) return; char det[20000] = ""; - sprintf(det + strlen(det), "r:%d\nc:%d\nenode null:%d\n", p->row, p->col, p->expr == NULL); + sprintf(det + strlen(det), "r:%d\nc:%d\nexpr null:%d\n", p->row, p->col, p->expr == NULL); + if (p && p->expr != NULL && p->expr->e.v.vp != NULL) { + sprintf(det + strlen(det), "vp null:%d\n", p->expr->e.v.vp == NULL); + sprintf(det + strlen(det), "vp row:%d\n", p->expr->e.v.vp->row); + sprintf(det + strlen(det), "vp col:%d\n", p->expr->e.v.vp->col); + //sprintf(det + strlen(det), "vp vf:%f\n", p->expr->e.v.vf); + } + if (p && p->expr != NULL && p->expr->e.o.right != NULL && p->expr->e.o.right->e.v.vp != NULL) { + sprintf(det + strlen(det), "vp null:%d\n", p->expr->e.o.right->e.v.vp == NULL); + sprintf(det + strlen(det), "vp row:%d\n", p->expr->e.o.right->e.v.vp->row); + sprintf(det + strlen(det), "vp col:%d\n", p->expr->e.o.right->e.v.vp->col); + // sprintf(det + strlen(det), "vp vf:%f\n", p->expr->e.o.right->e.v.vf); + } show_text((char *) &det); } break; @@ -51,6 +63,7 @@ void do_normalmode(struct block * buf) { rebuild_graph(); break; + */ @@ -495,7 +508,7 @@ void do_normalmode(struct block * buf) { #ifdef UNDO create_undo_action(); #endif - for (c1 = curcol; cmd_multiplier-- && c1 < maxcols; c1++) { + for (c1 = curcol; cmd_multiplier-- && cmd_multiplier > -1 && c1 < maxcols; c1++) { if ((n = * ATBL(tbl, currow, c1))) { if (n->flags & is_locked) continue; @@ -120,7 +120,6 @@ struct enode { struct range_s r; /* op is on a range */ struct ent_ptr v; /* ref. another cell on which this enode depends */ - //struct ent_ptr x; /* ref to cells that depends on this enode */ } e; }; |