# HG changeset patch # User Sergey Plotnikov # Date 1392744115 -3600 # Node ID dca6ecfd622cfb0ab21492cd9ee86cba65d7d76a # Parent fb96b7f5524295c2e538106f6fe57746a8e12aba findobj.m: let leading negation work (bug #41588). * findobj.m: keep track of extranegation. diff -r fb96b7f55242 -r dca6ecfd622c scripts/plot/util/findobj.m --- a/scripts/plot/util/findobj.m Fri Feb 21 11:35:36 2014 -0500 +++ b/scripts/plot/util/findobj.m Tue Feb 18 18:21:55 2014 +0100 @@ -119,6 +119,7 @@ regularexpression = []; property = []; logicaloperator = {}; + extranegation = []; pname = {}; pvalue = {}; np = 1; @@ -128,6 +129,9 @@ while (na <= numel (args)) regularexpression(np) = 0; property(np) = 0; + if (numel (extranegation) < np) + extranegation(np) = false; + endif logicaloperator{np} = "and"; if (ischar (args{na})) if (strcmpi (args{na}, "-regexp")) @@ -177,10 +181,8 @@ error ("findobj: inconsistent number of arguments"); endif else - ## This is sloppy ... but works like Matlab. if (strcmpi (args{na}, "-not")) - h = []; - return; + extranegation(np) = true; endif na = na + 1; endif @@ -241,6 +243,9 @@ else match(nh,np) = false; endif + if (extranegation(np)) + match(nh,np) = ! match(nh,np); + endif endfor endfor