Module: wine Branch: master Commit: 8f0dfaba3020d5e660705446fb13b39b71979a22 URL: http://source.winehq.org/git/wine.git/?a=commit;h=8f0dfaba3020d5e660705446fb...
Author: Dylan Smith dylan.ah.smith@gmail.com Date: Thu Aug 13 08:44:13 2009 -0400
richedit: Removed ME_InsertRun since it uses character offsets.
The function was used in one place, and was simply a wrapper around a call to ME_InsertRunAtCursor, so I removed it to avoids it use in other parts of the code.
---
dlls/riched20/editor.h | 2 -- dlls/riched20/run.c | 21 --------------------- dlls/riched20/undo.c | 7 ++++++- 3 files changed, 6 insertions(+), 24 deletions(-)
diff --git a/dlls/riched20/editor.h b/dlls/riched20/editor.h index 1cffe99..6a91639 100644 --- a/dlls/riched20/editor.h +++ b/dlls/riched20/editor.h @@ -126,8 +126,6 @@ int ME_RowNumberFromCharOfs(ME_TextEditor *editor, int nOfs);
/* run.c */ ME_DisplayItem *ME_MakeRun(ME_Style *s, ME_String *strData, int nFlags); -/* note: ME_InsertRun inserts a copy of the specified run - so you need to destroy the original */ -ME_DisplayItem *ME_InsertRun(ME_TextEditor *editor, int nCharOfs, ME_DisplayItem *pItem); ME_DisplayItem *ME_InsertRunAtCursor(ME_TextEditor *editor, ME_Cursor *cursor, ME_Style *style, const WCHAR *str, int len, int flags); void ME_CheckCharOffsets(ME_TextEditor *editor); diff --git a/dlls/riched20/run.c b/dlls/riched20/run.c index 64befb8..90ea831 100644 --- a/dlls/riched20/run.c +++ b/dlls/riched20/run.c @@ -348,27 +348,6 @@ ME_DisplayItem *ME_MakeRun(ME_Style *s, ME_String *strData, int nFlags) }
/****************************************************************************** - * ME_InsertRun - * - * Inserts a run at a given character position (offset). - */ -ME_DisplayItem *ME_InsertRun(ME_TextEditor *editor, int nCharOfs, ME_DisplayItem *pItem) -{ - ME_Cursor tmp; - ME_DisplayItem *pDI; - - assert(pItem->type == diRun || pItem->type == diUndoInsertRun); - - ME_CursorFromCharOfs(editor, nCharOfs, &tmp); - pDI = ME_InsertRunAtCursor(editor, &tmp, pItem->member.run.style, - pItem->member.run.strText->szData, - pItem->member.run.strText->nLen, - pItem->member.run.nFlags); - - return pDI; -} - -/****************************************************************************** * ME_InsertRunAtCursor * * Inserts a new run with given style, flags and content at a given position, diff --git a/dlls/riched20/undo.c b/dlls/riched20/undo.c index 908a5ac..e3ebbfb 100644 --- a/dlls/riched20/undo.c +++ b/dlls/riched20/undo.c @@ -307,7 +307,12 @@ static void ME_PlayUndoItem(ME_TextEditor *editor, ME_DisplayItem *pItem) } case diUndoInsertRun: { - ME_InsertRun(editor, pItem->member.run.nCharOfs, pItem); + ME_Cursor tmp; + ME_CursorFromCharOfs(editor, pItem->member.run.nCharOfs, &tmp); + ME_InsertRunAtCursor(editor, &tmp, pItem->member.run.style, + pItem->member.run.strText->szData, + pItem->member.run.strText->nLen, + pItem->member.run.nFlags); break; } case diUndoDeleteRun: