зеркало из https://github.com/mozilla/pjs.git
Fix for bug #33938: Pref/reply below quoted text does not move to bottom
mozilla/mailnews/compose/nsMsgCompose.cpp - Scroll the selection into view after all the reply text is inserted and the caret is positioned. mozilla/editor/base/nsHTMLEditor.cpp - Added nsAutoEditBatch variable to InsertBreak() to make sure that we reflow before returning. Without this fix, apps like MsgCompose will not be able to scroll the selection properly. r=jfrancis@netscape.com
This commit is contained in:
Родитель
cfdaa5ee25
Коммит
8a81f475ac
|
@ -2762,6 +2762,7 @@ NS_IMETHODIMP nsHTMLEditor::InsertBreak()
|
|||
nsresult res;
|
||||
if (!mRules) { return NS_ERROR_NOT_INITIALIZED; }
|
||||
|
||||
nsAutoEditBatch beginBatching(this);
|
||||
nsAutoRules beginRulesSniffing(this, kOpInsertBreak, nsIEditor::eNext);
|
||||
nsCOMPtr<nsISelection> selection;
|
||||
PRBool cancel, handled;
|
||||
|
|
|
@ -2762,6 +2762,7 @@ NS_IMETHODIMP nsHTMLEditor::InsertBreak()
|
|||
nsresult res;
|
||||
if (!mRules) { return NS_ERROR_NOT_INITIALIZED; }
|
||||
|
||||
nsAutoEditBatch beginBatching(this);
|
||||
nsAutoRules beginRulesSniffing(this, kOpInsertBreak, nsIEditor::eNext);
|
||||
nsCOMPtr<nsISelection> selection;
|
||||
PRBool cancel, handled;
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
#include "nsIDOMHTMLInputElement.h"
|
||||
#include "nsIDOMDocument.h"
|
||||
#include "nsISelection.h"
|
||||
#include "nsISelectionController.h"
|
||||
#include "nsIDOMNamedNodeMap.h"
|
||||
#include "nsMsgI18N.h"
|
||||
#include "nsICharsetConverterManager.h"
|
||||
|
@ -361,6 +362,12 @@ nsresult nsMsgCompose::ConvertAndLoadComposeWindow(nsIEditorShell *aEditorShell,
|
|||
// This should set the cursor to the top!
|
||||
default : editor->BeginningOfDocument(); break;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsISelectionController> selCon;
|
||||
editor->GetSelectionController(getter_AddRefs(selCon));
|
||||
|
||||
if (selCon)
|
||||
selCon->ScrollSelectionIntoView(nsISelectionController::SELECTION_NORMAL, nsISelectionController::SELECTION_ANCHOR_REGION);
|
||||
}
|
||||
|
||||
NotifyStateListeners(nsMsgCompose::eComposeFieldsReady);
|
||||
|
|
Загрузка…
Ссылка в новой задаче