зеркало из 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);
|
startPnt->SetPoint(start, -1, PR_TRUE);
|
||||||
endPnt->SetPoint(end, -1, PR_FALSE);
|
endPnt->SetPoint(end, -1, PR_FALSE);
|
||||||
#endif
|
#endif
|
||||||
SetDisplaySelection(nsIDocument::SELECTION_ON);
|
SetDisplaySelection(nsISelectionController::SELECTION_ON);
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1748,7 +1748,7 @@ nsXULDocument::SelectAll()
|
||||||
startPnt->SetPoint(start, -1, PR_TRUE);
|
startPnt->SetPoint(start, -1, PR_TRUE);
|
||||||
endPnt->SetPoint(end, -1, PR_FALSE);
|
endPnt->SetPoint(end, -1, PR_FALSE);
|
||||||
#endif
|
#endif
|
||||||
SetDisplaySelection(nsIDocument::SELECTION_ON);
|
SetDisplaySelection(nsISelectionController::SELECTION_ON);
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3352,11 +3352,12 @@ nsBrowserWindow::DoToggleSelection()
|
||||||
{
|
{
|
||||||
nsIPresShell* shell = GetPresShell();
|
nsIPresShell* shell = GetPresShell();
|
||||||
if (nsnull != shell) {
|
if (nsnull != shell) {
|
||||||
nsCOMPtr<nsIDocument> doc;
|
nsCOMPtr<nsISelectionController> selCon;
|
||||||
shell->GetDocument(getter_AddRefs(doc));
|
selCon = do_QueryInterface(shell);
|
||||||
if (doc) {
|
if (selCon) {
|
||||||
PRInt8 current = doc->GetDisplaySelection();
|
PRInt16 current;
|
||||||
doc->SetDisplaySelection(!current);
|
selCon->GetDisplaySelection(¤t);
|
||||||
|
selCon->SetDisplaySelection(!current);
|
||||||
ForceRefresh();
|
ForceRefresh();
|
||||||
}
|
}
|
||||||
NS_RELEASE(shell);
|
NS_RELEASE(shell);
|
||||||
|
|
|
@ -37,6 +37,8 @@
|
||||||
#include "nsIComponentManager.h"
|
#include "nsIComponentManager.h"
|
||||||
#include "nsIServiceManager.h"
|
#include "nsIServiceManager.h"
|
||||||
#include "resources.h"
|
#include "resources.h"
|
||||||
|
#include "nsISelectionController.h"
|
||||||
|
#include "nsIPresShell.h"
|
||||||
|
|
||||||
static nsIEditor *gEditor;
|
static nsIEditor *gEditor;
|
||||||
|
|
||||||
|
@ -81,8 +83,9 @@ nsresult NS_InitEditorMode(nsIDOMDocument *aDOMDocument, nsIPresShell* aPresShel
|
||||||
if (!gEditor) {
|
if (!gEditor) {
|
||||||
return NS_ERROR_OUT_OF_MEMORY;
|
return NS_ERROR_OUT_OF_MEMORY;
|
||||||
}
|
}
|
||||||
|
nsCOMPtr<nsISelectionController> selCon;
|
||||||
result = gEditor->Init(aDOMDocument, aPresShell, 0);
|
selCon = do_QueryInterface(aPresShell);
|
||||||
|
result = gEditor->Init(aDOMDocument, aPresShell, selCon, 0);
|
||||||
if (NS_SUCCEEDED(result))
|
if (NS_SUCCEEDED(result))
|
||||||
result = gEditor->PostCreate();
|
result = gEditor->PostCreate();
|
||||||
return result;
|
return result;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче