From: dpvc v. a. <we...@ma...> - 2008-09-23 21:58:33
|
Log Message: ----------- Handle the no-inherit values better by deleting them from the copy before inserting the ones from the original hash. That way, you don't lose your copies of those values, you just don't inherit from the given objects. Modified Files: -------------- pg/lib: Value.pm Revision Data ------------- Index: Value.pm =================================================================== RCS file: /webwork/cvs/system/pg/lib/Value.pm,v retrieving revision 1.96 retrieving revision 1.97 diff -Llib/Value.pm -Llib/Value.pm -u -r1.96 -r1.97 --- lib/Value.pm +++ lib/Value.pm @@ -598,8 +598,9 @@ # sub inherit { my $self = shift; - $self = bless {(map {%$_} @_),%$self}, ref($self); - foreach my $id ($self->noinherit) {delete $self->{$id}}; + my %copy = (map {%$_} @_); # copy values from given objects + foreach my $id ($self->noinherit) {delete $copy{$id}} + $self = bless {%copy,%$self}, ref($self); return $self; } |