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.
This commit is contained in:
parent
02228ee176
commit
8f0dfaba30
|
@ -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);
|
||||
|
|
|
@ -347,27 +347,6 @@ ME_DisplayItem *ME_MakeRun(ME_Style *s, ME_String *strData, int nFlags)
|
|||
return item;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* 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
|
||||
*
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue