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
9d582c5512
commit
68b5493c14
1 changed files with 3 additions and 5 deletions
|
@ -892,11 +892,9 @@ void MainTab::acceptChanges()
|
|||
}
|
||||
}
|
||||
|
||||
if (displayed_dive.when != cd->when) {
|
||||
timestamp_t offset = cd->when - displayed_dive.when;
|
||||
if (offset)
|
||||
Command::shiftTime(selectedDives, (int)offset);
|
||||
}
|
||||
timestamp_t offset = displayed_dive.when - cd->when;
|
||||
if (offset)
|
||||
Command::shiftTime(selectedDives, (int)offset);
|
||||
}
|
||||
if (editMode == MANUALLY_ADDED_DIVE) {
|
||||
// we just added or edited the dive, let fixup_dive() make
|
||||
|
|
Loading…
Add table
Reference in a new issue