diff --git a/mozilla/content/base/src/nsDocumentViewer.cpp b/mozilla/content/base/src/nsDocumentViewer.cpp index 9479aded0a1..438da264a61 100644 --- a/mozilla/content/base/src/nsDocumentViewer.cpp +++ b/mozilla/content/base/src/nsDocumentViewer.cpp @@ -4001,13 +4001,7 @@ NS_IMETHODIMP DocumentViewerImpl::SelectAll() rv = selection->RemoveAllRanges(); if (NS_FAILED(rv)) return rv; - static NS_DEFINE_CID(kCDOMRangeCID, NS_RANGE_CID); - nsCOMPtr range = do_CreateInstance(kCDOMRangeCID, &rv); - - rv = range->SelectNodeContents(bodyNode); - if (NS_FAILED(rv)) return rv; - - rv = selection->AddRange(range); + rv = selection->SelectAllChildren(bodyNode); return rv; } diff --git a/mozilla/layout/base/nsAutoCopy.cpp b/mozilla/layout/base/nsAutoCopy.cpp index 69869746966..ed071081aec 100644 --- a/mozilla/layout/base/nsAutoCopy.cpp +++ b/mozilla/layout/base/nsAutoCopy.cpp @@ -131,8 +131,10 @@ nsAutoCopyService::NotifySelectionChanged(nsIDOMDocument *aDoc, nsISelection *aS { nsresult rv; - if (!(aReason & nsISelectionListener::MOUSEUP_REASON)) - return NS_OK; //dont care if we are still dragging. or if its not from a mouseup + if (!(aReason & nsISelectionListener::MOUSEUP_REASON || + aReason & nsISelectionListener::SELECTALL_REASON || + aReason & nsISelectionListener::KEYPRESS_REASON)) + return NS_OK; //dont care if we are still dragging PRBool collapsed; if (!aDoc || !aSel || NS_FAILED(aSel->GetIsCollapsed(&collapsed)) || collapsed) { #ifdef DEBUG_CLIPBOARD diff --git a/mozilla/layout/base/nsDocumentViewer.cpp b/mozilla/layout/base/nsDocumentViewer.cpp index 9479aded0a1..438da264a61 100644 --- a/mozilla/layout/base/nsDocumentViewer.cpp +++ b/mozilla/layout/base/nsDocumentViewer.cpp @@ -4001,13 +4001,7 @@ NS_IMETHODIMP DocumentViewerImpl::SelectAll() rv = selection->RemoveAllRanges(); if (NS_FAILED(rv)) return rv; - static NS_DEFINE_CID(kCDOMRangeCID, NS_RANGE_CID); - nsCOMPtr range = do_CreateInstance(kCDOMRangeCID, &rv); - - rv = range->SelectNodeContents(bodyNode); - if (NS_FAILED(rv)) return rv; - - rv = selection->AddRange(range); + rv = selection->SelectAllChildren(bodyNode); return rv; } diff --git a/mozilla/layout/base/src/nsAutoCopy.cpp b/mozilla/layout/base/src/nsAutoCopy.cpp index 69869746966..ed071081aec 100644 --- a/mozilla/layout/base/src/nsAutoCopy.cpp +++ b/mozilla/layout/base/src/nsAutoCopy.cpp @@ -131,8 +131,10 @@ nsAutoCopyService::NotifySelectionChanged(nsIDOMDocument *aDoc, nsISelection *aS { nsresult rv; - if (!(aReason & nsISelectionListener::MOUSEUP_REASON)) - return NS_OK; //dont care if we are still dragging. or if its not from a mouseup + if (!(aReason & nsISelectionListener::MOUSEUP_REASON || + aReason & nsISelectionListener::SELECTALL_REASON || + aReason & nsISelectionListener::KEYPRESS_REASON)) + return NS_OK; //dont care if we are still dragging PRBool collapsed; if (!aDoc || !aSel || NS_FAILED(aSel->GetIsCollapsed(&collapsed)) || collapsed) { #ifdef DEBUG_CLIPBOARD