wisest owl (wisest_owl) wrote in changelog,
wisest owl
wisest_owl
changelog

[s2] r205: LJSUP-13267: Some improvements for prope...

Committer: wisest-owl
LJSUP-13267: Some improvements for properties of S2-layers
U   trunk/S2/NodeProperty.pm
U   trunk/S2.pm
Modified: trunk/S2/NodeProperty.pm
===================================================================
--- trunk/S2/NodeProperty.pm	2012-05-23 11:01:29 UTC (rev 204)
+++ trunk/S2/NodeProperty.pm	2012-08-15 08:46:27 UTC (rev 205)
@@ -84,9 +84,9 @@
     my ($this, $l, $ck) = @_;
 
     if ($this->{'use'}) {
-        unless ($l->getType() eq "layout") {
-            S2::error($this, "Can't declare property usage in non-layout layer");
-        }
+        #unless ($l->getType() eq "layout") {
+        #    S2::error($this, "Can't declare property usage in non-layout layer");
+        #}
         unless ($ck->propertyType($this->{'uhName'})) {
             S2::error($this, "Can't declare usage of non-existent property");
         }

Modified: trunk/S2.pm
===================================================================
--- trunk/S2.pm	2012-05-23 11:01:29 UTC (rev 204)
+++ trunk/S2.pm	2012-08-15 08:46:27 UTC (rev 205)
@@ -290,6 +290,7 @@
 {
     my ($lid, $propname) = @_;
     push @{$Domains{$CurrentDomain}{layerprops}{$lid}}, $propname;
+    $Domains{$CurrentDomain}{layerpropuse}{$lid}->{$propname} = 1;
 }
 
 sub register_property_hide
@@ -320,6 +321,15 @@
     return 0;
 }
 
+sub is_property_use
+{
+    my ($lids, $propname) = @_;
+    foreach (@$lids) {
+        return 1 if $Domains{$CurrentDomain}{layerpropuse}{$_}->{$propname};
+    }
+    return 0;
+}
+
 sub get_property
 {
     my ($lid, $propname) = @_;

Tags: pm, s2, wisest-owl
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments