From fce7ea48b0e742efcb2856c94130a63ed621448f Mon Sep 17 00:00:00 2001 From: "agrath@gmail.com" Date: Thu, 27 Jan 2011 13:07:10 -1300 Subject: [PATCH] Didn't test the AncestorOrSelf changes on a non-parent node. Changed implementation to call into Func to check Level == 1 Also fixed post-build rule on umbraco.MacroEngines which had an incorrect path for copying umbraco.MacroEngines to presentation (allows debug without manual file copy, I think) --- umbraco.MacroEngines.Juno/DynamicNode.cs | 23 +------------------ .../umbraco.MacroEngines.csproj | 2 +- 2 files changed, 2 insertions(+), 23 deletions(-) diff --git a/umbraco.MacroEngines.Juno/DynamicNode.cs b/umbraco.MacroEngines.Juno/DynamicNode.cs index d3db09139d..d198f6164c 100644 --- a/umbraco.MacroEngines.Juno/DynamicNode.cs +++ b/umbraco.MacroEngines.Juno/DynamicNode.cs @@ -249,28 +249,7 @@ namespace umbraco.MacroEngines } public DynamicNode AncestorOrSelf() { - var node = this; - while (node != null) - { - DynamicNode parent = node.Parent; - if (parent != null) - { - if (this != parent) - { - node = parent; - } - else - { - return node; - } - } - else - { - return node; - } - } - - return node; + return AncestorOrSelf(node => node.Level == 1); } public DynamicNode AncestorOrSelf(Func func) { diff --git a/umbraco.MacroEngines.Juno/umbraco.MacroEngines.csproj b/umbraco.MacroEngines.Juno/umbraco.MacroEngines.csproj index 24b354bdea..7f57d39be2 100644 --- a/umbraco.MacroEngines.Juno/umbraco.MacroEngines.csproj +++ b/umbraco.MacroEngines.Juno/umbraco.MacroEngines.csproj @@ -89,7 +89,7 @@ - xcopy "$(ProjectDir)bin\debug\umbraco.MacroEngines.*" "$(ProjectDir)..\presentation\bin\" /Y/F + xcopy "$(ProjectDir)bin\debug\umbraco.MacroEngines.*" "$(ProjectDir)..\umbraco\presentation\bin\" /Y/F