mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Edit: use correct offset when changing dive times
The undo-work reversed the direction of the offset. This was apparently only fixed when using the menu entry, but not when editing dives directly. Invert the offset to get the correct time. While doing so, remove a redundant if: First it checked whether the dates are the same, then whether the offset is non-zero. Fixes #1975. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
736941870a
commit
a3a1a74d1f
1 changed files with 3 additions and 5 deletions
|
|
@ -903,12 +903,10 @@ void MainTab::acceptChanges()
|
|||
}
|
||||
}
|
||||
|
||||
if (displayed_dive.when != cd->when) {
|
||||
timestamp_t offset = cd->when - displayed_dive.when;
|
||||
timestamp_t offset = displayed_dive.when - cd->when;
|
||||
if (offset)
|
||||
Command::shiftTime(selectedDives, (int)offset);
|
||||
}
|
||||
}
|
||||
if (editMode != TRIP && current_dive->divetrip) {
|
||||
current_dive->divetrip->when = current_dive->when;
|
||||
find_new_trip_start_time(current_dive->divetrip);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue