ReactOS  0.4.14-dev-297-g23e575c
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 }
ME_DisplayItem * pFirst
Definition: editstr.h:272
ME_TextBuffer * pBuffer
Definition: editstr.h:390
smooth NULL
Definition: ftsmooth.c:416
static ATOM item
Definition: dde.c:856
ME_DisplayItem * ME_FindItemFwd(ME_DisplayItem *di, ME_DIType nTypeOrClass) DECLSPEC_HIDDEN
Definition: list.c:134

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 }
ME_DisplayItem * pFirst
Definition: editstr.h:272
ME_TextBuffer * pBuffer
Definition: editstr.h:390
smooth NULL
Definition: ftsmooth.c:416
Definition: editstr.h:91
static ATOM item
Definition: dde.c:856
ME_DisplayItem * ME_FindItemFwd(ME_DisplayItem *di, ME_DIType nTypeOrClass) DECLSPEC_HIDDEN
Definition: list.c:134

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
static ATOM item
Definition: dde.c:856

Referenced by ME_HandleMessage().