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:
mjudge%netscape.com 2001-05-18 23:07:54 +00:00
parent edda37e990
commit 9499fd2df2
2 changed files with 16 additions and 0 deletions

View File

@ -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);

View File

@ -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);