diff --git a/conducer.cpp b/conducer.cpp index b065ea7a4..1c206345b 100644 --- a/conducer.cpp +++ b/conducer.cpp @@ -841,7 +841,7 @@ bool Conducer::fromXml(QDomElement &e) { // initialise divers parametres lies a la modification des conducteurs modified_path = true; - saveProfile(); + saveProfile(false); segmentsToPath(); return(true); @@ -938,10 +938,11 @@ void Conducer::calculateTextItemPosition() { Sauvegarde le profil courant du conducteur pour l'utiliser ulterieurement dans priv_modifieConducer. */ -void Conducer::saveProfile() { +void Conducer::saveProfile(bool undo) { ConducerProfile old_profile = conducer_profile; conducer_profile.fromConducer(this); - if (Diagram *dia = diagram()) { + Diagram *dia = diagram(); + if (undo && dia) { dia -> undoStack().push(new ChangeConducerCommand(this, old_profile, conducer_profile)); } } diff --git a/conducer.h b/conducer.h index 2051ac248..8c3499451 100644 --- a/conducer.h +++ b/conducer.h @@ -73,7 +73,7 @@ class Conducer : public QGraphicsPathItem { private: void segmentsToPath(); - void saveProfile(); + void saveProfile(bool = true); void priv_calculeConducer(const QPointF &, QET::Orientation, const QPointF &, QET::Orientation); void priv_modifieConducer(const QPointF &, QET::Orientation, const QPointF &, QET::Orientation); uint nbSegments(QET::ConducerSegmentType = QET::Both) const;