Finished table cell selection optimization bug 41045. r=mjudge, a=beppe

This commit is contained in:
cmanske%netscape.com 2000-06-06 23:14:42 +00:00
parent e43955f56d
commit d4cf823a1c
3 changed files with 60 additions and 30 deletions

View File

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

View File

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

View File

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