diff --git a/CommonData/column.cpp b/CommonData/column.cpp index 4b5fbde2f4..3395c7b7e9 100644 --- a/CommonData/column.cpp +++ b/CommonData/column.cpp @@ -1821,9 +1821,9 @@ void Column::labelsOrderByValue(bool doDbUpdateEtc) static double dummy; for(Label * label : labels()) - if(!label->isEmptyValue() && !(label->originalValue().isDouble() || ColumnUtils::getDoubleValue(label->originalValueAsString(), dummy))) + if(!label->isEmptyValue()) { - replaceAllDoubles = true; + replaceAllDoubles = true; // because if there is any label at all it will show up at the end after the doubles without a Label. If this label is a double and the same as the label we could try to turn it back into a non-Label. But it still would break for Labels with a double value and a non-double label. So instead lets just make a label for everything. We keep the doubles only if there are only doubles. This should speed up a lot of operations for massive double datasets so its worth the extra hassle I guess. Just like you, who just read to the end of this line that really really breaks the 80's guideline of 80 characterwide code ;) break; } diff --git a/Desktop/data/computedcolumnmodel.cpp b/Desktop/data/computedcolumnmodel.cpp index 831bc283c5..f5fb6693eb 100644 --- a/Desktop/data/computedcolumnmodel.cpp +++ b/Desktop/data/computedcolumnmodel.cpp @@ -264,7 +264,7 @@ void ComputedColumnModel::recomputeColumn(QString columnName) std::string colName = fq(columnName); Column * col = dataSet()->column(colName); - if(col && col->isComputed() && col->codeType() != computedColumnType::analysis && col->codeType() == computedColumnType::analysisNotComputed) + if(col && col->isComputed() && col->codeType() == computedColumnType::analysisNotComputed) DataSetPackage::pkg()->columnSetDefaultValues(colName); checkForDependentColumnsToBeSent(columnName, col && col->isComputed()); @@ -295,23 +295,23 @@ void ComputedColumnModel::checkForDependentColumnsToBeSent(QString columnNameQ, void ComputedColumnModel::checkForDependentAnalyses(const std::string & columnName) { Analyses::analyses()->applyToAll([&](Analysis * analysis) - { - stringset usedCols = analysis->usedVariables(), - createdCols = analysis->createdVariables(); + { + stringset usedCols = analysis->usedVariables(), + createdCols = analysis->createdVariables(); - //Dont create an infinite loop please, but do this only for non-computed columns created by an analysis (aka distributions, because otherwise it breaks things like planning from audit) - if(usedCols.count(columnName) && (!createdCols.count(columnName) || !DataSetPackage::pkg()->isColumnAnalysisNotComputed(columnName))) - { - bool allColsValidated = true; + //Dont create an infinite loop please, but do this only for non-computed columns created by an analysis (aka distributions, because otherwise it breaks things like planning from audit) + if(usedCols.count(columnName) && (!createdCols.count(columnName) || !DataSetPackage::pkg()->isColumnAnalysisNotComputed(columnName))) + { + bool allColsValidated = true; - for(Column * col : computedColumns()) - if(usedCols.count(col->name()) > 0 && col->invalidated()) - allColsValidated = false; + for(Column * col : computedColumns()) + if(usedCols.count(col->name()) > 0 && col->invalidated()) + allColsValidated = false; - if(allColsValidated) - analysis->refresh(); - } - }); + if(allColsValidated) + analysis->refresh(); + } + }); } void ComputedColumnModel::removeColumn()