зеркало из https://github.com/mozilla/pjs.git
Must use |GetEnumerator|; can't QI a selection to get the enumerator. Fixes bug #24354. Also fixes a leak in the same routine. r=buster, a={chofmann, brendan}
This commit is contained in:
Родитель
73fa5568be
Коммит
5c3b4478ed
|
@ -602,8 +602,8 @@ nsGenericDOMDataNode::ConvertContentToXIF(nsXIFConverter& aConverter) const
|
|||
|
||||
if (sel != nsnull && mDocument->IsInSelection(sel,content))
|
||||
{
|
||||
nsIEnumerator *enumerator;
|
||||
if (NS_SUCCEEDED(sel->QueryInterface(kIEnumeratorIID, (void **)&enumerator))) {
|
||||
nsCOMPtr<nsIEnumerator> enumerator;
|
||||
if (NS_SUCCEEDED(sel->GetEnumerator(getter_AddRefs(enumerator)))) {
|
||||
for (enumerator->First();NS_OK != enumerator->IsDone(); enumerator->Next()) {
|
||||
nsIDOMRange* range = nsnull;
|
||||
if (NS_SUCCEEDED(enumerator->CurrentItem((nsISupports**)&range))) {
|
||||
|
|
|
@ -602,8 +602,8 @@ nsGenericDOMDataNode::ConvertContentToXIF(nsXIFConverter& aConverter) const
|
|||
|
||||
if (sel != nsnull && mDocument->IsInSelection(sel,content))
|
||||
{
|
||||
nsIEnumerator *enumerator;
|
||||
if (NS_SUCCEEDED(sel->QueryInterface(kIEnumeratorIID, (void **)&enumerator))) {
|
||||
nsCOMPtr<nsIEnumerator> enumerator;
|
||||
if (NS_SUCCEEDED(sel->GetEnumerator(getter_AddRefs(enumerator)))) {
|
||||
for (enumerator->First();NS_OK != enumerator->IsDone(); enumerator->Next()) {
|
||||
nsIDOMRange* range = nsnull;
|
||||
if (NS_SUCCEEDED(enumerator->CurrentItem((nsISupports**)&range))) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче