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
This commit is contained in:
parent
cf9cdb1bd0
commit
85e00a320c
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user