This looks good apart from some style issues - see inline below.
On Sun, Nov 05, 2017 at 07:28:39PM +0100, Rafał Harabień wrote:
Signed-off-by: Rafał Harabień rafalh1992@o2.pl
dlls/riched20/editor.c | 60 +++++++++++++++++++++++--------------------- dlls/riched20/tests/editor.c | 15 +++++++++++ 2 files changed, 47 insertions(+), 28 deletions(-)
diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c index a7b1bc7..3da19fa 100644 --- a/dlls/riched20/editor.c +++ b/dlls/riched20/editor.c @@ -2294,6 +2294,13 @@ static BOOL paste_special(ME_TextEditor *editor, UINT cf, REPASTESPECIAL *ps, BO struct paste_format *format; IDataObject *data;
- /* Protect read-only edit control from modification */
- if (editor->styleFlags & ES_READONLY) {
Please put the open brace on a new line matching the rest of the function.
if (!check_only)
MessageBeep(MB_ICONERROR);
return FALSE;
}
init_paste_formats();
if (ps && ps->dwAspect != DVASPECT_CONTENT)
@@ -2351,6 +2358,29 @@ static BOOL ME_Copy(ME_TextEditor *editor, const ME_Cursor *start, int nChars) return SUCCEEDED(hr); }
+static BOOL copy_or_cut(ME_TextEditor *editor, BOOL cut) +{
- BOOL result;
- int nOfs, nChars;
- int nStartCur = ME_GetSelectionOfs(editor, &nOfs, &nChars);
- ME_Cursor *selStart = &editor->pCursors[nStartCur];
Let's take the opportunity to use lower case variable names. How about offs, num_chars, start_cursor and sel_start.
- if (cut && (editor->styleFlags & ES_READONLY)) {
Again, opening brace to new line.
MessageBeep(MB_ICONERROR);
return FALSE;
- }
- nChars -= nOfs;
- result = ME_Copy(editor, selStart, nChars);
- if (result && cut)
- {
ME_InternalDeleteText(editor, selStart, nChars, FALSE);
Indent this block 4 spaces.
ME_CommitUndo(editor);
ME_UpdateRepaint(editor, TRUE);
- }
- return result;
+}
Huw.