subsurface/commands
Berthold Stoeger e761d00ddd undo: don't add dive to null-trip
In moveDiveToTrip(), the dive was first removed from its old trip
and then added to the new trip. This function is also used to
remove the dive from its trip (by moving it to the "null-trip"
if you whish). Even in that case add_dive_to_trip() was called.
The only reason why this didn't crash is that add_dive_to_trip()
checks whether old and new trip are the same. This is the case
when adding to the "null-trip", since the dive was removed from
the trip just before.

To cut a long story short, to trust on add_dive_to_trip() not
crashing if moving from the null-trip to the null-trip is
way to subtly. If we remove a dive from its trip, don't call
add_dive_to_trip() in the first place.

Reported-by: Dirk Hohndel <dirk@hohndel.org>
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-02-19 19:49:30 -08:00
..
CMakeLists.txt Selection: move commands/command_private.* to core/selection.* 2019-12-04 13:00:23 +01:00
command.cpp core: read and write the user-specified salinity 2020-01-06 07:00:34 +09:00
command.h Cleanup: remove const bool parameters and return types 2020-02-09 12:13:18 -08:00
command_base.cpp Cleanup: lower-case filenames in core/subsurface-qt/ 2020-02-04 02:16:46 +01:00
command_base.h Refactoring: move undo commands to top level 2019-11-14 21:02:07 +01:00
command_divelist.cpp undo: don't add dive to null-trip 2020-02-19 19:49:30 -08:00
command_divelist.h Refactoring: move undo commands to top level 2019-11-14 21:02:07 +01:00
command_divesite.cpp Cleanup: lower-case filenames in core/subsurface-qt/ 2020-02-04 02:16:46 +01:00
command_divesite.h Refactoring: move undo commands to top level 2019-11-14 21:02:07 +01:00
command_edit.cpp code cleanup: remove unused member variable 2020-01-10 02:37:03 +09:00
command_edit.h Cleanup: lower-case filenames in core/subsurface-qt/ 2020-02-04 02:16:46 +01:00
command_edit_trip.cpp Selection: move commands/command_private.* to core/selection.* 2019-12-04 13:00:23 +01:00
command_edit_trip.h Cleanup: lower-case filenames in core/subsurface-qt/ 2020-02-04 02:16:46 +01:00