From 25b46def1713ca066042e5b1d4f583a52cb46377 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Wed, 7 Apr 2021 23:22:16 +0200 Subject: [PATCH] Disallow zero columns and rows count for AREFs --- src/edt/edt/edtInstPropertiesPage.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/edt/edt/edtInstPropertiesPage.cc b/src/edt/edt/edtInstPropertiesPage.cc index 2360211db..4034061fe 100644 --- a/src/edt/edt/edtInstPropertiesPage.cc +++ b/src/edt/edt/edtInstPropertiesPage.cc @@ -542,6 +542,9 @@ InstPropertiesPage::create_applicator (db::Cell & /*cell*/, const db::Instance & try { tl::from_string (tl::to_string (rows_le->text ()), rows); + if (rows < 1) { + throw tl::Exception (tl::to_string (tr ("Rows count can't be zero"))); + } lay::indicate_error (rows_le, (tl::Exception *) 0); } catch (tl::Exception &ex) { lay::indicate_error (rows_le, &ex); @@ -550,6 +553,9 @@ InstPropertiesPage::create_applicator (db::Cell & /*cell*/, const db::Instance & try { tl::from_string (tl::to_string (columns_le->text ()), cols); + if (cols < 1) { + throw tl::Exception (tl::to_string (tr ("Columns count can't be zero"))); + } lay::indicate_error (columns_le, (tl::Exception *) 0); } catch (tl::Exception &ex) { lay::indicate_error (columns_le, &ex);