mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-18 13:30:34 +01:00
Conductor: when delete conductor, if option one text/folio is enable, and the curent conductor own the displayed text,
We upate other conductor text item at the same potential, to keep text always visible. git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@3359 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -267,30 +267,46 @@ void DeleteElementsCommand::undo() {
|
||||
}
|
||||
}
|
||||
|
||||
/// refait les suppressions
|
||||
/**
|
||||
* @brief DeleteElementsCommand::redo
|
||||
* Redo the delete command
|
||||
*/
|
||||
void DeleteElementsCommand::redo() {
|
||||
diagram -> showMe();
|
||||
// enleve les conducteurs
|
||||
|
||||
// Remove Conductor
|
||||
foreach(Conductor *c, removed_content.conductors(DiagramContent::AnyConductor)) {
|
||||
diagram -> removeConductor(c);
|
||||
|
||||
//If option one text per folio is enable, and the text item of
|
||||
//current conductor is visible (that mean the conductor own the single displayed text)
|
||||
//We call adjustTextItemPosition to other conductor at the same potential to keep
|
||||
//a visible text on this potential.
|
||||
if (diagram -> defaultConductorProperties.m_one_text_per_folio && c -> textItem() -> isVisible()) {
|
||||
QList <Conductor *> conductor_list;
|
||||
conductor_list << c -> relatedPotentialConductors(false).toList();
|
||||
if (conductor_list.count()) {
|
||||
conductor_list.first() -> adjustTextItemPosition();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// enleve les elements
|
||||
// Remove elements
|
||||
foreach(Element *e, removed_content.elements) {
|
||||
diagram -> removeElement(e);
|
||||
}
|
||||
|
||||
// enleve les textes
|
||||
// Remove texts
|
||||
foreach(IndependentTextItem *t, removed_content.textFields) {
|
||||
diagram -> removeIndependentTextItem(t);
|
||||
}
|
||||
|
||||
//enleve les images
|
||||
// Remove images
|
||||
foreach(DiagramImageItem *dii, removed_content.images) {
|
||||
diagram -> removeItem(dii);
|
||||
}
|
||||
|
||||
//enleve les shapes
|
||||
// Remove shapes
|
||||
foreach(QetShapeItem *dsi, removed_content.shapes) {
|
||||
diagram -> removeItem(dsi);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user