Bug 282777 - Implement index() xpath function. Patch by aaronr@us.ibm.com, r=sicking, beaufour

git-svn-id: svn://10.0.0.236/trunk@169651 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
doronr%us.ibm.com
2005-02-23 17:17:47 +00:00
parent 5acf9b32d1
commit ae629dc37d
4 changed files with 52 additions and 4 deletions

View File

@@ -46,6 +46,7 @@
#include "nsIXFormsModelElement.h"
#include "nsIDOMNodeList.h"
#include "nsIInstanceElementPrivate.h"
#include "nsIXFormsRepeatElement.h"
NS_IMPL_ISUPPORTS1(nsXFormsUtilityService, nsIXFormsUtilityService)
@@ -223,3 +224,15 @@ nsXFormsUtilityService::ValidateString(const nsAString & aValue,
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP
nsXFormsUtilityService::GetRepeatIndex(nsIDOMNode *aRepeat, PRUint32 *aIndex)
{
NS_ASSERTION(aIndex, "no return buffer for index, we'll crash soon");
*aIndex = 0;
nsCOMPtr<nsIXFormsRepeatElement> repeatEle = do_QueryInterface(aRepeat);
NS_ENSURE_TRUE(repeatEle, NS_ERROR_NULL_POINTER);
return repeatEle->GetIndex(aIndex);
}