[apps] Rule of 5 (2)

Change-Id: I62eebed201a9f61b3f89233fda4e714f0bab0db7
This commit is contained in:
Émilie Feral
2017-05-05 16:37:37 +02:00
parent 9564ddcc8c
commit 0dfbf3ade3
7 changed files with 43 additions and 11 deletions

View File

@@ -6,16 +6,25 @@ using namespace Poincare;
namespace Shared {
Function::Function(const char * text, KDColor color) :
Function::Function(const char * name, KDColor color) :
m_expression(nullptr),
m_text{0},
m_name(text),
m_name(name),
m_color(color),
m_layout(nullptr),
m_active(true)
{
}
Function& Function::operator=(const Function& other) {
// Self-assignment is benign
m_color = other.m_color;
m_name = other.m_name;
m_active = other.m_active;
setContent(other.m_text);
return *this;
}
void Function::setContent(const char * c) {
strlcpy(m_text, c, sizeof(m_text));
if (m_expression != nullptr) {