Compact allocating and pushing of commands

This commit is contained in:
G.K.MacGregor
2021-05-02 12:36:37 +01:00
parent 1a7e5aff5f
commit 7a0dbcca2b
3 changed files with 7 additions and 14 deletions

View File

@@ -384,8 +384,7 @@ void TeletextWidget::setCharacter(unsigned char newCharacter)
void TeletextWidget::toggleCharacterBit(unsigned char bitToToggle)
{
QUndoCommand *toggleMosaicBitCommand = new ToggleMosaicBitCommand(m_teletextDocument, bitToToggle);
m_teletextDocument->undoStack()->push(toggleMosaicBitCommand);
m_teletextDocument->undoStack()->push(new ToggleMosaicBitCommand(m_teletextDocument, bitToToggle));
}
QPair<int, int> TeletextWidget::mouseToRowAndColumn(const QPoint &mousePosition)