MCPcopy Create free account
hub / github.com/MITK/MITK / SetUndoLimit

Method SetUndoLimit

Modules/Core/src/Controllers/mitkLimitedLinearUndo.cpp:197–216  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

195}
196
197void mitk::LimitedLinearUndo::SetUndoLimit(std::size_t undoLimit)
198{
199 if (undoLimit != m_UndoLimit)
200 {
201 // 0 means "unlimited" in this case, so only trim when an actual (non-zero) limit is set
202 if (0 != undoLimit && m_UndoList.size() > undoLimit)
203 {
204 auto last = m_UndoList.end() - undoLimit;
205
206 // delete the owned items before dropping them from the list
207 for (auto iter = m_UndoList.begin(); iter != last; ++iter)
208 delete *iter;
209
210 m_UndoList.erase(m_UndoList.begin(), last);
211 }
212 m_UndoLimit = undoLimit;
213
214 InvokeEvent(UndoStackEvent());
215 }
216}
217
218int mitk::LimitedLinearUndo::GetLastObjectEventIdInList()
219{

Callers 5

UndoControllerMethod · 0.80
SwitchUndoModelMethod · 0.80
OnChangeLimitClickedMethod · 0.80
OnCheckLimitChangedMethod · 0.80
PerformOkMethod · 0.80

Calls 4

sizeMethod · 0.45
endMethod · 0.45
beginMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected