diff options
Diffstat (limited to 'commands/command_edit.cpp')
-rw-r--r-- | commands/command_edit.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/commands/command_edit.cpp b/commands/command_edit.cpp index 215f57899..7f4726a6b 100644 --- a/commands/command_edit.cpp +++ b/commands/command_edit.cpp @@ -887,7 +887,7 @@ void PasteDives::redo() } // ***** Paste ***** -ReplanDive::ReplanDive(dive *source) : d(current_dive), +ReplanDive::ReplanDive(dive *source, bool edit_profile) : d(current_dive), dc({ 0 }), notes(nullptr) { @@ -895,6 +895,10 @@ ReplanDive::ReplanDive(dive *source) : d(current_dive), if (!d) return; + // Fix source. Things might be inconsistent after modifying the profile. + source->maxdepth.mm = source->dc.maxdepth.mm = 0; + fixup_dive(source); + when = source->when; maxdepth = source->maxdepth; meandepth = source->meandepth; @@ -907,7 +911,7 @@ ReplanDive::ReplanDive(dive *source) : d(current_dive), std::swap(source->cylinders, cylinders); std::swap(source->dc, dc); - setText(tr("Replan dive")); + setText(edit_profile ? tr("Replan dive") : tr("Edit profile")); } ReplanDive::~ReplanDive() |