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
e9be142d
Commit
e9be142d
authored
Jan 01, 2008
by
Eric Pouech
Committed by
Alexandre Julliard
Jan 02, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
richedit: Rewrote FindPixelPos so that it always return something.
Made the function static as well.
parent
d319033a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
58 additions
and
78 deletions
+58
-78
caret.c
dlls/riched20/caret.c
+56
-75
editor.h
dlls/riched20/editor.h
+0
-1
wrap.c
dlls/riched20/wrap.c
+2
-2
No files found.
dlls/riched20/caret.c
View file @
e9be142d
...
...
@@ -704,102 +704,83 @@ int ME_GetCursorOfs(ME_TextEditor *editor, int nCursor)
+
pCursor
->
pRun
->
member
.
run
.
nCharOfs
+
pCursor
->
nOffset
;
}
int
ME_FindPixelPos
(
ME_TextEditor
*
editor
,
int
x
,
int
y
,
ME_Cursor
*
result
,
BOOL
*
is_eol
)
static
void
ME_FindPixelPos
(
ME_TextEditor
*
editor
,
int
x
,
int
y
,
ME_Cursor
*
result
,
BOOL
*
is_eol
)
{
ME_DisplayItem
*
p
=
editor
->
pBuffer
->
pFirst
->
member
.
para
.
next_para
;
ME_DisplayItem
*
last
=
NULL
;
int
rx
=
0
;
if
(
is_eol
)
*
is_eol
=
0
;
while
(
p
!=
editor
->
pBuffer
->
pLast
)
/* find paragraph */
for
(;
p
!=
editor
->
pBuffer
->
pLast
;
p
=
p
->
member
.
para
.
next_para
)
{
if
(
p
->
type
==
diParagraph
)
assert
(
p
->
type
==
diParagraph
);
if
(
y
<
p
->
member
.
para
.
nYPos
+
p
->
member
.
para
.
nHeight
)
{
int
ry
=
y
-
p
->
member
.
para
.
nYPos
;
if
(
ry
<
0
)
{
result
->
pRun
=
ME_FindItemFwd
(
p
,
diRun
);
result
->
nOffset
=
0
;
return
0
;
}
if
(
ry
>=
p
->
member
.
para
.
nHeight
)
{
p
=
p
->
member
.
para
.
next_para
;
continue
;
}
y
-=
p
->
member
.
para
.
nYPos
;
p
=
ME_FindItemFwd
(
p
,
diStartRow
);
y
=
ry
;
continue
;
break
;
}
if
(
p
->
type
==
diStartRow
)
}
/* find row */
for
(;
p
!=
editor
->
pBuffer
->
pLast
;
)
{
ME_DisplayItem
*
pp
;
assert
(
p
->
type
==
diStartRow
);
if
(
y
<
p
->
member
.
row
.
nYPos
+
p
->
member
.
row
.
nHeight
)
{
int
ry
=
y
-
p
->
member
.
row
.
nYPos
;
if
(
ry
<
0
)
return
0
;
if
(
ry
>=
p
->
member
.
row
.
nHeight
)
{
p
=
ME_FindItemFwd
(
p
,
diStartRowOrParagraphOrEnd
);
if
(
p
->
type
!=
diStartRow
)
return
0
;
continue
;
}
p
=
ME_FindItemFwd
(
p
,
diRun
);
continue
;
p
=
ME_FindItemFwd
(
p
,
diRun
);
break
;
}
pp
=
ME_FindItemFwd
(
p
,
diStartRowOrParagraphOrEnd
);
if
(
pp
->
type
!=
diStartRow
)
{
p
=
ME_FindItemFwd
(
p
,
diRun
);
break
;
}
if
(
p
->
type
==
diRun
)
p
=
pp
;
}
for
(;
p
!=
editor
->
pBuffer
->
pLast
;
p
=
p
->
next
)
{
switch
(
p
->
type
)
{
ME_DisplayItem
*
pp
;
case
diRun
:
rx
=
x
-
p
->
member
.
run
.
pt
.
x
;
if
(
rx
<
0
)
rx
=
0
;
if
(
rx
>=
p
->
member
.
run
.
nWidth
)
/* not this run yet... find next item */
{
pp
=
p
;
do
{
p
=
p
->
next
;
if
(
p
->
type
==
diRun
)
{
rx
=
x
-
p
->
member
.
run
.
pt
.
x
;
goto
continue_search
;
}
if
(
p
->
type
==
diStartRow
)
{
p
=
ME_FindItemFwd
(
p
,
diRun
);
if
(
is_eol
)
*
is_eol
=
1
;
rx
=
0
;
/* FIXME not sure */
goto
found_here
;
}
if
(
p
->
type
==
diParagraph
||
p
->
type
==
diTextEnd
)
{
rx
=
0
;
/* FIXME not sure */
p
=
pp
;
goto
found_here
;
}
}
while
(
1
);
continue
;
}
found_here:
if
(
p
->
member
.
run
.
nFlags
&
MERF_ENDPARA
)
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
)
if
(
rx
<
p
->
member
.
run
.
nWidth
)
{
result
->
pRun
=
ME_FindItemFwd
(
editor
->
pCursors
[
0
].
pRun
,
diRun
);
result
->
nOffset
=
0
;
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
;
}
return
1
;
break
;
case
diStartRow
:
p
=
ME_FindItemFwd
(
p
,
diRun
);
if
(
is_eol
)
*
is_eol
=
1
;
rx
=
0
;
/* FIXME not sure */
goto
found_here
;
case
diParagraph
:
case
diTextEnd
:
rx
=
0
;
/* FIXME not sure */
p
=
last
;
goto
found_here
;
default:
assert
(
0
);
}
assert
(
0
);
continue_search:
;
last
=
p
;
}
result
->
pRun
=
ME_FindItemBack
(
p
,
diRun
);
result
->
nOffset
=
0
;
assert
(
result
->
pRun
->
member
.
run
.
nFlags
&
MERF_ENDPARA
);
return
0
;
}
...
...
dlls/riched20/editor.h
View file @
e9be142d
...
...
@@ -181,7 +181,6 @@ void ME_SelectWord(ME_TextEditor *editor);
void
ME_HideCaret
(
ME_TextEditor
*
ed
);
void
ME_ShowCaret
(
ME_TextEditor
*
ed
);
void
ME_MoveCaret
(
ME_TextEditor
*
ed
);
int
ME_FindPixelPos
(
ME_TextEditor
*
editor
,
int
x
,
int
y
,
ME_Cursor
*
result
,
BOOL
*
is_eol
);
int
ME_CharFromPos
(
ME_TextEditor
*
editor
,
int
x
,
int
y
);
void
ME_LButtonDown
(
ME_TextEditor
*
editor
,
int
x
,
int
y
);
void
ME_MouseMove
(
ME_TextEditor
*
editor
,
int
x
,
int
y
);
...
...
dlls/riched20/wrap.c
View file @
e9be142d
...
...
@@ -354,8 +354,8 @@ static void ME_WrapTextParagraph(ME_Context *c, ME_DisplayItem *tp, DWORD begino
wc
.
context
=
c
;
/* wc.para_style = tp->member.para.style; */
wc
.
style
=
NULL
;
wc
.
nFirstMargin
=
ME_twips2points
(
c
,
tp
->
member
.
para
.
pFmt
->
dxStartIndent
,
dpi
)
+
beginofs
wc
.
nLeftMargin
=
wc
.
nFirstMargin
+
ME_twips2points
(
c
,
tp
->
member
.
para
.
pFmt
->
dxOffset
,
dpi
)
+
beginofs
wc
.
nFirstMargin
=
ME_twips2points
(
c
,
tp
->
member
.
para
.
pFmt
->
dxStartIndent
,
dpi
)
+
beginofs
;
wc
.
nLeftMargin
=
wc
.
nFirstMargin
+
ME_twips2points
(
c
,
tp
->
member
.
para
.
pFmt
->
dxOffset
,
dpi
)
+
beginofs
;
wc
.
nRightMargin
=
ME_twips2points
(
c
,
tp
->
member
.
para
.
pFmt
->
dxRightIndent
,
dpi
);
wc
.
nRow
=
0
;
wc
.
pt
.
x
=
0
;
...
...
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