From a3cf63b3748c5f42214d648f003933d5597a3a8d Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Wed, 4 Jul 2012 09:43:30 +0200 Subject: 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 --- src/interaction.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/interaction.c') diff --git a/src/interaction.c b/src/interaction.c index d3f2cef..abe261d 100644 --- a/src/interaction.c +++ b/src/interaction.c @@ -926,6 +926,18 @@ void interact_day_item_cut(unsigned *nb_events, unsigned *nb_apoints) 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. */ void interact_day_item_paste(unsigned *nb_events, unsigned *nb_apoints) { -- cgit v1.2.3-54-g00ecf