src/addObjectDialog.cpp

changeset 958
1dc890c73e01
parent 952
f116b63c4844
child 959
737245eee433
--- a/src/addObjectDialog.cpp	Sun Aug 30 03:52:03 2015 +0300
+++ b/src/addObjectDialog.cpp	Sun Aug 30 04:21:44 2015 +0300
@@ -301,7 +301,8 @@
 	Matrix transform = IdentityMatrix;
 	AddObjectDialog dlg (type, obj);
 
-	assert (obj == null or obj->type() == type);
+	if (obj and obj->type() != type)
+		return;
 
 	if (dlg.exec() == QDialog::Rejected)
 		return;
@@ -355,8 +356,8 @@
 		case OBJ_BFC:
 		{
 			LDBFC* bfc = InitObject<LDBFC> (obj);
-			assert (IsWithin (dlg.rb_bfcType->value(), 0, int (BFCStatement::NumValues) - 1));
-			bfc->setStatement (BFCStatement (dlg.rb_bfcType->value()));
+			if (IsWithin (dlg.rb_bfcType->value(), 0, int (BFCStatement::NumValues) - 1))
+				bfc->setStatement (BFCStatement (dlg.rb_bfcType->value()));
 		} break;
 
 		case OBJ_Vertex:
@@ -382,7 +383,6 @@
 			}
 
 			LDSubfile* ref = InitObject<LDSubfile> (obj);
-			assert (ref);
 
 			for_axes (ax)
 				ref->setCoordinate (ax, dlg.dsb_coords[ax]->value());

mercurial