From 8126b8c6887ea079798c138c1e78a5a38f45f4ef Mon Sep 17 00:00:00 2001 From: Matthew Dawson Date: Tue, 19 Jun 2012 18:33:06 +0000 Subject: [PATCH] Fix issues with out of bounds issues. Fix some other issues. git-svn-id: https://groke.mcmaster.ca/svn/grad/colin/trunk/TableTool@8566 57e6efec-57d4-0310-aeb1-a6c144bb1a8b --- @CVC_checker/generate_file.m | 2 +- @GUI/check_grid_condition.m | 10 ++++++---- @PVS_checker/pvs_check_for_imports_g.m | 10 ++++++---- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/@CVC_checker/generate_file.m b/@CVC_checker/generate_file.m index 953a581..68990c4 100644 --- a/@CVC_checker/generate_file.m +++ b/@CVC_checker/generate_file.m @@ -39,7 +39,7 @@ if size(object.data.Grid2.cells,2) > 1 end code = [code new_code]; -if size(object.data.Grid1.cells,2) > 1 +if object.data.multi_mode == 0 && size(object.data.Grid1.cells,2) > 1 [new_code,new_queries] = CVC_checker.generate_cvc_grid(object.data.Grid1,size(queries,2)); queries = [queries new_queries]; code = [code new_code]; diff --git a/@GUI/check_grid_condition.m b/@GUI/check_grid_condition.m index 8b0fb7c..e21eec6 100644 --- a/@GUI/check_grid_condition.m +++ b/@GUI/check_grid_condition.m @@ -17,11 +17,13 @@ for i = 1:size(grid.cells,2) error = ''; string = get(grid.cells(i).cond,'String'); - s = [string(1,:)]; - for j = 2:size(string,1) - s = [s ' ' string(j,:)]; + if size(string) > 0 + s = [string(1,:)]; + for j = 2:size(string,1) + s = [s ' ' string(j,:)]; + end + string = s; end - string = s; if ( strcmp(string,'') || isempty(string)) && i == 1 && isempty(grid.parent_grid) && size(grid.cells,2) == 1 break; diff --git a/@PVS_checker/pvs_check_for_imports_g.m b/@PVS_checker/pvs_check_for_imports_g.m index 5970431..f49e9d6 100644 --- a/@PVS_checker/pvs_check_for_imports_g.m +++ b/@PVS_checker/pvs_check_for_imports_g.m @@ -24,11 +24,13 @@ for i=1:size(grid.cells,2) end text = char(grid.cells(i).cond_text); - s = [text(1,:)]; - for j = 2:size(text,1) - s = [s ' ' text(j,:)]; + if size(text) > 0 + s = [text(1,:)]; + for j = 2:size(text,1) + s = [s ' ' text(j,:)]; + end + text = s; end - text = s; vars = regexp(text,'([a-zA-Z][a-zA-Z0-9_]*)','match'); -- GitLab