mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-09 08:48:07 +00:00
Bug 73865.
Changes to RDF outliner, needed for folder outliner. r=waterson sr=ben
This commit is contained in:
parent
83b5567333
commit
0336388aa1
@ -115,7 +115,12 @@ interface nsIXULOutlinerBuilder : nsISupports
|
||||
/**
|
||||
* Retrieve the RDF resource associated with the specified row.
|
||||
*/
|
||||
nsIRDFResource getResourceFor(in long aRowIndex);
|
||||
nsIRDFResource getResourceAtIndex(in long aRowIndex);
|
||||
|
||||
/**
|
||||
* Retrieve the index associated with specified RDF resource.
|
||||
*/
|
||||
long getIndexOfResource(in nsIRDFResource resource);
|
||||
|
||||
/**
|
||||
* Add a Outliner Builder Observer to handle Outliner View
|
||||
|
@ -83,11 +83,7 @@ nsOutlinerRows::iterator
|
||||
nsOutlinerRows::First()
|
||||
{
|
||||
iterator result;
|
||||
Subtree* current = &mRoot;
|
||||
while (current && current->Count()) {
|
||||
result.Push(current, 0);
|
||||
current = GetSubtreeFor(current, 0);
|
||||
}
|
||||
result.Push(&mRoot, 0);
|
||||
result.SetRowIndex(0);
|
||||
return result;
|
||||
}
|
||||
|
@ -83,11 +83,7 @@ nsOutlinerRows::iterator
|
||||
nsOutlinerRows::First()
|
||||
{
|
||||
iterator result;
|
||||
Subtree* current = &mRoot;
|
||||
while (current && current->Count()) {
|
||||
result.Push(current, 0);
|
||||
current = GetSubtreeFor(current, 0);
|
||||
}
|
||||
result.Push(&mRoot, 0);
|
||||
result.SetRowIndex(0);
|
||||
return result;
|
||||
}
|
||||
|
@ -326,12 +326,23 @@ nsXULOutlinerBuilder::~nsXULOutlinerBuilder()
|
||||
//
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsXULOutlinerBuilder::GetResourceFor(PRInt32 aRowIndex, nsIRDFResource** aResult)
|
||||
nsXULOutlinerBuilder::GetResourceAtIndex(PRInt32 aRowIndex, nsIRDFResource** aResult)
|
||||
{
|
||||
if (aRowIndex < 0 || aRowIndex >= mRows.Count())
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
|
||||
*aResult = GetResourceFor(aRowIndex);
|
||||
NS_IF_ADDREF(*aResult = GetResourceFor(aRowIndex));
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsXULOutlinerBuilder::GetIndexOfResource(nsIRDFResource* aResource, PRInt32* aResult)
|
||||
{
|
||||
nsOutlinerRows::iterator iter = mRows.Find(mConflictSet, aResource);
|
||||
if (iter == mRows.Last())
|
||||
*aResult = -1;
|
||||
else
|
||||
*aResult = iter.GetRowIndex();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -326,12 +326,23 @@ nsXULOutlinerBuilder::~nsXULOutlinerBuilder()
|
||||
//
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsXULOutlinerBuilder::GetResourceFor(PRInt32 aRowIndex, nsIRDFResource** aResult)
|
||||
nsXULOutlinerBuilder::GetResourceAtIndex(PRInt32 aRowIndex, nsIRDFResource** aResult)
|
||||
{
|
||||
if (aRowIndex < 0 || aRowIndex >= mRows.Count())
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
|
||||
*aResult = GetResourceFor(aRowIndex);
|
||||
NS_IF_ADDREF(*aResult = GetResourceFor(aRowIndex));
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsXULOutlinerBuilder::GetIndexOfResource(nsIRDFResource* aResource, PRInt32* aResult)
|
||||
{
|
||||
nsOutlinerRows::iterator iter = mRows.Find(mConflictSet, aResource);
|
||||
if (iter == mRows.Last())
|
||||
*aResult = -1;
|
||||
else
|
||||
*aResult = iter.GetRowIndex();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user