Fix Undo(Ctrl+Z) crash related with conductor frozen label. Prevent freezing blank label in conductor

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4686 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
dfochi
2016-09-04 18:14:26 +00:00
parent a64840cb5f
commit 0f22bf4774

View File

@@ -1471,10 +1471,13 @@ void Conductor::setProperties(const ConductorProperties &properties)
} }
setText(properties_.text); setText(properties_.text);
text_item -> setFontSize(properties_.text_size); text_item -> setFontSize(properties_.text_size);
if (terminal1->diagram()->item_paste)
m_frozen_label = ""; if (terminal1 != NULL && terminal1->diagram() != NULL) {
else if (terminal1->diagram()->item_paste)
m_frozen_label = properties_.text; m_frozen_label = "";
else
m_frozen_label = properties_.text;
}
if (freeze_label) if (freeze_label)
freezeLabel(); freezeLabel();
if (properties_.type != ConductorProperties::Multi) if (properties_.type != ConductorProperties::Multi)
@@ -1896,5 +1899,6 @@ void Conductor::freezeLabel() {
*/ */
void Conductor::unfreezeLabel() { void Conductor::unfreezeLabel() {
this->setText(m_frozen_label); this->setText(m_frozen_label);
if (m_frozen_label == "") return;
properties_.text = m_frozen_label; properties_.text = m_frozen_label;
} }