richedit: Invalidate without calling UpdateWindow in many cases.

This commit is contained in:
Dylan Smith 2010-07-28 21:17:40 -04:00 committed by Alexandre Julliard
parent 1964e603fd
commit dfa80b35b0
6 changed files with 24 additions and 23 deletions

View File

@ -1583,7 +1583,7 @@ static LRESULT ME_StreamIn(ME_TextEditor *editor, DWORD format, EDITSTREAM *stre
ME_ReleaseStyle(style);
editor->nEventMask = nEventMask;
ME_UpdateRepaint(editor);
ME_UpdateRepaint(editor, FALSE);
if (!(format & SFF_SELECTION)) {
ME_ClearTempStyle(editor);
}
@ -2137,7 +2137,7 @@ ME_KeyDown(ME_TextEditor *editor, WORD nKey)
return TRUE;
ME_MoveCursorFromTableRowStartParagraph(editor);
ME_UpdateSelectionLinkAttribute(editor);
ME_UpdateRepaint(editor);
ME_UpdateRepaint(editor, FALSE);
ME_SendRequestResize(editor, FALSE);
return TRUE;
case VK_RETURN:
@ -2193,7 +2193,7 @@ ME_KeyDown(ME_TextEditor *editor, WORD nKey)
editor->pCursors[1] = editor->pCursors[0];
ME_CommitUndo(editor);
ME_CheckTablesForCorruption(editor);
ME_UpdateRepaint(editor);
ME_UpdateRepaint(editor, FALSE);
return TRUE;
}
else if (para == editor->pCursors[1].pPara &&
@ -2218,7 +2218,7 @@ ME_KeyDown(ME_TextEditor *editor, WORD nKey)
para->member.para.next_para->member.para.nFlags |= MEPF_ROWSTART;
ME_CommitCoalescingUndo(editor);
ME_CheckTablesForCorruption(editor);
ME_UpdateRepaint(editor);
ME_UpdateRepaint(editor, FALSE);
return TRUE;
}
} else { /* v1.0 - 3.0 */
@ -2235,7 +2235,7 @@ ME_KeyDown(ME_TextEditor *editor, WORD nKey)
editor->pCursors[0].nOffset = 0;
editor->pCursors[1] = editor->pCursors[0];
ME_CommitCoalescingUndo(editor);
ME_UpdateRepaint(editor);
ME_UpdateRepaint(editor, FALSE);
return TRUE;
}
} else {
@ -2262,7 +2262,7 @@ ME_KeyDown(ME_TextEditor *editor, WORD nKey)
editor->pCursors[1] = editor->pCursors[0];
}
ME_CommitCoalescingUndo(editor);
ME_UpdateRepaint(editor);
ME_UpdateRepaint(editor, FALSE);
return TRUE;
}
}
@ -2280,7 +2280,7 @@ ME_KeyDown(ME_TextEditor *editor, WORD nKey)
SetCursor(NULL);
ME_UpdateSelectionLinkAttribute(editor);
ME_UpdateRepaint(editor);
ME_UpdateRepaint(editor, FALSE);
}
return TRUE;
}
@ -2319,7 +2319,7 @@ ME_KeyDown(ME_TextEditor *editor, WORD nKey)
{
ME_InternalDeleteText(editor, selStart, nChars, FALSE);
ME_CommitUndo(editor);
ME_UpdateRepaint(editor);
ME_UpdateRepaint(editor, TRUE);
}
return result;
}
@ -2449,7 +2449,7 @@ static LRESULT ME_Char(ME_TextEditor *editor, WPARAM charCode,
}
ME_UpdateSelectionLinkAttribute(editor);
ME_UpdateRepaint(editor);
ME_UpdateRepaint(editor, FALSE);
}
return 0;
}
@ -3299,7 +3299,7 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam,
editor->nModifyStep = oldModify;
ME_EmptyUndoStack(editor);
}
ME_UpdateRepaint(editor);
ME_UpdateRepaint(editor, FALSE);
return len;
}
case EM_SETBKGNDCOLOR:
@ -3460,7 +3460,7 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam,
int nStartCursor = ME_GetSelectionOfs(editor, &from, &to);
ME_InternalDeleteText(editor, &editor->pCursors[nStartCursor], to-from, FALSE);
ME_CommitUndo(editor);
ME_UpdateRepaint(editor);
ME_UpdateRepaint(editor, TRUE);
return 0;
}
case EM_REPLACESEL:
@ -3488,7 +3488,7 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam,
ME_UpdateSelectionLinkAttribute(editor);
if (!wParam)
ME_EmptyUndoStack(editor);
ME_UpdateRepaint(editor);
ME_UpdateRepaint(editor, FALSE);
return len;
}
case EM_SCROLLCARET:
@ -3566,7 +3566,7 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam,
editor->nModifyStep = 0;
ME_CommitUndo(editor);
ME_EmptyUndoStack(editor);
ME_UpdateRepaint(editor);
ME_UpdateRepaint(editor, FALSE);
return 1;
}
case EM_CANPASTE:
@ -3592,7 +3592,7 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam,
{
ME_InternalDeleteText(editor, selStart, nChars, FALSE);
ME_CommitUndo(editor);
ME_UpdateRepaint(editor);
ME_UpdateRepaint(editor, TRUE);
}
return 0;
}
@ -4246,7 +4246,7 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam,
editor->imeStartIndex=ME_GetCursorOfs(&editor->pCursors[0]);
ME_DeleteSelection(editor);
ME_CommitUndo(editor);
ME_UpdateRepaint(editor);
ME_UpdateRepaint(editor, FALSE);
return 0;
}
case WM_IME_COMPOSITION:
@ -4278,7 +4278,7 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam,
}
ME_ReleaseStyle(style);
ME_CommitUndo(editor);
ME_UpdateRepaint(editor);
ME_UpdateRepaint(editor, FALSE);
return 0;
}
case WM_IME_ENDCOMPOSITION:

View File

@ -210,7 +210,7 @@ void ME_SetDefaultParaFormat(PARAFORMAT2 *pFmt);
void ME_PaintContent(ME_TextEditor *editor, HDC hDC, BOOL bOnlyNew, const RECT *rcUpdate);
void ME_Repaint(ME_TextEditor *editor);
void ME_RewrapRepaint(ME_TextEditor *editor);
void ME_UpdateRepaint(ME_TextEditor *editor);
void ME_UpdateRepaint(ME_TextEditor *editor, BOOL update_now);
void ME_EnsureVisible(ME_TextEditor *editor, ME_Cursor *pCursor);
void ME_InvalidateSelection(ME_TextEditor *editor);
BOOL ME_SetZoom(ME_TextEditor *editor, int numerator, int denominator);

View File

@ -132,7 +132,7 @@ void ME_Repaint(ME_TextEditor *editor)
ITextHost_TxViewChange(editor->texthost, TRUE);
}
void ME_UpdateRepaint(ME_TextEditor *editor)
void ME_UpdateRepaint(ME_TextEditor *editor, BOOL update_now)
{
/* Should be called whenever the contents of the control have changed */
BOOL wrappedParagraphs;
@ -144,6 +144,8 @@ void ME_UpdateRepaint(ME_TextEditor *editor)
/* Ensure that the cursor is visible */
ME_EnsureVisible(editor, &editor->pCursors[0]);
ITextHost_TxViewChange(editor->texthost, update_now);
ME_SendSelChange(editor);
/* send EN_CHANGE if the event mask asks for it */
@ -153,7 +155,6 @@ void ME_UpdateRepaint(ME_TextEditor *editor)
ME_SendOldNotify(editor, EN_CHANGE);
editor->nEventMask |= ENM_CHANGE;
}
ME_Repaint(editor);
}
void

View File

@ -391,7 +391,7 @@ IRichEditOle_fnInsertObject(IRichEditOle *me, REOBJECT *reo)
ME_InsertOLEFromCursor(This->editor, reo, 0);
ME_CommitUndo(This->editor);
ME_UpdateRepaint(This->editor);
ME_UpdateRepaint(This->editor, FALSE);
return S_OK;
}

View File

@ -325,7 +325,7 @@ HRESULT WINAPI fnTextSrv_TxSetText(ITextServices *iface,
This->editor->nModifyStep = 0;
OleFlushClipboard();
ME_EmptyUndoStack(This->editor);
ME_UpdateRepaint(This->editor);
ME_UpdateRepaint(This->editor, FALSE);
return S_OK;
}

View File

@ -402,7 +402,7 @@ BOOL ME_Undo(ME_TextEditor *editor) {
ME_CheckTablesForCorruption(editor);
editor->nUndoStackSize--;
editor->nUndoMode = nMode;
ME_UpdateRepaint(editor);
ME_UpdateRepaint(editor, FALSE);
return TRUE;
}
@ -438,6 +438,6 @@ BOOL ME_Redo(ME_TextEditor *editor) {
ME_AddUndoItem(editor, diUndoEndTransaction, NULL);
ME_CheckTablesForCorruption(editor);
editor->nUndoMode = nMode;
ME_UpdateRepaint(editor);
ME_UpdateRepaint(editor, FALSE);
return TRUE;
}