mirror of https://github.com/KLayout/klayout.git
Porting 930586110 to 0.26 (problem with hidden undo)
This commit is contained in:
parent
e724dcdb45
commit
d383f4a413
|
|
@ -146,15 +146,24 @@ Manager::last_transaction_id () const
|
|||
void
|
||||
Manager::cancel ()
|
||||
{
|
||||
// equivalent to commit and undo. But takes care that an empty commit is not followed by undo
|
||||
// (which would undo the previous transaction!)
|
||||
if (db::transactions_enabled ()) {
|
||||
|
||||
// commit and undo - revert changes done so far
|
||||
commit ();
|
||||
undo ();
|
||||
tl_assert (m_opened);
|
||||
tl_assert (! m_replay);
|
||||
m_opened = false;
|
||||
|
||||
// delete all following transactions
|
||||
erase_transactions (m_current, m_transactions.end ());
|
||||
m_current = m_transactions.end ();
|
||||
if (m_current->first.begin () != m_current->first.end ()) {
|
||||
|
||||
++m_current;
|
||||
undo ();
|
||||
|
||||
} else {
|
||||
// empty transactions .. just delete
|
||||
erase_transactions (m_current, m_transactions.end ());
|
||||
m_current = m_transactions.end ();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue