minor fix

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@5087 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
blacksun
2017-10-27 18:44:37 +00:00
parent e2a49e4872
commit 5bb0a3f0a3

View File

@@ -896,6 +896,12 @@ void DynamicElementTextItem::updateReportText()
}
}
/**
* @brief DynamicElementTextItem::updateLabel
* Update the displayed text, when this dynamic text is based on the label of the parent element.
* This function is notably use when the label itself is based from a formula.
* If this dynamic text isn't based on label, this function do nothing.
*/
void DynamicElementTextItem::updateLabel()
{
if ((m_text_from == ElementInfo && m_info_name == "label") ||
@@ -908,7 +914,12 @@ void DynamicElementTextItem::updateLabel()
Element *element = elementUseForInfo();
if(m_text_from == ElementInfo)
{
if(dc.value("formula").toString().isEmpty())
setPlainText(dc.value("label").toString());
else
setPlainText(autonum::AssignVariables::formulaToLabel(dc.value("formula").toString(), element->rSequenceStruct(), element->diagram(), element));
}
else if (m_text_from == CompositeText)
setPlainText(autonum::AssignVariables::replaceVariable(m_composite_text, dc));
}