[apps/graph] Handle undefined function

Change-Id: Id26e0f81ba5c1446655f33b2c63f97ab5b684e41
This commit is contained in:
Émilie Feral
2016-10-20 16:00:11 +02:00
parent 5693b9f95f
commit e5ff8f65c3
10 changed files with 66 additions and 18 deletions

View File

@@ -4,6 +4,7 @@
namespace Graph {
Function::Function(const char * text, KDColor color) :
m_text(""),
m_name(text),
m_color(color),
m_expression(nullptr),
@@ -22,7 +23,10 @@ void Function::setContent(const char * c) {
if (m_layout != nullptr) {
delete m_layout;
}
m_layout = expression()->createLayout();
m_layout = nullptr;
if (m_expression) {
m_layout = expression()->createLayout();
}
}
void Function::setColor(KDColor color) {