Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
fb30d61c
Commit
fb30d61c
authored
Sep 10, 2008
by
Juan Lang
Committed by
Alexandre Julliard
Sep 11, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
riched20: Use helper function rather than goto to return found position.
parent
1a537406
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
16 deletions
+20
-16
caret.c
dlls/riched20/caret.c
+20
-16
No files found.
dlls/riched20/caret.c
View file @
fb30d61c
...
@@ -889,6 +889,23 @@ static ME_DisplayItem* ME_FindPixelPosInTableRow(int x, int y,
...
@@ -889,6 +889,23 @@ static ME_DisplayItem* ME_FindPixelPosInTableRow(int x, int y,
return
para
;
return
para
;
}
}
static
BOOL
ME_ReturnFoundPos
(
ME_TextEditor
*
editor
,
ME_DisplayItem
*
found
,
ME_Cursor
*
result
,
int
rx
,
BOOL
isExact
)
{
assert
(
found
);
assert
(
found
->
type
==
diRun
);
if
((
found
->
member
.
run
.
nFlags
&
MERF_ENDPARA
)
||
rx
<
0
)
rx
=
0
;
result
->
pRun
=
found
;
result
->
nOffset
=
ME_CharFromPointCursor
(
editor
,
rx
,
&
found
->
member
.
run
);
if
(
editor
->
pCursors
[
0
].
nOffset
==
found
->
member
.
run
.
strText
->
nLen
&&
rx
)
{
result
->
pRun
=
ME_FindItemFwd
(
editor
->
pCursors
[
0
].
pRun
,
diRun
);
result
->
nOffset
=
0
;
}
return
isExact
;
}
/* Finds the run and offset from the pixel position.
/* Finds the run and offset from the pixel position.
*
*
* x & y are pixel positions in virtual coordinates into the rich edit control,
* x & y are pixel positions in virtual coordinates into the rich edit control,
...
@@ -963,34 +980,21 @@ static BOOL ME_FindPixelPos(ME_TextEditor *editor, int x, int y,
...
@@ -963,34 +980,21 @@ static BOOL ME_FindPixelPos(ME_TextEditor *editor, int x, int y,
case
diRun
:
case
diRun
:
rx
=
x
-
p
->
member
.
run
.
pt
.
x
;
rx
=
x
-
p
->
member
.
run
.
pt
.
x
;
if
(
rx
<
p
->
member
.
run
.
nWidth
)
if
(
rx
<
p
->
member
.
run
.
nWidth
)
{
return
ME_ReturnFoundPos
(
editor
,
p
,
result
,
rx
,
isExact
);
found_here:
assert
(
p
->
type
==
diRun
);
if
((
p
->
member
.
run
.
nFlags
&
MERF_ENDPARA
)
||
rx
<
0
)
rx
=
0
;
result
->
pRun
=
p
;
result
->
nOffset
=
ME_CharFromPointCursor
(
editor
,
rx
,
&
p
->
member
.
run
);
if
(
editor
->
pCursors
[
0
].
nOffset
==
p
->
member
.
run
.
strText
->
nLen
&&
rx
)
{
result
->
pRun
=
ME_FindItemFwd
(
editor
->
pCursors
[
0
].
pRun
,
diRun
);
result
->
nOffset
=
0
;
}
return
isExact
;
}
break
;
break
;
case
diStartRow
:
case
diStartRow
:
isExact
=
FALSE
;
isExact
=
FALSE
;
p
=
ME_FindItemFwd
(
p
,
diRun
);
p
=
ME_FindItemFwd
(
p
,
diRun
);
if
(
is_eol
)
*
is_eol
=
1
;
if
(
is_eol
)
*
is_eol
=
1
;
rx
=
0
;
/* FIXME not sure */
rx
=
0
;
/* FIXME not sure */
goto
found_here
;
return
ME_ReturnFoundPos
(
editor
,
p
,
result
,
rx
,
isExact
)
;
case
diCell
:
case
diCell
:
case
diParagraph
:
case
diParagraph
:
case
diTextEnd
:
case
diTextEnd
:
isExact
=
FALSE
;
isExact
=
FALSE
;
rx
=
0
;
/* FIXME not sure */
rx
=
0
;
/* FIXME not sure */
p
=
last
;
p
=
last
;
goto
found_here
;
return
ME_ReturnFoundPos
(
editor
,
p
,
result
,
rx
,
isExact
)
;
default:
assert
(
0
);
default:
assert
(
0
);
}
}
last
=
p
;
last
=
p
;
...
...
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