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
0fda889f
Commit
0fda889f
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 from virtual co-ords function.
Signed-off-by:
Huw Davies
<
huw@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
b47e5d0d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
11 deletions
+30
-11
caret.c
dlls/riched20/caret.c
+7
-9
editor.h
dlls/riched20/editor.h
+2
-0
para.c
dlls/riched20/para.c
+19
-0
row.c
dlls/riched20/row.c
+2
-2
No files found.
dlls/riched20/caret.c
View file @
0fda889f
...
...
@@ -952,7 +952,7 @@ static BOOL cursor_from_virtual_coords( ME_TextEditor *editor, int x, int y,
ME_Cursor
*
result
,
BOOL
final_eop
)
{
ME_Paragraph
*
para
=
editor_first_para
(
editor
);
ME_
DisplayItem
*
row
=
NULL
;
ME_
Row
*
row
=
NULL
,
*
next_row
;
BOOL
isExact
=
TRUE
;
x
-=
editor
->
rcFormat
.
left
;
...
...
@@ -966,7 +966,7 @@ static BOOL cursor_from_virtual_coords( ME_TextEditor *editor, int x, int y,
if
(
para
->
nFlags
&
MEPF_ROWSTART
)
para
=
pixel_pos_in_table_row
(
x
,
y
,
para
);
y
-=
para
->
pt
.
y
;
row
=
ME_FindItemFwd
(
para_get_di
(
para
),
diStartRow
);
row
=
para_first_row
(
para
);
break
;
}
else
if
(
para
->
nFlags
&
MEPF_ROWSTART
)
...
...
@@ -977,24 +977,22 @@ static BOOL cursor_from_virtual_coords( ME_TextEditor *editor, int x, int y,
/* find row */
while
(
row
)
{
ME_DisplayItem
*
next_row
;
if
(
y
<
row
->
member
.
row
.
pt
.
y
+
row
->
member
.
row
.
nHeight
)
break
;
next_row
=
ME_FindItemFwd
(
row
,
diStartRow
);
if
(
y
<
row
->
pt
.
y
+
row
->
nHeight
)
break
;
next_row
=
row_next
(
row
);
if
(
!
next_row
)
break
;
row
=
next_row
;
}
if
(
!
row
&&
!
final_eop
)
if
(
!
row
&&
!
final_eop
&&
para_prev
(
para
)
)
{
/* The position is below the last paragraph, so the last row will be used
* rather than the end of the text, so the x position will be used to
* determine the offset closest to the pixel position. */
isExact
=
FALSE
;
row
=
ME_FindItemBack
(
para_get_di
(
para
),
diStartRow
);
row
=
para_end_row
(
para_prev
(
para
)
);
}
if
(
row
)
return
row_cursor
(
editor
,
&
row
->
member
.
row
,
x
,
result
)
&&
isExact
;
if
(
row
)
return
row_cursor
(
editor
,
row
,
x
,
result
)
&&
isExact
;
ME_SetCursorToEnd
(
editor
,
result
,
TRUE
);
return
FALSE
;
...
...
dlls/riched20/editor.h
View file @
0fda889f
...
...
@@ -213,7 +213,9 @@ void ME_SetDefaultParaFormat(ME_TextEditor *editor, PARAFORMAT2 *pFmt) DECLSPEC_
int
get_total_width
(
ME_TextEditor
*
editor
)
DECLSPEC_HIDDEN
;
ME_Cell
*
para_cell
(
ME_Paragraph
*
para
)
DECLSPEC_HIDDEN
;
void
para_destroy
(
ME_TextEditor
*
editor
,
ME_Paragraph
*
item
)
DECLSPEC_HIDDEN
;
ME_Row
*
para_end_row
(
ME_Paragraph
*
para
)
DECLSPEC_HIDDEN
;
ME_Run
*
para_end_run
(
ME_Paragraph
*
para
)
DECLSPEC_HIDDEN
;
ME_Row
*
para_first_row
(
ME_Paragraph
*
para
)
DECLSPEC_HIDDEN
;
ME_Run
*
para_first_run
(
ME_Paragraph
*
para
)
DECLSPEC_HIDDEN
;
BOOL
para_in_table
(
ME_Paragraph
*
para
)
DECLSPEC_HIDDEN
;
ME_Paragraph
*
para_join
(
ME_TextEditor
*
editor
,
ME_Paragraph
*
para
,
BOOL
use_first_fmt
)
DECLSPEC_HIDDEN
;
...
...
dlls/riched20/para.c
View file @
0fda889f
...
...
@@ -130,6 +130,25 @@ ME_Cell *para_cell( ME_Paragraph *para )
return
&
para
->
pCell
->
member
.
cell
;
}
ME_Row
*
para_first_row
(
ME_Paragraph
*
para
)
{
ME_DisplayItem
*
item
;
item
=
ME_FindItemFwd
(
para_get_di
(
para
),
diStartRowOrParagraph
);
if
(
!
item
||
item
->
type
!=
diStartRow
)
return
NULL
;
return
&
item
->
member
.
row
;
}
ME_Row
*
para_end_row
(
ME_Paragraph
*
para
)
{
ME_DisplayItem
*
item
;
para
=
para_next
(
para
);
item
=
ME_FindItemBack
(
para_get_di
(
para
),
diStartRowOrParagraph
);
if
(
!
item
||
item
->
type
!=
diStartRow
)
return
NULL
;
return
&
item
->
member
.
row
;
}
void
ME_MakeFirstParagraph
(
ME_TextEditor
*
editor
)
{
static
const
WCHAR
cr_lf
[]
=
{
'\r'
,
'\n'
,
0
};
...
...
dlls/riched20/row.c
View file @
0fda889f
...
...
@@ -28,8 +28,8 @@ ME_Row *row_next( ME_Row *row )
{
ME_DisplayItem
*
item
;
item
=
ME_FindItemFwd
(
row_get_di
(
row
),
diStartRow
);
if
(
!
item
)
return
NULL
;
item
=
ME_FindItemFwd
(
row_get_di
(
row
),
diStartRow
OrParagraphOrEnd
);
if
(
!
item
||
item
->
type
!=
diStartRow
)
return
NULL
;
return
&
item
->
member
.
row
;
}
...
...
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