summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndrés <andmarti@gmail.com>2021-06-10 08:54:44 -0300
committerAndrés <andmarti@gmail.com>2021-06-10 08:54:44 -0300
commit63a9b705fe8cc60deb27ebc6882f7c5d0d51cf4c (patch)
treec010b14feb774ebce8402fa9dd18c29a20744697 /src
parent2ecabd824ccd7c45b0d3626037e42b6703b02af7 (diff)
work on issue #569
Diffstat (limited to 'src')
-rw-r--r--src/cmds/cmds.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/cmds/cmds.c b/src/cmds/cmds.c
index 53fda36..2ddcd03 100644
--- a/src/cmds/cmds.c
+++ b/src/cmds/cmds.c
@@ -213,7 +213,10 @@ void syncref(struct sheet * sh, struct enode * e) {
void deletecol(struct sheet * sh, int col, int mult) {
struct roman * roman = session->cur_doc;
- if (any_locked_cells(sh, 0, col, sh->maxrow, col + mult)) {
+ if (col + mult > sh->maxcols) {
+ sc_error("current column + multiplier exceeds max column. Nothing changed");
+ return;
+ } else if (any_locked_cells(sh, 0, col, sh->maxrow, col + mult)) {
sc_error("Locked cells encountered. Nothing changed");
return;
}
@@ -898,7 +901,10 @@ void insert_col(struct sheet * sh, int after) {
*/
void deleterow(struct sheet * sh, int row, int mult) {
struct roman * roman = session->cur_doc;
- if (any_locked_cells(sh, row, 0, row + mult - 1, sh->maxcol)) {
+ if (row + mult - 1 > sh->maxrows) {
+ sc_error("current row + multiplier exceeds max row. Nothing changed");
+ return;
+ } else if (any_locked_cells(sh, row, 0, row + mult - 1, sh->maxcol)) {
sc_error("Locked cells encountered. Nothing changed");
return;
}