Bug 463088 - Tab tear off cursor touchup. sr=roc

This commit is contained in:
Jim Mathies 2009-03-09 19:01:55 -05:00
parent b38df147a7
commit 7a2d98bad9
3 changed files with 12 additions and 7 deletions

View File

@ -301,10 +301,11 @@ nsDOMDataTransfer::GetMozItemCount(PRUint32* aCount)
NS_IMETHODIMP
nsDOMDataTransfer::GetMozCursor(nsAString& aCursorState)
{
if (mCursorState)
aCursorState.AssignASCII("default");
else
aCursorState.AssignASCII("auto");
if (mCursorState) {
aCursorState.AssignLiteral("default");
} else {
aCursorState.AssignLiteral("auto");
}
return NS_OK;
}
@ -312,7 +313,7 @@ NS_IMETHODIMP
nsDOMDataTransfer::SetMozCursor(const nsAString& aCursorState)
{
// Lock the cursor to an arrow during the drag.
mCursorState = aCursorState.EqualsASCII("default");
mCursorState = aCursorState.EqualsLiteral("default");
return NS_OK;
}

View File

@ -182,11 +182,15 @@ interface nsIDOMNSDataTransfer : nsISupports
/**
* Sets the drag cursor state. Primarily used to control the cursor during
* tab drags, but could be expanded to other uses.
* tab drags, but could be expanded to other uses. XXX Currently implemented
* on Win32 only.
*
* Possible values:
* auto - use default system behavior.
* default - set the cursor to an arrow during the drag operation.
*
* Values other than 'default' are indentical to setting mozCursor to
* 'auto'.
*/
attribute DOMString mozCursor;

View File

@ -130,7 +130,7 @@ nsNativeDragSource::GiveFeedback(DWORD dwEffect)
if (mDataTransfer) {
nsAutoString cursor;
mDataTransfer->GetMozCursor(cursor);
if (cursor.EqualsASCII("default")) {
if (cursor.EqualsLiteral("default")) {
m_hCursor = ::LoadCursor(0, IDC_ARROW);
} else {
m_hCursor = nsnull;