mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 20:50:34 +01:00
Fix Terminal Crash and corrected Terminal prefix behavior.
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4590 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -1202,6 +1202,7 @@ QString Conductor::text() const {
|
|||||||
* @return label with variables assigned
|
* @return label with variables assigned
|
||||||
*/
|
*/
|
||||||
QString Conductor::assignVariables(QString label) {
|
QString Conductor::assignVariables(QString label) {
|
||||||
|
if (diagram() == NULL) return label;
|
||||||
//Titleblock Variables
|
//Titleblock Variables
|
||||||
for (int i = 0; i < diagram()->border_and_titleblock.additionalFields().count(); i++)
|
for (int i = 0; i < diagram()->border_and_titleblock.additionalFields().count(); i++)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -309,7 +309,8 @@ void CustomElement::parseLabels() {
|
|||||||
prefix = rxml.readElementText();
|
prefix = rxml.readElementText();
|
||||||
DiagramContext &dc = this->rElementInformations();
|
DiagramContext &dc = this->rElementInformations();
|
||||||
//if there is a formula to assign, assign it
|
//if there is a formula to assign, assign it
|
||||||
if (!(location().project()->elementAutoNumFormula().isEmpty()) && (location().project()->elementAutoNumFormula() != "") && (this->linkType()!=Element::Slave)) {
|
if (!(location().project()->elementAutoNumFormula().isEmpty()) && (location().project()->elementAutoNumFormula() != "") &&
|
||||||
|
(this->linkType()!=Element::Slave) && (this->linkType()!=Element::Terminale)) {
|
||||||
QString formula = location().project()->elementAutoNumFormula();
|
QString formula = location().project()->elementAutoNumFormula();
|
||||||
this->setPrefix(prefix);
|
this->setPrefix(prefix);
|
||||||
dc.addValue("label", formula);
|
dc.addValue("label", formula);
|
||||||
@@ -317,7 +318,7 @@ void CustomElement::parseLabels() {
|
|||||||
} else { //assign only prefix
|
} else { //assign only prefix
|
||||||
this->setPrefix(prefix);
|
this->setPrefix(prefix);
|
||||||
dc.addValue("label", "%prefix");
|
dc.addValue("label", "%prefix");
|
||||||
this->setTaggedText("label", "%prefix");
|
this->setTaggedText("label", prefix);
|
||||||
}
|
}
|
||||||
this->setElementInformations(dc);
|
this->setElementInformations(dc);
|
||||||
return;
|
return;
|
||||||
@@ -337,7 +338,8 @@ void CustomElement::parseLabels() {
|
|||||||
}
|
}
|
||||||
//apply formula to specific label
|
//apply formula to specific label
|
||||||
else if ((this->taggedText("label")!= NULL) && (location().projectId()!=-1) &&
|
else if ((this->taggedText("label")!= NULL) && (location().projectId()!=-1) &&
|
||||||
(!location().project()->elementAutoNumFormula().isEmpty()) && (this->linkType()!=Element::Slave)) {
|
(!location().project()->elementAutoNumFormula().isEmpty()) &&
|
||||||
|
(this->linkType()!=Element::Slave) && (this->linkType()!=Element::Terminale)) {
|
||||||
QString formula = location().project()->elementAutoNumFormula();
|
QString formula = location().project()->elementAutoNumFormula();
|
||||||
DiagramContext &dc = this->rElementInformations();
|
DiagramContext &dc = this->rElementInformations();
|
||||||
QString prefix = this->taggedText("label")->toPlainText();
|
QString prefix = this->taggedText("label")->toPlainText();
|
||||||
|
|||||||
Reference in New Issue
Block a user