Ignore:
Timestamp:
Mar 16, 2024, 10:22:34 AM (20 months ago)
Author:
Frederik Heber <frederik.heber@…>
Branches:
Candidate_v1.7.0, stable
Children:
19832d
Parents:
ad0929
git-author:
Frederik Heber <frederik.heber@…> (03/16/24 09:26:59)
git-committer:
Frederik Heber <frederik.heber@…> (03/16/24 10:22:34)
Message:

BondifyAction: added undo/redo.

  • DOC: fixed small typo in Action's explanation.
  • TEST: added regression test (also undo/redo).
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Bond/BondInfo.cpp

    rad0929 r9782e20  
    8585}
    8686
    87 void BondInfo::RemoveBond() const
     87bool BondInfo::RemoveBond() const
    8888{
    8989  atom * const leftatom = World::getInstance().getAtom(AtomById(leftid));
    9090  atom * const rightatom = World::getInstance().getAtom(AtomById(rightid));
    91   leftatom->removeBond(rightatom);
     91  if (leftatom->IsBondedTo(rightatom)) {
     92    leftatom->removeBond(rightatom);
     93    return true;
     94  }
     95  return false;
    9296}
Note: See TracChangeset for help on using the changeset viewer.