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
f648eff1
Commit
f648eff1
authored
Oct 12, 2020
by
Huw Davies
Committed by
Alexandre Julliard
Oct 12, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
riched20: Use ME_Paragraph and ME_Run ptrs in GetCursorCoordinates().
Signed-off-by:
Huw Davies
<
huw@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
bb50c5a8
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
25 deletions
+14
-25
caret.c
dlls/riched20/caret.c
+14
-25
No files found.
dlls/riched20/caret.c
View file @
f648eff1
...
...
@@ -222,49 +222,38 @@ void ME_GetCursorCoordinates(ME_TextEditor *editor, ME_Cursor *pCursor,
int
*
x
,
int
*
y
,
int
*
height
)
{
ME_DisplayItem
*
row
;
ME_
DisplayItem
*
run
=
pCursor
->
pR
un
;
ME_
DisplayItem
*
para
=
pCursor
->
pP
ara
;
ME_
DisplayItem
*
pSizeRun
=
run
;
ME_
Run
*
run
=
&
pCursor
->
pRun
->
member
.
r
un
;
ME_
Paragraph
*
para
=
&
pCursor
->
pPara
->
member
.
p
ara
;
ME_
Run
*
size_run
=
run
,
*
prev
;
ME_Context
c
;
int
run_x
;
assert
(
height
&&
x
&&
y
);
assert
(
~
para
->
member
.
para
.
nFlags
&
MEPF_REWRAP
);
assert
(
run
&&
run
->
type
==
diRun
);
assert
(
para
&&
para
->
type
==
diParagraph
);
assert
(
~
para
->
nFlags
&
MEPF_REWRAP
);
row
=
ME_FindItemBack
(
run
,
diStartRowOrParagraph
);
row
=
ME_FindItemBack
(
run_get_di
(
run
),
diStartRowOrParagraph
);
assert
(
row
&&
row
->
type
==
diStartRow
);
ME_InitContext
(
&
c
,
editor
,
ITextHost_TxGetDC
(
editor
->
texthost
));
if
(
!
pCursor
->
nOffset
)
{
ME_DisplayItem
*
prev
=
ME_FindItemBack
(
run
,
diRunOrParagraph
);
assert
(
prev
);
if
(
prev
->
type
==
diRun
)
pSizeRun
=
prev
;
}
if
(
!
pCursor
->
nOffset
&&
(
prev
=
run_prev
(
run
)))
size_run
=
prev
;
if
(
editor
->
bCaretAtEnd
&&
!
pCursor
->
nOffset
&&
run
==
ME_FindItemFwd
(
row
,
diRun
)
)
run
==
&
ME_FindItemFwd
(
row
,
diRun
)
->
member
.
run
)
{
ME_DisplayItem
*
tmp
=
ME_FindItemBack
(
row
,
diRunOrParagraph
);
assert
(
tmp
);
if
(
tmp
->
type
==
diRun
)
{
row
=
ME_FindItemBack
(
tmp
,
diStartRow
);
pSizeRun
=
run
=
tmp
;
assert
(
run
);
assert
(
run
->
type
==
diRun
);
size_run
=
run
=
&
tmp
->
member
.
run
;
}
}
run_x
=
ME_PointFromCharContext
(
&
c
,
&
run
->
member
.
run
,
pCursor
->
nOffset
,
TRUE
);
run_x
=
ME_PointFromCharContext
(
&
c
,
run
,
pCursor
->
nOffset
,
TRUE
);
*
height
=
pSizeRun
->
member
.
run
.
nAscent
+
pSizeRun
->
member
.
run
.
nDescent
;
*
x
=
c
.
rcView
.
left
+
run
->
member
.
run
.
pt
.
x
+
run_x
-
editor
->
horz_si
.
nPos
;
*
y
=
c
.
rcView
.
top
+
para
->
member
.
para
.
pt
.
y
+
row
->
member
.
row
.
nBaseline
+
run
->
member
.
run
.
pt
.
y
-
pSizeRun
->
member
.
run
.
nAscent
-
editor
->
vert_si
.
nPos
;
*
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
+
run
->
pt
.
y
-
size_run
->
nAscent
-
editor
->
vert_si
.
nPos
;
ME_DestroyContext
(
&
c
);
return
;
}
...
...
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