ReactOS 0.4.15-dev-8096-ga0eec98
row.c File Reference
#include "editor.h"
Include dependency graph for row.c:

Go to the source code of this file.

Functions

ME_DisplayItemME_RowStart (ME_DisplayItem *item)
 
ME_DisplayItemME_FindRowWithNumber (ME_TextEditor *editor, int nRow)
 
int ME_RowNumberFromCharOfs (ME_TextEditor *editor, int nOfs)
 

Function Documentation

◆ ME_FindRowWithNumber()

ME_DisplayItem * ME_FindRowWithNumber ( ME_TextEditor editor,
int  nRow 
)

Definition at line 44 of file row.c.

45{
47 int nCount = 0;
48
49 while (item->type == diParagraph &&
50 nCount + item->member.para.nRows <= nRow)
51 {
52 nCount += item->member.para.nRows;
53 item = item->member.para.next_para;
54 }
55 if (item->type != diParagraph)
56 return NULL;
57 for (item = ME_FindItemFwd(item, diStartRow); item && nCount < nRow; nCount++)
59 return item;
60}
#define NULL
Definition: types.h:112
ME_DisplayItem * ME_FindItemFwd(ME_DisplayItem *di, ME_DIType nTypeOrClass) DECLSPEC_HIDDEN
Definition: list.c:134
@ diStartRow
Definition: editstr.h:88
@ diParagraph
Definition: editstr.h:85
static ATOM item
Definition: dde.c:856
ME_DisplayItem * pFirst
Definition: editstr.h:268
ME_TextBuffer * pBuffer
Definition: editstr.h:386

Referenced by ME_HandleMessage().

◆ ME_RowNumberFromCharOfs()

int ME_RowNumberFromCharOfs ( ME_TextEditor editor,
int  nOfs 
)

Definition at line 64 of file row.c.

65{
67 int nRow = 0;
68
69 while (item->type == diParagraph &&
70 item->member.para.next_para->member.para.nCharOfs <= nOfs)
71 {
72 nRow += item->member.para.nRows;
73 item = item->member.para.next_para;
74 }
75 if (item->type == diParagraph)
76 {
77 ME_DisplayItem *next_para = item->member.para.next_para;
78
79 nOfs -= item->member.para.nCharOfs;
82 {
83 if (item == next_para)
84 break;
86 if (item->member.run.nCharOfs > nOfs)
87 break;
88 nRow++;
89 }
90 }
91 return nRow;
92}
@ diRun
Definition: editstr.h:87
@ diStartRowOrParagraph
Definition: editstr.h:92

Referenced by ME_HandleMessage().

◆ ME_RowStart()

ME_DisplayItem * ME_RowStart ( ME_DisplayItem item)

Definition at line 31 of file row.c.

31 {
33}
ME_DisplayItem * ME_FindItemBackOrHere(ME_DisplayItem *di, ME_DIType nTypeOrClass) DECLSPEC_HIDDEN
Definition: list.c:124

Referenced by ME_HandleMessage().