Fixes for bug 192569 (allow foreign transactions to be added to the queue)

mozilla/editor/idl/nsIEditor.idl
mozilla/editor/libeditor/base/nsEditor.cpp
mozilla/editor/libeditor/base/PlaceholderTxn.cpp
mozilla/editor/libeditor/html/nsHTMLCSSUtils.cpp
mozilla/editor/libeditor/html/nsHTMLEditor.cpp
mozilla/editor/libeditor/text/nsTextEditRules.cpp

  - Renamed nsIEditor::Do() to nsIEditor::DoTransaction() so that it
    can be called from JavaScript.

  - Cleaned up nsEditor::Begin/EndUpdateViewBatch() so that
    nothing happens outside the check of mUpdateCount.

  - Modified PlaceholderTxn.cpp so that it checks to see
    if a merged transaction implements nsPIEditorTransaction
    before attempting to cast it to (EditorTxn*).

mozilla/editor/ui/composer/content/EditorCommandsDebug.js
mozilla/editor/ui/composer/content/editorOverlay.xul
mozilla/editor/ui/composer/locale/en-US/editorOverlay.dtd

  - Added debug menu items to test execution of foreign transactions
    via the txnmgr and editor.

r=jfrancis@netscape.com  sr=sfraser@netscape.com


git-svn-id: svn://10.0.0.236/trunk@140707 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
kin%netscape.com
2003-04-04 20:50:25 +00:00
parent dc3c50a5a2
commit d43528516f
9 changed files with 252 additions and 88 deletions

View File

@@ -152,6 +152,14 @@ NS_IMETHODIMP PlaceholderTxn::Merge(nsITransaction *aTransaction, PRBool *aDidMe
return NS_ERROR_FAILURE;
}
// check to see if aTransaction is one of the editor's
// private transactions. If not, we want to avoid merging
// the foreign transaction into our placeholder since we
// don't know what it does.
nsCOMPtr<nsPIEditorTransaction> pTxn = do_QueryInterface(aTransaction);
if (!pTxn) return NS_OK; // it's foreign so just bail!
EditTxn *editTxn = (EditTxn*)aTransaction; //XXX: hack, not safe! need nsIEditTransaction!
// determine if this incoming txn is a placeholder txn
nsCOMPtr<nsIAbsorbingTransaction> plcTxn;// = do_QueryInterface(editTxn);