Skip to content
Snippets Groups Projects
Commit 922a393a authored by Harry Jeffery's avatar Harry Jeffery
Browse files

Refs #11094 Resolve Coverity issues in undo

parent 9cf4ee23
No related branches found
No related tags found
No related merge requests found
...@@ -8799,10 +8799,14 @@ void ApplicationWindow::undo() ...@@ -8799,10 +8799,14 @@ void ApplicationWindow::undo()
   
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
   
if (qobject_cast<Note*>(w)) auto note = dynamic_cast<Note*>(w);
dynamic_cast<Note*>(w)->editor()->undo(); auto matrix = dynamic_cast<Matrix*>(w);
else if (qobject_cast<Matrix*>(w)){
QUndoStack *stack = (dynamic_cast<Matrix*>(w))->undoStack(); if(note)
note->editor()->undo();
else if(matrix)
{
QUndoStack *stack = matrix->undoStack();
if (stack && stack->canUndo()) if (stack && stack->canUndo())
stack->undo(); stack->undo();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment