summaryrefslogtreecommitdiffstats
path: root/dive.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2014-08-16 18:33:09 -0600
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-08-16 18:34:27 -0600
commit4a7432e3d512977437afa3933cc242b6410b468a (patch)
tree9e6a59e1d5443e8cc8594082c51d03281add58ac /dive.c
parent3766f57392bc8e315afe14b7640982e50cdd5529 (diff)
downloadsubsurface-4a7432e3d512977437afa3933cc242b6410b468a.tar.gz
Don't always clear the dive before selectively copying
This will be needed when pasting the data back into a (set of) dive(s). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'dive.c')
-rw-r--r--dive.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/dive.c b/dive.c
index 88233d394..38599b104 100644
--- a/dive.c
+++ b/dive.c
@@ -426,9 +426,10 @@ struct dive *clone_dive(struct dive *s)
d->_component = copy_string(s->_component)
// copy elements, depending on bits in what that are set
-void selective_copy_dive(struct dive *s, struct dive *d, struct dive_components what)
+void selective_copy_dive(struct dive *s, struct dive *d, struct dive_components what, bool clear)
{
- clear_dive(d);
+ if (clear)
+ clear_dive(d);
CONDITIONAL_COPY_STRING(location);
CONDITIONAL_COPY_STRING(notes);
CONDITIONAL_COPY_STRING(divemaster);
@@ -502,6 +503,7 @@ void copy_cylinders(struct dive *s, struct dive *d, bool used_only)
d->cylinder[i].type = s->cylinder[i].type;
d->cylinder[i].gasmix = s->cylinder[i].gasmix;
d->cylinder[i].depth = s->cylinder[i].depth;
+ d->cylinder[i].manually_added = true;
}
}
}