diff options
author | Andrés <andmarti@gmail.com> | 2021-06-12 16:16:07 -0300 |
---|---|---|
committer | Andrés <andmarti@gmail.com> | 2021-06-12 16:16:07 -0300 |
commit | 64ab1af93f151ac6bb51c520b76916e65444646a (patch) | |
tree | b6dd758eafa1d9683ef2eff1d702ecdc023d800f /src/undo.c | |
parent | 69f4b2d1345abe6235a776b9c1ff1e59272caa53 (diff) |
Fix in paste_yanked_ents when pasting (with Pv) over same place where data was yanked
Diffstat (limited to 'src/undo.c')
-rw-r--r-- | src/undo.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -469,7 +469,7 @@ void copy_to_undostruct (struct sheet * sh, int ri, int ci, int rf, int cf, char // and only if no destination pointer was given struct ent_ptr * y_cells = destination == NULL ? NULL : *destination; if (y_cells == NULL && handle_deps == HANDLE_DEPS && deps != NULL) - y_cells = (struct ent_ptr *) calloc((rf-ri+1)*(cf-ci+1)+deps->vf, sizeof(struct ent_ptr)); + y_cells = (struct ent_ptr *) calloc((rf-ri+1)*(cf-ci+1) + deps->vf, sizeof(struct ent_ptr)); else if (y_cells == NULL) y_cells = (struct ent_ptr *) calloc((rf-ri+1)*(cf-ci+1), sizeof(struct ent_ptr)); @@ -492,7 +492,8 @@ void copy_to_undostruct (struct sheet * sh, int ri, int ci, int rf, int cf, char if (ent_ptr_exists_on_list(lista, &e)) continue; // initialize the 'ent' - if (destination == NULL) y_cells->vp = malloc(sizeof(struct ent)); + //if (destination == NULL) y_cells->vp = malloc(sizeof(struct ent)); + y_cells->vp = malloc(sizeof(struct ent)); cleanent(y_cells->vp); y_cells->sheet = sh; @@ -522,7 +523,8 @@ void copy_to_undostruct (struct sheet * sh, int ri, int ci, int rf, int cf, char if (p == NULL) continue; // initialize the 'ent' - if (destination == NULL) y_cells->vp = malloc(sizeof(struct ent)); + //if (destination == NULL) y_cells->vp = malloc(sizeof(struct ent)); + y_cells->vp = malloc(sizeof(struct ent)); cleanent(y_cells->vp); y_cells->sheet = deps[i].sheet; |