Add interact_day_item_copy()

This can be used to copy an item, so that it can be pasted somewhere
else later.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
This commit is contained in:
Lukas Fleischer 2012-07-04 09:43:30 +02:00
parent a9efce76f3
commit a3cf63b374
2 changed files with 13 additions and 0 deletions

View File

@ -723,6 +723,7 @@ void interact_day_item_pipe(void);
void interact_day_item_repeat(void); void interact_day_item_repeat(void);
void interact_day_item_cut_free(); void interact_day_item_cut_free();
void interact_day_item_cut(unsigned *, unsigned *); void interact_day_item_cut(unsigned *, unsigned *);
void interact_day_item_copy(unsigned *, unsigned *);
void interact_day_item_paste(unsigned *, unsigned *); void interact_day_item_paste(unsigned *, unsigned *);
void interact_todo_add(void); void interact_todo_add(void);
void interact_todo_delete(void); void interact_todo_delete(void);

View File

@ -926,6 +926,18 @@ void interact_day_item_cut(unsigned *nb_events, unsigned *nb_apoints)
apoint_hilt_set(0); apoint_hilt_set(0);
} }
/* Copy an item, so that it can be pasted somewhere else later. */
void interact_day_item_copy(unsigned *nb_events, unsigned *nb_apoints)
{
const int NBITEMS = *nb_apoints + *nb_events;
if (NBITEMS == 0)
return;
interact_day_item_cut_free();
day_item_fork(day_get_item(apoint_hilt()), &day_cut);
}
/* Paste a previously cut item. */ /* Paste a previously cut item. */
void interact_day_item_paste(unsigned *nb_events, unsigned *nb_apoints) void interact_day_item_paste(unsigned *nb_events, unsigned *nb_apoints)
{ {