зеркало из https://github.com/mozilla/pjs.git
small change to the way you get selection
This commit is contained in:
Родитель
6e453761da
Коммит
19d29307eb
|
@ -1748,7 +1748,7 @@ nsXULDocument::SelectAll()
|
|||
startPnt->SetPoint(start, -1, PR_TRUE);
|
||||
endPnt->SetPoint(end, -1, PR_FALSE);
|
||||
#endif
|
||||
SetDisplaySelection(nsIDocument::SELECTION_ON);
|
||||
SetDisplaySelection(nsISelectionController::SELECTION_ON);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -1748,7 +1748,7 @@ nsXULDocument::SelectAll()
|
|||
startPnt->SetPoint(start, -1, PR_TRUE);
|
||||
endPnt->SetPoint(end, -1, PR_FALSE);
|
||||
#endif
|
||||
SetDisplaySelection(nsIDocument::SELECTION_ON);
|
||||
SetDisplaySelection(nsISelectionController::SELECTION_ON);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -3352,11 +3352,12 @@ nsBrowserWindow::DoToggleSelection()
|
|||
{
|
||||
nsIPresShell* shell = GetPresShell();
|
||||
if (nsnull != shell) {
|
||||
nsCOMPtr<nsIDocument> doc;
|
||||
shell->GetDocument(getter_AddRefs(doc));
|
||||
if (doc) {
|
||||
PRInt8 current = doc->GetDisplaySelection();
|
||||
doc->SetDisplaySelection(!current);
|
||||
nsCOMPtr<nsISelectionController> selCon;
|
||||
selCon = do_QueryInterface(shell);
|
||||
if (selCon) {
|
||||
PRInt16 current;
|
||||
selCon->GetDisplaySelection(¤t);
|
||||
selCon->SetDisplaySelection(!current);
|
||||
ForceRefresh();
|
||||
}
|
||||
NS_RELEASE(shell);
|
||||
|
|
|
@ -37,6 +37,8 @@
|
|||
#include "nsIComponentManager.h"
|
||||
#include "nsIServiceManager.h"
|
||||
#include "resources.h"
|
||||
#include "nsISelectionController.h"
|
||||
#include "nsIPresShell.h"
|
||||
|
||||
static nsIEditor *gEditor;
|
||||
|
||||
|
@ -81,8 +83,9 @@ nsresult NS_InitEditorMode(nsIDOMDocument *aDOMDocument, nsIPresShell* aPresShel
|
|||
if (!gEditor) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
result = gEditor->Init(aDOMDocument, aPresShell, 0);
|
||||
nsCOMPtr<nsISelectionController> selCon;
|
||||
selCon = do_QueryInterface(aPresShell);
|
||||
result = gEditor->Init(aDOMDocument, aPresShell, selCon, 0);
|
||||
if (NS_SUCCEEDED(result))
|
||||
result = gEditor->PostCreate();
|
||||
return result;
|
||||
|
|
Загрузка…
Ссылка в новой задаче