diff --git a/sources/ui/dynamicelementtextmodel.cpp b/sources/ui/dynamicelementtextmodel.cpp index f319b6efe..dcc7b1746 100644 --- a/sources/ui/dynamicelementtextmodel.cpp +++ b/sources/ui/dynamicelementtextmodel.cpp @@ -466,13 +466,6 @@ QUndoCommand *DynamicElementTextModel::undoForEditedText(DynamicElementTextItem new QPropertyUndoCommand(deti, "compositeText", QVariant(deti->compositeText()), QVariant(composite_text), undo); } - Qt::Alignment alignment = text_qsi->child(align_txt_row, 1)->data(Qt::UserRole+2).value(); - if (alignment != deti->alignment()) - { - QPropertyUndoCommand *quc = new QPropertyUndoCommand(deti, "alignment", QVariant(deti->alignment()), QVariant(alignment), undo); - quc->setText(tr("Modifier l'alignement d'un texte d'élément")); - } - int fs = text_qsi->child(size_txt_row,1)->data(Qt::EditRole).toInt(); if (fs != deti->fontSize()) { @@ -527,6 +520,17 @@ QUndoCommand *DynamicElementTextModel::undoForEditedText(DynamicElementTextItem quc->setText(tr("Pivoter un texte d'élément")); } } + + //When text is in a groupe, they're isn't item for alignment of the text + if(text_qsi->child(align_txt_row, 1)) + { + Qt::Alignment alignment = text_qsi->child(align_txt_row, 1)->data(Qt::UserRole+2).value(); + if (alignment != deti->alignment()) + { + QPropertyUndoCommand *quc = new QPropertyUndoCommand(deti, "alignment", QVariant(deti->alignment()), QVariant(alignment), undo); + quc->setText(tr("Modifier l'alignement d'un texte d'élément")); + } + } return undo; }