0.17 Sat Nov 05 23:30:00 2004
[p5sagit/Excel-Template.git] / lib / Excel / Template / Container / Worksheet.pm
index 6a1edaf..b91dc15 100644 (file)
@@ -16,6 +16,12 @@ sub render
 
     $context->new_worksheet( $self );
 
+    my $password = $context->get( $self, 'PROTECT' );
+    if (defined $password)
+    {
+        $context->active_worksheet->protect( $password );
+    }
+
     return $self->SUPER::render($context);
 }
 
@@ -46,6 +52,13 @@ Excel::Template::Container
 
 This is the name of the worksheet to be added.
 
+=item * PROTECT
+
+If the attribute exists, it will mark the worksheet as being protected. Whatever
+value is set will be used as the password.
+
+This activates the HIDDEN and LOCKED nodes.
+
 =back 4
 
 =head1 CHILDREN