mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[apps/sequence] Fix error in copy assignment of sequence
Change-Id: If27924c6001a8d7011371336ffbaf012f9d8bbc9
This commit is contained in:
@@ -63,13 +63,21 @@ Sequence::~Sequence() {
|
||||
}
|
||||
|
||||
Sequence& Sequence::operator=(const Sequence& other) {
|
||||
// Self-assignment is benign
|
||||
/* We temporarely store other's required features to be able to access them
|
||||
* after setType (which erase all contents and index buffer) even in case of
|
||||
* self assignement */
|
||||
const char * contentText = other.text();
|
||||
const char * firstInitialText = other.m_firstInitialConditionText;
|
||||
const char * secondInitialText = other.m_secondInitialConditionText;
|
||||
int indexBuffer0 = other.m_indexBuffer[0];
|
||||
int indexBuffer1 = other.m_indexBuffer[1];
|
||||
Function::operator=(other);
|
||||
setType(other.m_type);
|
||||
setFirstInitialConditionContent(other.m_firstInitialConditionText);
|
||||
setSecondInitialConditionContent(other.m_secondInitialConditionText);
|
||||
m_indexBuffer[0] = other.m_indexBuffer[0];
|
||||
m_indexBuffer[1] = other.m_indexBuffer[1];
|
||||
setContent(contentText);
|
||||
setFirstInitialConditionContent(firstInitialText);
|
||||
setSecondInitialConditionContent(secondInitialText);
|
||||
m_indexBuffer[0] = indexBuffer0;
|
||||
m_indexBuffer[1] = indexBuffer1;
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ Function::~Function() {
|
||||
}
|
||||
}
|
||||
|
||||
const char * Function::text() {
|
||||
const char * Function::text() const {
|
||||
return m_text;
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ public:
|
||||
Function& operator=(Function&& other) = delete;
|
||||
Function(const Function& other) = delete;
|
||||
Function(Function&& other) = delete;
|
||||
const char * text();
|
||||
const char * text() const;
|
||||
const char * name() const;
|
||||
KDColor color() const { return m_color; }
|
||||
Poincare::Expression * expression();
|
||||
|
||||
Reference in New Issue
Block a user