Bug 321175, change nsTemplateRule::GetAction to return nsIContent, r+sr=jonas

This commit is contained in:
Neil Deakin 2008-12-19 08:43:24 -05:00
parent 016928536d
commit f5177ae51d
4 changed files with 4 additions and 23 deletions

View File

@ -314,14 +314,6 @@ nsTemplateRule::~nsTemplateRule()
}
}
nsresult
nsTemplateRule::GetAction(nsIContent** aAction) const
{
*aAction = mAction;
NS_IF_ADDREF(*aAction);
return NS_OK;
}
nsresult
nsTemplateRule::GetRuleNode(nsIDOMNode** aRuleNode) const
{

View File

@ -149,11 +149,8 @@ public:
* Return the <action> node that this rule was constructed from, or its
* logical equivalent for shorthand syntaxes. That is, the parent node of
* the content that should be generated for this rule.
* @param aAction an out parameter, which will contain the content node
* that this rule uses to generated content
* @return NS_OK if no errors occur.
*/
nsresult GetAction(nsIContent** aAction) const;
nsIContent* GetAction() const { return mAction; }
/**
* Return the <rule> content node that this rule was constructed from.

View File

@ -1233,9 +1233,7 @@ nsXULContentBuilder::CreateContainerContentsForQuerySet(nsIContent* aElement,
}
// Grab the template node
nsCOMPtr<nsIContent> action;
matchedrule->GetAction(getter_AddRefs(action));
nsCOMPtr<nsIContent> action = matchedrule->GetAction();
BuildContentFromTemplate(action, aElement, aElement, PR_TRUE,
mRefVariable == matchedrule->GetMemberVariable(),
nextresult, aNotify, newmatch,
@ -1707,9 +1705,7 @@ nsXULContentBuilder::ReplaceMatch(nsIXULTemplateResult* aOldResult,
}
if (aNewMatch) {
nsCOMPtr<nsIContent> action;
aNewMatchRule->GetAction(getter_AddRefs(action));
nsCOMPtr<nsIContent> action = aNewMatchRule->GetAction();
return BuildContentFromTemplate(action, content, content, PR_TRUE,
mRefVariable == aNewMatchRule->GetMemberVariable(),
aNewMatch->mResult, PR_TRUE, aNewMatch,

View File

@ -1400,8 +1400,6 @@ nsXULTreeBuilder::GetTemplateActionRowFor(PRInt32 aRow, nsIContent** aResult)
// generate text
nsTreeRows::Row& row = *(mRows[aRow]);
nsCOMPtr<nsIContent> action;
// The match stores the indices of the rule and query to use. Use these
// to look up the right nsTemplateRule and use that rule's action to get
// the treerow in the template.
@ -1410,10 +1408,8 @@ nsXULTreeBuilder::GetTemplateActionRowFor(PRInt32 aRow, nsIContent** aResult)
nsTemplateQuerySet* qs = mQuerySets[row.mMatch->QuerySetPriority()];
nsTemplateRule* rule = qs->GetRuleAt(ruleindex);
if (rule) {
rule->GetAction(getter_AddRefs(action));
nsCOMPtr<nsIContent> children;
nsXULContentUtils::FindChildByTag(action, kNameSpaceID_XUL,
nsXULContentUtils::FindChildByTag(rule->GetAction(), kNameSpaceID_XUL,
nsGkAtoms::treechildren,
getter_AddRefs(children));
if (children) {