mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-11 16:32:59 +00:00
Finished table cell selection optimization bug 41045. r=mjudge, a=beppe
This commit is contained in:
parent
e43955f56d
commit
d4cf823a1c
@ -47,6 +47,7 @@
|
||||
#include "nsIContentIterator.h"
|
||||
#include "nsIDocumentEncoder.h"
|
||||
#include "nsIIndependentSelection.h"
|
||||
#include "nsIPref.h"
|
||||
|
||||
#include "nsIDOMText.h"
|
||||
|
||||
@ -803,19 +804,28 @@ nsSelection::nsSelection()
|
||||
mSelectingTableCellMode = 0;
|
||||
|
||||
mSelectedCellIndex = 0;
|
||||
#ifdef XP_UNIX
|
||||
//AUTO COPY REGISTRATION -- FOR UNIX ONLY.
|
||||
// TODO: Make this a pref so other platforms can use it.
|
||||
nsresult rv;
|
||||
NS_WITH_SERVICE(nsIAutoCopyService, autoCopyService, "component://netscape/autocopy", &rv);
|
||||
|
||||
if (NS_SUCCEEDED(rv) && autoCopyService)
|
||||
// Check to see if the autocopy pref is enabled
|
||||
// and add the autocopy listener if it is
|
||||
nsresult rv;
|
||||
NS_WITH_SERVICE(nsIPref, prefs, "component://netscape/preferences", &rv);
|
||||
if (NS_SUCCEEDED(rv) && prefs)
|
||||
{
|
||||
PRInt8 index = GetIndexFromSelectionType(nsISelectionController::SELECTION_NORMAL);
|
||||
if (mDomSelections[index])
|
||||
autoCopyService->Listen(mDomSelections[index]);
|
||||
static char pref[] = "clipboard.autocopy";
|
||||
PRBool autoCopy = PR_FALSE;
|
||||
if (NS_SUCCEEDED(prefs->GetBoolPref(pref, &autoCopy)) && autoCopy)
|
||||
{
|
||||
NS_WITH_SERVICE(nsIAutoCopyService, autoCopyService, "component://netscape/autocopy", &rv);
|
||||
|
||||
if (NS_SUCCEEDED(rv) && autoCopyService)
|
||||
{
|
||||
PRInt8 index = GetIndexFromSelectionType(nsISelectionController::SELECTION_NORMAL);
|
||||
if (mDomSelections[index])
|
||||
autoCopyService->Listen(mDomSelections[index]);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
mDisplaySelection = nsISelectionController::SELECTION_OFF;
|
||||
|
||||
mDelayCaretOverExistingSelection = PR_TRUE;
|
||||
|
@ -47,6 +47,7 @@
|
||||
#include "nsIContentIterator.h"
|
||||
#include "nsIDocumentEncoder.h"
|
||||
#include "nsIIndependentSelection.h"
|
||||
#include "nsIPref.h"
|
||||
|
||||
#include "nsIDOMText.h"
|
||||
|
||||
@ -803,19 +804,28 @@ nsSelection::nsSelection()
|
||||
mSelectingTableCellMode = 0;
|
||||
|
||||
mSelectedCellIndex = 0;
|
||||
#ifdef XP_UNIX
|
||||
//AUTO COPY REGISTRATION -- FOR UNIX ONLY.
|
||||
// TODO: Make this a pref so other platforms can use it.
|
||||
nsresult rv;
|
||||
NS_WITH_SERVICE(nsIAutoCopyService, autoCopyService, "component://netscape/autocopy", &rv);
|
||||
|
||||
if (NS_SUCCEEDED(rv) && autoCopyService)
|
||||
// Check to see if the autocopy pref is enabled
|
||||
// and add the autocopy listener if it is
|
||||
nsresult rv;
|
||||
NS_WITH_SERVICE(nsIPref, prefs, "component://netscape/preferences", &rv);
|
||||
if (NS_SUCCEEDED(rv) && prefs)
|
||||
{
|
||||
PRInt8 index = GetIndexFromSelectionType(nsISelectionController::SELECTION_NORMAL);
|
||||
if (mDomSelections[index])
|
||||
autoCopyService->Listen(mDomSelections[index]);
|
||||
static char pref[] = "clipboard.autocopy";
|
||||
PRBool autoCopy = PR_FALSE;
|
||||
if (NS_SUCCEEDED(prefs->GetBoolPref(pref, &autoCopy)) && autoCopy)
|
||||
{
|
||||
NS_WITH_SERVICE(nsIAutoCopyService, autoCopyService, "component://netscape/autocopy", &rv);
|
||||
|
||||
if (NS_SUCCEEDED(rv) && autoCopyService)
|
||||
{
|
||||
PRInt8 index = GetIndexFromSelectionType(nsISelectionController::SELECTION_NORMAL);
|
||||
if (mDomSelections[index])
|
||||
autoCopyService->Listen(mDomSelections[index]);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
mDisplaySelection = nsISelectionController::SELECTION_OFF;
|
||||
|
||||
mDelayCaretOverExistingSelection = PR_TRUE;
|
||||
|
@ -47,6 +47,7 @@
|
||||
#include "nsIContentIterator.h"
|
||||
#include "nsIDocumentEncoder.h"
|
||||
#include "nsIIndependentSelection.h"
|
||||
#include "nsIPref.h"
|
||||
|
||||
#include "nsIDOMText.h"
|
||||
|
||||
@ -803,19 +804,28 @@ nsSelection::nsSelection()
|
||||
mSelectingTableCellMode = 0;
|
||||
|
||||
mSelectedCellIndex = 0;
|
||||
#ifdef XP_UNIX
|
||||
//AUTO COPY REGISTRATION -- FOR UNIX ONLY.
|
||||
// TODO: Make this a pref so other platforms can use it.
|
||||
nsresult rv;
|
||||
NS_WITH_SERVICE(nsIAutoCopyService, autoCopyService, "component://netscape/autocopy", &rv);
|
||||
|
||||
if (NS_SUCCEEDED(rv) && autoCopyService)
|
||||
// Check to see if the autocopy pref is enabled
|
||||
// and add the autocopy listener if it is
|
||||
nsresult rv;
|
||||
NS_WITH_SERVICE(nsIPref, prefs, "component://netscape/preferences", &rv);
|
||||
if (NS_SUCCEEDED(rv) && prefs)
|
||||
{
|
||||
PRInt8 index = GetIndexFromSelectionType(nsISelectionController::SELECTION_NORMAL);
|
||||
if (mDomSelections[index])
|
||||
autoCopyService->Listen(mDomSelections[index]);
|
||||
static char pref[] = "clipboard.autocopy";
|
||||
PRBool autoCopy = PR_FALSE;
|
||||
if (NS_SUCCEEDED(prefs->GetBoolPref(pref, &autoCopy)) && autoCopy)
|
||||
{
|
||||
NS_WITH_SERVICE(nsIAutoCopyService, autoCopyService, "component://netscape/autocopy", &rv);
|
||||
|
||||
if (NS_SUCCEEDED(rv) && autoCopyService)
|
||||
{
|
||||
PRInt8 index = GetIndexFromSelectionType(nsISelectionController::SELECTION_NORMAL);
|
||||
if (mDomSelections[index])
|
||||
autoCopyService->Listen(mDomSelections[index]);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
mDisplaySelection = nsISelectionController::SELECTION_OFF;
|
||||
|
||||
mDelayCaretOverExistingSelection = PR_TRUE;
|
||||
|
Loading…
Reference in New Issue
Block a user