[qet] [4686] Fix Undo(Ctrl+Z) crash related with conductor frozen label. |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/qet Archives
]
Revision: 4686
Author: dfochi
Date: 2016-09-04 20:14:26 +0200 (Sun, 04 Sep 2016)
Log Message:
-----------
Fix Undo(Ctrl+Z) crash related with conductor frozen label. Prevent freezing blank label in conductor
Modified Paths:
--------------
trunk/sources/qetgraphicsitem/conductor.cpp
Modified: trunk/sources/qetgraphicsitem/conductor.cpp
===================================================================
--- trunk/sources/qetgraphicsitem/conductor.cpp 2016-09-04 15:19:36 UTC (rev 4685)
+++ trunk/sources/qetgraphicsitem/conductor.cpp 2016-09-04 18:14:26 UTC (rev 4686)
@@ -1471,10 +1471,13 @@
}
setText(properties_.text);
text_item -> setFontSize(properties_.text_size);
- if (terminal1->diagram()->item_paste)
- m_frozen_label = "";
- else
- m_frozen_label = properties_.text;
+
+ if (terminal1 != NULL && terminal1->diagram() != NULL) {
+ if (terminal1->diagram()->item_paste)
+ m_frozen_label = "";
+ else
+ m_frozen_label = properties_.text;
+ }
if (freeze_label)
freezeLabel();
if (properties_.type != ConductorProperties::Multi)
@@ -1896,5 +1899,6 @@
*/
void Conductor::unfreezeLabel() {
this->setText(m_frozen_label);
+ if (m_frozen_label == "") return;
properties_.text = m_frozen_label;
}