[shared] Fix StorageFunction

This commit is contained in:
Émilie Feral
2018-10-10 09:42:59 +02:00
parent 072e52ae85
commit 1cd5145d3f
2 changed files with 2 additions and 5 deletions

View File

@@ -30,12 +30,12 @@ void StorageFunction::setColor(KDColor color) {
template<typename T>
T StorageFunction::templatedApproximateAtAbscissa(T x, Poincare::Context * context) const {
return reducedExpression(context).approximateWithValueForSymbol(symbol(), x, *context, Preferences::sharedPreferences()->angleUnit());
return expression(context).approximateWithValueForSymbol(symbol(), x, *context, Preferences::sharedPreferences()->angleUnit());
}
StorageFunction::FunctionRecordData * StorageFunction::recordData() const {
assert(!record().isNull());
Ion::Storage::Record::Data d = record().value();
Ion::Storage::Record::Data d = value();
return reinterpret_cast<FunctionRecordData *>(const_cast<void *>(d.buffer));
}

View File

@@ -10,7 +10,6 @@ namespace Shared {
class StorageFunction : public StorageExpressionModel {
public:
// Constructors
StorageFunction(const char * name = nullptr) : StorageExpressionModel(name) {}
StorageFunction(Ion::Storage::Record record) : StorageExpressionModel(record){}
// Checksum
@@ -43,8 +42,6 @@ protected:
bool m_active;
};
private:
constexpr static size_t k_dataLengthInBytes = (TextField::maxBufferSize()+2)*sizeof(char)+2;
static_assert((k_dataLengthInBytes & 0x3) == 0, "The function data size is not a multiple of 4 bytes (cannot compute crc)"); // Assert that dataLengthInBytes is a multiple of 4
template<typename T> T templatedApproximateAtAbscissa(T x, Poincare::Context * context) const;
FunctionRecordData * recordData() const;
virtual const char * symbol() const = 0;