Skip to content

Commit

Permalink
Workspace emptyvalues must have default values
Browse files Browse the repository at this point in the history
When loading a 0.18.1 JASP file, the workspace default values are empty.
They should be set to the preferences empty values as default (since there is no workspace empty values in 0.18.1).
In DataSet::setEmptyValuesJson, there was already an handling to overcome this issue, but as DataSet has no access to the PreferencesModel object, it was depending of setting the _defaultEmptyvalues property just after the DataSet was created. But as DataSet might be deleted and created several times, the _defaultEmptyvalues is not always set. So just make it a static property, so that it just has to be set once.
  • Loading branch information
boutinb committed Dec 14, 2023
1 parent e16e1c5 commit 597f617
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CommonData/dataset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#include <regex>
#include "databaseinterface.h"

stringset DataSet::_defaultEmptyvalues;

DataSet::DataSet(int index)
: DataSetBaseNode(dataSetBaseNodeType::dataSet, nullptr)
{
Expand Down
2 changes: 1 addition & 1 deletion CommonData/dataset.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class DataSet : public DataSetBaseNode
EmptyValues _emptyValues;
bool _writeBatchedToDB = false,
_dataFileSynch = false;
stringset _defaultEmptyvalues; // Default empty values if workspace do not have its own empty values (used for backward compatibility)
static stringset _defaultEmptyvalues; // Default empty values if workspace do not have its own empty values (used for backward compatibility)
std::string _description;
};

Expand Down

0 comments on commit 597f617

Please sign in to comment.