Bug 442256 Make getURIs/IndicesForSelection easier to call from JS r+sr=bienvenu
git-svn-id: svn://10.0.0.236/trunk@252644 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
e2fbd5ba94
commit
2b021c3125
@ -430,14 +430,8 @@ function OpenMessageByHeader(messageHeader, openInNewWindow)
|
||||
}
|
||||
}
|
||||
|
||||
if (tree)
|
||||
{
|
||||
var length = {};
|
||||
var indicesArray = {};
|
||||
|
||||
gDBView.getIndicesForSelection(indicesArray, length);
|
||||
tree.treeBoxObject.ensureRowIsVisible(indicesArray.value[0]);
|
||||
}
|
||||
if (tree && tree.currentIndex != -1)
|
||||
tree.treeBoxObject.ensureRowIsVisible(tree.currentIndex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -600,10 +600,7 @@ function GetSelectedMessages()
|
||||
function GetSelectedIndices(dbView)
|
||||
{
|
||||
try {
|
||||
var indicesArray = {};
|
||||
var length = {};
|
||||
dbView.getIndicesForSelection(indicesArray,length);
|
||||
return indicesArray.value;
|
||||
return dbView.getIndicesForSelection({});
|
||||
}
|
||||
catch (ex) {
|
||||
dump("ex = " + ex + "\n");
|
||||
|
||||
@ -1509,10 +1509,7 @@ function GetFirstSelectedMessage()
|
||||
function GetSelectedIndices(dbView)
|
||||
{
|
||||
try {
|
||||
var indicesArray = {};
|
||||
var length = {};
|
||||
dbView.getIndicesForSelection(indicesArray,length);
|
||||
return indicesArray.value;
|
||||
return dbview.getIndicesForSelection({});
|
||||
}
|
||||
catch (ex) {
|
||||
dump("ex = " + ex + "\n");
|
||||
@ -1523,14 +1520,8 @@ function GetSelectedIndices(dbView)
|
||||
function GetSelectedMessages()
|
||||
{
|
||||
try {
|
||||
var messageArray = {};
|
||||
var length = {};
|
||||
var view = GetDBView();
|
||||
view.getURIsForSelection(messageArray,length);
|
||||
if (length.value)
|
||||
return messageArray.value;
|
||||
else
|
||||
return null;
|
||||
var messageArray = GetDBView().getURIsForSelection({});
|
||||
return messageArray.length ? messageArray : null;
|
||||
}
|
||||
catch (ex) {
|
||||
dump("ex = " + ex + "\n");
|
||||
|
||||
@ -244,7 +244,7 @@ interface nsMsgNavigationType
|
||||
};
|
||||
|
||||
|
||||
[scriptable, uuid(8b3de23c-09c8-484c-9269-d35cf7865b2a)]
|
||||
[scriptable, uuid(de4c3458-5222-4cf5-b883-0c42aad848e6)]
|
||||
interface nsIMsgDBView : nsISupports
|
||||
{
|
||||
void open(in nsIMsgFolder folder, in nsMsgViewSortTypeValue sortType, in nsMsgViewSortOrderValue sortOrder, in nsMsgViewFlagsTypeValue viewFlags, out long count);
|
||||
@ -286,8 +286,8 @@ interface nsIMsgDBView : nsISupports
|
||||
nsIMsgFolder getFolderForViewIndex(in nsMsgViewIndex index); // mainly for search
|
||||
ACString getURIForViewIndex(in nsMsgViewIndex index);
|
||||
nsIMsgDBView cloneDBView(in nsIMessenger aMessengerInstance, in nsIMsgWindow aMsgWindow, in nsIMsgDBViewCommandUpdater aCommandUpdater);
|
||||
void getURIsForSelection([array, size_is(count)] out string uris, out unsigned long count);
|
||||
void getIndicesForSelection([array, size_is(count)] out nsMsgViewIndex indices, out unsigned long count);
|
||||
void getURIsForSelection(out unsigned long count, [retval, array, size_is(count)] out string uris);
|
||||
void getIndicesForSelection(out unsigned long count, [retval, array, size_is(count)] out nsMsgViewIndex indices);
|
||||
|
||||
readonly attribute ACString URIForFirstSelectedMessage;
|
||||
readonly attribute nsIMsgDBHdr hdrForFirstSelectedMessage;
|
||||
|
||||
@ -718,14 +718,8 @@ function OpenMessageByHeader(messageHeader, openInNewWindow)
|
||||
}
|
||||
}
|
||||
|
||||
if (tree)
|
||||
{
|
||||
var length = {};
|
||||
var indicesArray = {};
|
||||
|
||||
gDBView.getIndicesForSelection(indicesArray, length);
|
||||
tree.treeBoxObject.ensureRowIsVisible(indicesArray.value[0]);
|
||||
}
|
||||
if (tree && tree.currentIndex != -1)
|
||||
tree.treeBoxObject.ensureRowIsVisible(tree.currentIndex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -452,10 +452,7 @@ function GetSelectedMessages()
|
||||
function GetSelectedIndices(dbView)
|
||||
{
|
||||
try {
|
||||
var indicesArray = {};
|
||||
var length = {};
|
||||
dbView.getIndicesForSelection(indicesArray,length);
|
||||
return indicesArray.value;
|
||||
return dbView.getIndicesForSelection({});
|
||||
}
|
||||
catch (ex) {
|
||||
dump("ex = " + ex + "\n");
|
||||
|
||||
@ -1334,10 +1334,7 @@ function GetFirstSelectedMessage()
|
||||
function GetSelectedIndices(dbView)
|
||||
{
|
||||
try {
|
||||
var indicesArray = {};
|
||||
var length = {};
|
||||
dbView.getIndicesForSelection(indicesArray,length);
|
||||
return indicesArray.value;
|
||||
return dbView.getIndicesForSelection({});
|
||||
}
|
||||
catch (ex) {
|
||||
dump("ex = " + ex + "\n");
|
||||
@ -1348,14 +1345,8 @@ function GetSelectedIndices(dbView)
|
||||
function GetSelectedMessages()
|
||||
{
|
||||
try {
|
||||
var messageArray = {};
|
||||
var length = {};
|
||||
var view = GetDBView();
|
||||
view.getURIsForSelection(messageArray,length);
|
||||
if (length.value)
|
||||
return messageArray.value;
|
||||
else
|
||||
return null;
|
||||
var messageArray = GetDBView().getURIsForSelection({});
|
||||
return messageArray.length ? messageArray : null;
|
||||
}
|
||||
catch (ex) {
|
||||
dump("ex = " + ex + "\n");
|
||||
|
||||
@ -2129,7 +2129,7 @@ int PR_CALLBACK CompareViewIndices (const void *v1, const void *v2, void *)
|
||||
return i1 - i2;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsMsgDBView::GetIndicesForSelection(nsMsgViewIndex **indices, PRUint32 *length)
|
||||
NS_IMETHODIMP nsMsgDBView::GetIndicesForSelection(PRUint32 *length, nsMsgViewIndex **indices)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(length);
|
||||
*length = 0;
|
||||
@ -2149,7 +2149,7 @@ NS_IMETHODIMP nsMsgDBView::GetIndicesForSelection(nsMsgViewIndex **indices, PRU
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsMsgDBView::GetURIsForSelection(char ***uris, PRUint32 *length)
|
||||
NS_IMETHODIMP nsMsgDBView::GetURIsForSelection(PRUint32 *length, char ***uris)
|
||||
{
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user