Fix a funny bug

When we create a summary table and uncheck the option "adjust the size
of the table to the folio" an infinity of new diagram are added to the
project.
This commit is contained in:
joshua
2022-04-01 20:41:07 +02:00
parent 5925c227ab
commit ea978c5e24

View File

@@ -79,10 +79,9 @@ void QetGraphicsTableFactory::create(Diagram *diagram, AddTableDialog *dialog)
}
//Add new table if needed and option checked
dialog->addNewTableToNewDiagram();
table_->model()->rowCount();
table_->displayNRow();
if (dialog->addNewTableToNewDiagram() && table_->model()->rowCount() > table_->displayNRow())
if (dialog->addNewTableToNewDiagram()
&& table_->displayNRow() > 0
&& table_->model()->rowCount() > table_->displayNRow())
{
auto already_displayed_rows = table_->displayNRow();
auto project_ = diagram->project();