Commit 8f0dfaba authored by Dylan Smith's avatar Dylan Smith Committed by Alexandre Julliard

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.
parent 02228ee1
...@@ -126,8 +126,6 @@ int ME_RowNumberFromCharOfs(ME_TextEditor *editor, int nOfs); ...@@ -126,8 +126,6 @@ int ME_RowNumberFromCharOfs(ME_TextEditor *editor, int nOfs);
/* run.c */ /* run.c */
ME_DisplayItem *ME_MakeRun(ME_Style *s, ME_String *strData, int nFlags); 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_DisplayItem *ME_InsertRunAtCursor(ME_TextEditor *editor, ME_Cursor *cursor,
ME_Style *style, const WCHAR *str, int len, int flags); ME_Style *style, const WCHAR *str, int len, int flags);
void ME_CheckCharOffsets(ME_TextEditor *editor); void ME_CheckCharOffsets(ME_TextEditor *editor);
......
...@@ -348,27 +348,6 @@ ME_DisplayItem *ME_MakeRun(ME_Style *s, ME_String *strData, int nFlags) ...@@ -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 * ME_InsertRunAtCursor
* *
* Inserts a new run with given style, flags and content at a given position, * Inserts a new run with given style, flags and content at a given position,
......
...@@ -307,7 +307,12 @@ static void ME_PlayUndoItem(ME_TextEditor *editor, ME_DisplayItem *pItem) ...@@ -307,7 +307,12 @@ static void ME_PlayUndoItem(ME_TextEditor *editor, ME_DisplayItem *pItem)
} }
case diUndoInsertRun: 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; break;
} }
case diUndoDeleteRun: case diUndoDeleteRun:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment