Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
5067e0fc
Commit
5067e0fc
authored
Jul 06, 2005
by
Phil Krylov
Committed by
Alexandre Julliard
Jul 06, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed EM_LINEINDEX handler and added EM_LINEFROMCHAR handler.
parent
30ddf739
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
25 deletions
+38
-25
editor.c
dlls/riched20/editor.c
+10
-25
editor.h
dlls/riched20/editor.h
+1
-0
row.c
dlls/riched20/row.c
+27
-0
No files found.
dlls/riched20/editor.c
View file @
5067e0fc
...
...
@@ -76,7 +76,7 @@
- EM_SETZOOM 3.0
- EM_HIDESELECTION
- EM_LIMITTEXT
-
EM_LINEFROMCHAR
+
EM_LINEFROMCHAR
+ EM_LINEINDEX
- EM_LINELENGTH
+ EM_LINESCROLL
...
...
@@ -914,7 +914,6 @@ LRESULT WINAPI RichEditANSIWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lP
UNSUPPORTED_MSG
(
EM_GETZOOM
)
UNSUPPORTED_MSG
(
EM_HIDESELECTION
)
UNSUPPORTED_MSG
(
EM_LIMITTEXT
)
/* also known as EM_SETLIMITTEXT */
UNSUPPORTED_MSG
(
EM_LINEFROMCHAR
)
UNSUPPORTED_MSG
(
EM_LINELENGTH
)
UNSUPPORTED_MSG
(
EM_PASTESPECIAL
)
/* UNSUPPORTED_MSG(EM_POSFROMCHARS) missing in Wine headers */
...
...
@@ -1308,37 +1307,23 @@ LRESULT WINAPI RichEditANSIWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lP
}
return
max
(
1
,
nRows
);
}
case
EM_LINEFROMCHAR
:
{
if
(
wParam
==
-
1
)
return
ME_RowNumberFromCharOfs
(
editor
,
ME_GetCursorOfs
(
editor
,
1
));
else
return
ME_RowNumberFromCharOfs
(
editor
,
wParam
);
}
case
EM_EXLINEFROMCHAR
:
{
ME_DisplayItem
*
item
=
editor
->
pBuffer
->
pFirst
->
next
;
int
nOffset
;
int
nRow
=
0
;
while
(
item
&&
item
->
member
.
para
.
next_para
->
member
.
para
.
nCharOfs
<=
lParam
)
{
nRow
+=
item
->
member
.
para
.
nRows
;
item
=
ME_FindItemFwd
(
item
,
diParagraph
);
}
if
(
item
)
{
nOffset
=
lParam
-
item
->
member
.
para
.
nCharOfs
;
item
=
ME_FindItemFwd
(
item
,
diRun
);
while
((
item
=
ME_FindItemFwd
(
item
,
diStartRowOrParagraph
)))
{
item
=
ME_FindItemFwd
(
item
,
diRun
);
if
(
item
->
member
.
run
.
nCharOfs
>
nOffset
)
break
;
nRow
++
;
}
}
return
nRow
;
return
ME_RowNumberFromCharOfs
(
editor
,
lParam
);
}
case
EM_LINEINDEX
:
{
ME_DisplayItem
*
item
,
*
para
;
if
(
wParam
==
-
1
)
item
=
ME_FindItemBack
(
editor
->
pCursors
[
1
].
pRun
,
diStartRow
);
item
=
ME_FindItemBack
(
editor
->
pCursors
[
0
].
pRun
,
diStartRow
);
else
item
=
ME_FindRowWithNumber
(
editor
,
wParam
);
if
(
!
item
)
...
...
dlls/riched20/editor.h
View file @
5067e0fc
...
...
@@ -101,6 +101,7 @@ ME_DisplayItem *ME_RowStart(ME_DisplayItem *item);
ME_DisplayItem
*
ME_RowEnd
(
ME_DisplayItem
*
item
);
void
ME_RenumberParagraphs
(
ME_DisplayItem
*
item
);
/* TODO */
ME_DisplayItem
*
ME_FindRowWithNumber
(
ME_TextEditor
*
editor
,
int
nRow
);
int
ME_RowNumberFromCharOfs
(
ME_TextEditor
*
editor
,
int
nOfs
);
/* run.c */
ME_DisplayItem
*
ME_MakeRun
(
ME_Style
*
s
,
ME_String
*
strData
,
int
nFlags
);
...
...
dlls/riched20/row.c
View file @
5067e0fc
...
...
@@ -101,3 +101,30 @@ ME_FindRowWithNumber(ME_TextEditor *editor, int nRow)
item
=
ME_FindItemFwd
(
item
,
diStartRow
);
return
item
;
}
int
ME_RowNumberFromCharOfs
(
ME_TextEditor
*
editor
,
int
nOfs
)
{
ME_DisplayItem
*
item
=
editor
->
pBuffer
->
pFirst
->
next
;
int
nRow
=
0
;
while
(
item
&&
item
->
member
.
para
.
next_para
->
member
.
para
.
nCharOfs
<=
nOfs
)
{
nRow
+=
item
->
member
.
para
.
nRows
;
item
=
ME_FindItemFwd
(
item
,
diParagraph
);
}
if
(
item
)
{
nOfs
-=
item
->
member
.
para
.
nCharOfs
;
item
=
ME_FindItemFwd
(
item
,
diRun
);
while
((
item
=
ME_FindItemFwd
(
item
,
diStartRowOrParagraph
))
!=
NULL
)
{
item
=
ME_FindItemFwd
(
item
,
diRun
);
if
(
item
->
member
.
run
.
nCharOfs
>
nOfs
)
break
;
nRow
++
;
}
}
return
nRow
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment