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
6b3fd786
Commit
6b3fd786
authored
Oct 26, 2020
by
Huw Davies
Committed by
Alexandre Julliard
Oct 26, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
riched20: Use row ptrs in the cursor to co-ordinates function.
Signed-off-by:
Huw Davies
<
huw@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
f45408b2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
16 deletions
+14
-16
caret.c
dlls/riched20/caret.c
+11
-13
editor.h
dlls/riched20/editor.h
+1
-1
richole.c
dlls/riched20/richole.c
+2
-2
No files found.
dlls/riched20/caret.c
View file @
6b3fd786
...
...
@@ -218,31 +218,29 @@ int set_selection_cursors(ME_TextEditor *editor, int from, int to)
}
void
ME_GetCursorCoordinates
(
ME_TextEditor
*
editor
,
ME_Cursor
*
pC
ursor
,
int
*
x
,
int
*
y
,
int
*
height
)
void
cursor_coords
(
ME_TextEditor
*
editor
,
ME_Cursor
*
c
ursor
,
int
*
x
,
int
*
y
,
int
*
height
)
{
ME_
DisplayItem
*
row
;
ME_Run
*
run
=
&
pC
ursor
->
pRun
->
member
.
run
;
ME_Paragraph
*
para
=
&
pC
ursor
->
pPara
->
member
.
para
;
ME_
Row
*
row
;
ME_Run
*
run
=
&
c
ursor
->
pRun
->
member
.
run
;
ME_Paragraph
*
para
=
&
c
ursor
->
pPara
->
member
.
para
;
ME_Run
*
size_run
=
run
,
*
prev
;
ME_Context
c
;
int
run_x
;
assert
(
height
&&
x
&&
y
);
assert
(
~
para
->
nFlags
&
MEPF_REWRAP
);
row
=
ME_FindItemBack
(
run_get_di
(
run
),
diStartRowOrParagraph
);
assert
(
row
&&
row
->
type
==
diStartRow
);
row
=
row_from_cursor
(
cursor
);
ME_InitContext
(
&
c
,
editor
,
ITextHost_TxGetDC
(
editor
->
texthost
));
if
(
!
pC
ursor
->
nOffset
&&
(
prev
=
run_prev
(
run
)))
size_run
=
prev
;
if
(
!
c
ursor
->
nOffset
&&
(
prev
=
run_prev
(
run
)))
size_run
=
prev
;
run_x
=
ME_PointFromCharContext
(
&
c
,
run
,
pC
ursor
->
nOffset
,
TRUE
);
run_x
=
ME_PointFromCharContext
(
&
c
,
run
,
c
ursor
->
nOffset
,
TRUE
);
*
height
=
size_run
->
nAscent
+
size_run
->
nDescent
;
*
x
=
c
.
rcView
.
left
+
run
->
pt
.
x
+
run_x
-
editor
->
horz_si
.
nPos
;
*
y
=
c
.
rcView
.
top
+
para
->
pt
.
y
+
row
->
member
.
row
.
nBaseline
*
y
=
c
.
rcView
.
top
+
para
->
pt
.
y
+
row
->
nBaseline
+
run
->
pt
.
y
-
size_run
->
nAscent
-
editor
->
vert_si
.
nPos
;
ME_DestroyContext
(
&
c
);
return
;
...
...
@@ -252,7 +250,7 @@ void create_caret(ME_TextEditor *editor)
{
int
x
,
y
,
height
;
ME_GetCursorCoordinates
(
editor
,
&
editor
->
pCursors
[
0
],
&
x
,
&
y
,
&
height
);
cursor_coords
(
editor
,
&
editor
->
pCursors
[
0
],
&
x
,
&
y
,
&
height
);
ITextHost_TxCreateCaret
(
editor
->
texthost
,
NULL
,
0
,
height
);
editor
->
caret_height
=
height
;
editor
->
caret_hidden
=
TRUE
;
...
...
@@ -281,7 +279,7 @@ void update_caret(ME_TextEditor *editor)
if
(
!
editor
->
bHaveFocus
)
return
;
if
(
!
ME_IsSelection
(
editor
))
{
ME_GetCursorCoordinates
(
editor
,
&
editor
->
pCursors
[
0
],
&
x
,
&
y
,
&
height
);
cursor_coords
(
editor
,
&
editor
->
pCursors
[
0
],
&
x
,
&
y
,
&
height
);
if
(
height
!=
editor
->
caret_height
)
create_caret
(
editor
);
x
=
min
(
x
,
editor
->
rcFormat
.
right
-
1
);
ITextHost_TxSetCaretPos
(
editor
->
texthost
,
x
,
y
);
...
...
dlls/riched20/editor.h
View file @
6b3fd786
...
...
@@ -164,6 +164,7 @@ static inline ME_DisplayItem *run_get_di( ME_Run *run )
}
/* caret.c */
void
cursor_coords
(
ME_TextEditor
*
editor
,
ME_Cursor
*
cursor
,
int
*
x
,
int
*
y
,
int
*
height
)
DECLSPEC_HIDDEN
;
void
ME_SetCursorToStart
(
ME_TextEditor
*
editor
,
ME_Cursor
*
cursor
)
DECLSPEC_HIDDEN
;
int
set_selection_cursors
(
ME_TextEditor
*
editor
,
int
from
,
int
to
)
DECLSPEC_HIDDEN
;
BOOL
ME_MoveCursorWords
(
ME_TextEditor
*
editor
,
ME_Cursor
*
cursor
,
int
nRelOfs
)
DECLSPEC_HIDDEN
;
...
...
@@ -192,7 +193,6 @@ BOOL ME_InternalDeleteText(ME_TextEditor *editor, ME_Cursor *start, int nChars,
int
ME_GetTextLength
(
ME_TextEditor
*
editor
)
DECLSPEC_HIDDEN
;
int
ME_GetTextLengthEx
(
ME_TextEditor
*
editor
,
const
GETTEXTLENGTHEX
*
how
)
DECLSPEC_HIDDEN
;
ME_Style
*
ME_GetSelectionInsertStyle
(
ME_TextEditor
*
editor
)
DECLSPEC_HIDDEN
;
void
ME_GetCursorCoordinates
(
ME_TextEditor
*
editor
,
ME_Cursor
*
pCursor
,
int
*
x
,
int
*
y
,
int
*
height
)
DECLSPEC_HIDDEN
;
/* context.c */
void
ME_InitContext
(
ME_Context
*
c
,
ME_TextEditor
*
editor
,
HDC
hDC
)
DECLSPEC_HIDDEN
;
...
...
dlls/riched20/richole.c
View file @
6b3fd786
...
...
@@ -2734,11 +2734,11 @@ static HRESULT WINAPI ITextRange_fnScrollIntoView(ITextRange *me, LONG value)
{
case
tomStart
:
cursor_from_char_ofs
(
editor
,
This
->
start
,
&
cursor
);
ME_GetCursorCoordinates
(
editor
,
&
cursor
,
&
x
,
&
y
,
&
height
);
cursor_coords
(
editor
,
&
cursor
,
&
x
,
&
y
,
&
height
);
break
;
case
tomEnd
:
cursor_from_char_ofs
(
editor
,
This
->
end
,
&
cursor
);
ME_GetCursorCoordinates
(
editor
,
&
cursor
,
&
x
,
&
y
,
&
height
);
cursor_coords
(
editor
,
&
cursor
,
&
x
,
&
y
,
&
height
);
break
;
default:
FIXME
(
"bStart value %d not handled
\n
"
,
value
);
...
...
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