[Spreadsheet] fix bug where duplicate / bad aliases were being allowed.

This commit is contained in:
mwganson
2020-03-10 19:00:31 -05:00
committed by wmayer
parent c337cfeec2
commit 520b5cc0aa

View File

@@ -338,17 +338,18 @@ void SheetView::editingFinished()
if (i.isValid()) {
QString str = ui->cellAlias->text();
bool aliasOkay = true;
if (str.length()!= 0 && !sheet->isValidAlias(Base::Tools::toStdString(str))){
Base::Console().Error("Unable to set alias: %s\n", Base::Tools::toStdString(str).c_str());
aliasOkay = false;
}
ui->cellAlias->setDocumentObject(sheet);
ui->cells->model()->setData(i, QVariant(ui->cellContent->text()), Qt::EditRole);
Cell * cell = sheet->getCell(CellAddress(i.row(), i.column()));
if (cell){
if (cell && aliasOkay){
cell->setAlias(str.toStdString());
}
ui->cells->setCurrentIndex(ui->cellContent->next());