mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-30 08:12:05 +00:00
fixing bad check in tablecellselection. wouldnt work if only 1 char in a text node was selected. bug=68641 r=ftang, sr=hyatt. simple fix..
This commit is contained in:
parent
edda37e990
commit
9499fd2df2
@ -4082,6 +4082,14 @@ nsTypedSelection::GetTableSelectionType(nsIDOMRange* aRange, PRInt32* aTableSele
|
||||
nsCOMPtr<nsIContent> content = do_QueryInterface(startNode);
|
||||
if (!content) return NS_ERROR_FAILURE;
|
||||
|
||||
//if we simply cannot have children, return NS_OK as a non-failing, non-completing case for table selection
|
||||
PRBool canContainChildren = PR_FALSE;
|
||||
result = content->CanContainChildren(canContainChildren);
|
||||
if (NS_FAILED(result))
|
||||
return result;//simply asking should NOT fail
|
||||
if (!canContainChildren)
|
||||
return NS_OK; //got to be a text node, definately not a table row/cell
|
||||
|
||||
PRInt32 startOffset;
|
||||
PRInt32 endOffset;
|
||||
result = aRange->GetEndOffset(&endOffset);
|
||||
|
@ -4082,6 +4082,14 @@ nsTypedSelection::GetTableSelectionType(nsIDOMRange* aRange, PRInt32* aTableSele
|
||||
nsCOMPtr<nsIContent> content = do_QueryInterface(startNode);
|
||||
if (!content) return NS_ERROR_FAILURE;
|
||||
|
||||
//if we simply cannot have children, return NS_OK as a non-failing, non-completing case for table selection
|
||||
PRBool canContainChildren = PR_FALSE;
|
||||
result = content->CanContainChildren(canContainChildren);
|
||||
if (NS_FAILED(result))
|
||||
return result;//simply asking should NOT fail
|
||||
if (!canContainChildren)
|
||||
return NS_OK; //got to be a text node, definately not a table row/cell
|
||||
|
||||
PRInt32 startOffset;
|
||||
PRInt32 endOffset;
|
||||
result = aRange->GetEndOffset(&endOffset);
|
||||
|
Loading…
Reference in New Issue
Block a user