Revert "Try Clazy fix-its"

Segfault on old Qt versions!
This reverts commit dba7caed30.
This commit is contained in:
Laurent Trinques
2025-02-14 16:17:58 +01:00
parent dba7caed30
commit 43f0107eb1
88 changed files with 409 additions and 512 deletions

View File

@@ -79,23 +79,23 @@ void DynamicElementTextItemEditor::apply()
deti_list << m_element.data()->dynamicTextItems();
for(ElementTextItemGroup *group : m_element.data()->textGroups())
deti_list << group->texts();
for (DynamicElementTextItem *deti : deti_list)
{
QUndoCommand *undo = m_model->undoForEditedText(deti);
for (DynamicElementTextItem* deti : std::as_const(deti_list))
if (undo->childCount() == 1)
{
QUndoCommand* undo = m_model->undoForEditedText(deti);
if (undo->childCount() == 1)
{
QPropertyUndoCommand* quc = new QPropertyUndoCommand(
static_cast<const QPropertyUndoCommand*>(undo->child(0)));
if (quc->text().isEmpty()) quc->setText(undo->text());
undo_list << quc;
delete undo;
}
else if (undo->childCount() > 1)
undo_list << undo;
else
delete undo;
QPropertyUndoCommand *quc = new QPropertyUndoCommand(static_cast<const QPropertyUndoCommand *>(undo->child(0)));
if (quc->text().isEmpty())
quc->setText(undo->text());
undo_list << quc;
delete undo;
}
else if(undo->childCount() > 1)
undo_list << undo;
else
delete undo;
}
//Get all texts groups of the edited element
@@ -127,7 +127,8 @@ void DynamicElementTextItemEditor::apply()
{
QUndoStack &us = m_element->diagram()->undoStack();
us.beginMacro(tr("Modifier des textes d'élément"));
for (QUndoCommand* quc : std::as_const(undo_list)) us.push(quc);
for (QUndoCommand *quc : undo_list)
us.push(quc);
us.endMacro();
}
}