From ea978c5e248afa99bce132fc7161699f9fde0680 Mon Sep 17 00:00:00 2001 From: joshua Date: Fri, 1 Apr 2022 20:41:07 +0200 Subject: [PATCH] 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. --- sources/factory/qetgraphicstablefactory.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sources/factory/qetgraphicstablefactory.cpp b/sources/factory/qetgraphicstablefactory.cpp index e7bf988be..58d872139 100644 --- a/sources/factory/qetgraphicstablefactory.cpp +++ b/sources/factory/qetgraphicstablefactory.cpp @@ -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();