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:
blacksun
2014-10-06 08:33:17 +00:00
parent 663968686d
commit 171a7f3a6b

View File

@@ -267,30 +267,46 @@ void DeleteElementsCommand::undo() {
} }
} }
/// refait les suppressions /**
* @brief DeleteElementsCommand::redo
* Redo the delete command
*/
void DeleteElementsCommand::redo() { void DeleteElementsCommand::redo() {
diagram -> showMe(); diagram -> showMe();
// enleve les conducteurs
// Remove Conductor
foreach(Conductor *c, removed_content.conductors(DiagramContent::AnyConductor)) { foreach(Conductor *c, removed_content.conductors(DiagramContent::AnyConductor)) {
diagram -> removeConductor(c); 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) { foreach(Element *e, removed_content.elements) {
diagram -> removeElement(e); diagram -> removeElement(e);
} }
// enleve les textes // Remove texts
foreach(IndependentTextItem *t, removed_content.textFields) { foreach(IndependentTextItem *t, removed_content.textFields) {
diagram -> removeIndependentTextItem(t); diagram -> removeIndependentTextItem(t);
} }
//enleve les images // Remove images
foreach(DiagramImageItem *dii, removed_content.images) { foreach(DiagramImageItem *dii, removed_content.images) {
diagram -> removeItem(dii); diagram -> removeItem(dii);
} }
//enleve les shapes // Remove shapes
foreach(QetShapeItem *dsi, removed_content.shapes) { foreach(QetShapeItem *dsi, removed_content.shapes) {
diagram -> removeItem(dsi); diagram -> removeItem(dsi);
} }