changeset 150:4369d5458bb6

minor fixes
author wizard
date Fri, 20 Aug 2010 08:28:43 +0400
parents b04e978d6d5a
children e36ffd8c29db
files Lib/IMPL/Web/TT/Collection.pm Lib/IMPL/Web/TT/Document.pm
diffstat 2 files changed, 12 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/Lib/IMPL/Web/TT/Collection.pm	Wed Aug 18 03:14:57 2010 +0400
+++ b/Lib/IMPL/Web/TT/Collection.pm	Fri Aug 20 08:28:43 2010 +0400
@@ -12,13 +12,14 @@
 	
 	return if $method eq 'DESTROY';
 	
-	if ($method =~ /^add(\w+)/) {
-		my ($name,$args) = @_;
-		return $this->appendChild($this->document->CreateControl($name,$1,$args));
-	}
-	
 	if ( @_ >= 1 ) {
 		# set
+		
+		if ($method =~ /^add(\w+)/) {
+			my ($name,$args) = @_;
+			return $this->appendChild($this->document->CreateControl($name,$1,$args));
+		}
+		
 		# we can't assing a node, so this is a dynamic property
 		return $this->nodeProperty($method,@_);
 	} else {
@@ -31,10 +32,10 @@
 			my @result = $this->selectNodes($method);
 	
 			return $result[0] if @result;
-			return;
 		}
 	}
-	die new IMPL::Exception("We shoud never get here, this is a bug!!!");
+	
+	return;
 }
 
 sub as_list {
--- a/Lib/IMPL/Web/TT/Document.pm	Wed Aug 18 03:14:57 2010 +0400
+++ b/Lib/IMPL/Web/TT/Document.pm	Fri Aug 20 08:28:43 2010 +0400
@@ -11,6 +11,7 @@
 use IMPL::Web::TT::Collection;
 use IMPL::Web::TT::Control;
 use Carp;
+use Encode();
 
 BEGIN {
     private property _provider => prop_all;
@@ -77,6 +78,9 @@
                     this => $this,
                     render => sub {
                     	$this->_process(@_);
+                    },
+                    encode => sub {
+                    	Encode::encode('utf8',shift);
                     }
                 },
                 RECURSION => 1,