From 85e00a320ce0458be17808c8ce04ba87454bddfa Mon Sep 17 00:00:00 2001 From: "kin%netscape.com" Date: Wed, 26 May 1999 21:18:12 +0000 Subject: [PATCH] Disabled HACKForceRedraw() calls. Added calls to nsIViewManager::BeginUpdateViewBatch() and nsIViewManager::EndUpdateViewBatch(). git-svn-id: svn://10.0.0.236/trunk@32714 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/editor/base/nsEditor.cpp | 27 +++++++++++++++++++++- mozilla/editor/libeditor/base/nsEditor.cpp | 27 +++++++++++++++++++++- 2 files changed, 52 insertions(+), 2 deletions(-) diff --git a/mozilla/editor/base/nsEditor.cpp b/mozilla/editor/base/nsEditor.cpp index d354b95988a..c945e8d6358 100644 --- a/mozilla/editor/base/nsEditor.cpp +++ b/mozilla/editor/base/nsEditor.cpp @@ -67,7 +67,7 @@ #include "JoinElementTxn.h" #include "nsIStringStream.h" -#define HACK_FORCE_REDRAW 1 +// #define HACK_FORCE_REDRAW 1 #ifdef HACK_FORCE_REDRAW @@ -422,6 +422,11 @@ nsEditor::Init(nsIDOMDocument *aDoc, nsIPresShell* aPresShell) return NS_OK; } +// #define DEBUG_WITH_JS_EDITOR_LOG +#ifdef DEBUG_WITH_JS_EDITOR_LOG +#include "nsJSEditorLog.h" +#endif + NS_IMETHODIMP nsEditor::EnableUndo(PRBool aEnable) { @@ -440,6 +445,16 @@ nsEditor::EnableUndo(PRBool aEnable) return NS_ERROR_NOT_AVAILABLE; } mTxnMgr = do_QueryInterface(txnMgr); // CreateInstance refCounted the instance for us, remember it in an nsCOMPtr + +#ifdef DEBUG_WITH_JS_EDITOR_LOG + nsJSEditorLog *log = new nsJSEditorLog(); + if (log) + { + NS_ADDREF(log); + result = mTxnMgr->AddListener(log); + NS_RELEASE(log); + } +#endif } } else @@ -759,7 +774,13 @@ nsEditor::BeginTransaction() if (nsnull!=mViewManager) { if (0==mUpdateCount) + { +#ifdef HACK_FORCE_REDRAW mViewManager->DisableRefresh(); +#else + mViewManager->BeginUpdateViewBatch(); +#endif + } mUpdateCount++; } @@ -786,8 +807,12 @@ nsEditor::EndTransaction() mUpdateCount--; if (0==mUpdateCount) { +#ifdef HACK_FORCE_REDRAW mViewManager->EnableRefresh(); HACKForceRedraw(); +#else + mViewManager->EndUpdateViewBatch(); +#endif } } diff --git a/mozilla/editor/libeditor/base/nsEditor.cpp b/mozilla/editor/libeditor/base/nsEditor.cpp index d354b95988a..c945e8d6358 100644 --- a/mozilla/editor/libeditor/base/nsEditor.cpp +++ b/mozilla/editor/libeditor/base/nsEditor.cpp @@ -67,7 +67,7 @@ #include "JoinElementTxn.h" #include "nsIStringStream.h" -#define HACK_FORCE_REDRAW 1 +// #define HACK_FORCE_REDRAW 1 #ifdef HACK_FORCE_REDRAW @@ -422,6 +422,11 @@ nsEditor::Init(nsIDOMDocument *aDoc, nsIPresShell* aPresShell) return NS_OK; } +// #define DEBUG_WITH_JS_EDITOR_LOG +#ifdef DEBUG_WITH_JS_EDITOR_LOG +#include "nsJSEditorLog.h" +#endif + NS_IMETHODIMP nsEditor::EnableUndo(PRBool aEnable) { @@ -440,6 +445,16 @@ nsEditor::EnableUndo(PRBool aEnable) return NS_ERROR_NOT_AVAILABLE; } mTxnMgr = do_QueryInterface(txnMgr); // CreateInstance refCounted the instance for us, remember it in an nsCOMPtr + +#ifdef DEBUG_WITH_JS_EDITOR_LOG + nsJSEditorLog *log = new nsJSEditorLog(); + if (log) + { + NS_ADDREF(log); + result = mTxnMgr->AddListener(log); + NS_RELEASE(log); + } +#endif } } else @@ -759,7 +774,13 @@ nsEditor::BeginTransaction() if (nsnull!=mViewManager) { if (0==mUpdateCount) + { +#ifdef HACK_FORCE_REDRAW mViewManager->DisableRefresh(); +#else + mViewManager->BeginUpdateViewBatch(); +#endif + } mUpdateCount++; } @@ -786,8 +807,12 @@ nsEditor::EndTransaction() mUpdateCount--; if (0==mUpdateCount) { +#ifdef HACK_FORCE_REDRAW mViewManager->EnableRefresh(); HACKForceRedraw(); +#else + mViewManager->EndUpdateViewBatch(); +#endif } }