[qet] [4590] Fix Terminal Crash and corrected Terminal prefix behavior.

[ Thread Index | Date Index | More lists.tuxfamily.org/qet Archives ]


Revision: 4590
Author:   dfochi
Date:     2016-07-25 16:17:54 +0200 (Mon, 25 Jul 2016)
Log Message:
-----------
Fix Terminal Crash and corrected Terminal prefix behavior.

Modified Paths:
--------------
    trunk/sources/qetgraphicsitem/conductor.cpp
    trunk/sources/qetgraphicsitem/customelement.cpp

Modified: trunk/sources/qetgraphicsitem/conductor.cpp
===================================================================
--- trunk/sources/qetgraphicsitem/conductor.cpp	2016-07-25 03:15:51 UTC (rev 4589)
+++ trunk/sources/qetgraphicsitem/conductor.cpp	2016-07-25 14:17:54 UTC (rev 4590)
@@ -1202,6 +1202,7 @@
  * @return label with variables assigned
  */
 QString Conductor::assignVariables(QString label) {
+	if (diagram() == NULL) return label;
 	//Titleblock Variables
 		for (int i = 0; i < diagram()->border_and_titleblock.additionalFields().count(); i++)
 	{

Modified: trunk/sources/qetgraphicsitem/customelement.cpp
===================================================================
--- trunk/sources/qetgraphicsitem/customelement.cpp	2016-07-25 03:15:51 UTC (rev 4589)
+++ trunk/sources/qetgraphicsitem/customelement.cpp	2016-07-25 14:17:54 UTC (rev 4590)
@@ -309,7 +309,8 @@
 								prefix = rxml.readElementText();
 								DiagramContext &dc = this->rElementInformations();
 								//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();
 									this->setPrefix(prefix);
 									dc.addValue("label", formula);
@@ -317,7 +318,7 @@
 								} else { //assign only prefix
 									this->setPrefix(prefix);
 									dc.addValue("label", "%prefix");
-									this->setTaggedText("label", "%prefix");
+									this->setTaggedText("label", prefix);
 								}
 								this->setElementInformations(dc);
 								return;
@@ -337,7 +338,8 @@
 	}
 	//apply formula to specific label
 	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();
 		DiagramContext &dc = this->rElementInformations();
 		QString prefix = this->taggedText("label")->toPlainText();


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/