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
a0f0dc1c
Commit
a0f0dc1c
authored
Oct 30, 2020
by
Huw Davies
Committed by
Alexandre Julliard
Oct 30, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
riched20: Use paragraph ptrs in the enter handler.
Signed-off-by:
Huw Davies
<
huw@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
352e7664
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
33 deletions
+33
-33
editor.c
dlls/riched20/editor.c
+33
-33
No files found.
dlls/riched20/editor.c
View file @
a0f0dc1c
...
...
@@ -2484,7 +2484,7 @@ static BOOL handle_enter(ME_TextEditor *editor)
static
const
WCHAR
endl
=
'\r'
;
static
const
WCHAR
endlv10
[]
=
{
'\r'
,
'\n'
};
ME_Cursor
cursor
=
editor
->
pCursors
[
0
];
ME_
DisplayItem
*
para
=
cursor
.
pP
ara
;
ME_
Paragraph
*
para
=
&
cursor
.
pPara
->
member
.
p
ara
;
int
from
,
to
;
ME_Style
*
style
,
*
eop_style
;
...
...
@@ -2499,40 +2499,40 @@ static BOOL handle_enter(ME_TextEditor *editor)
{
if
(
!
editor
->
bEmulateVersion10
)
/* v4.1 */
{
if
(
para
->
member
.
para
.
nFlags
&
MEPF_ROWEND
)
if
(
para
->
nFlags
&
MEPF_ROWEND
)
{
/* Add a new table row after this row. */
para
=
para_get_di
(
table_append_row
(
editor
,
&
para
->
member
.
para
)
);
para
=
para
->
member
.
para
.
next_para
;
editor
->
pCursors
[
0
].
pPara
=
para
;
editor
->
pCursors
[
0
].
pRun
=
ME_FindItemFwd
(
para
,
diRun
);
para
=
table_append_row
(
editor
,
para
);
para
=
para
_next
(
para
)
;
editor
->
pCursors
[
0
].
pPara
=
para
_get_di
(
para
)
;
editor
->
pCursors
[
0
].
pRun
=
run_get_di
(
para_first_run
(
para
)
);
editor
->
pCursors
[
0
].
nOffset
=
0
;
editor
->
pCursors
[
1
]
=
editor
->
pCursors
[
0
];
ME_CommitUndo
(
editor
);
ME_UpdateRepaint
(
editor
,
FALSE
);
return
TRUE
;
}
else
if
(
para
==
editor
->
pCursors
[
1
].
pP
ara
&&
else
if
(
para
==
&
editor
->
pCursors
[
1
].
pPara
->
member
.
p
ara
&&
cursor
.
nOffset
+
cursor
.
pRun
->
member
.
run
.
nCharOfs
==
0
&&
para
->
member
.
para
.
prev_para
->
member
.
para
.
nFlags
&
MEPF_ROWSTART
&&
!
para
->
member
.
para
.
prev_para
->
member
.
para
.
nCharOfs
)
para_prev
(
para
)
&&
para_prev
(
para
)
->
nFlags
&
MEPF_ROWSTART
&&
!
para_prev
(
para
)
->
nCharOfs
)
{
/* Insert a newline before the table. */
para
=
para
->
member
.
para
.
prev_para
;
para
->
member
.
para
.
nFlags
&=
~
MEPF_ROWSTART
;
editor
->
pCursors
[
0
].
pPara
=
para
;
editor
->
pCursors
[
0
].
pRun
=
ME_FindItemFwd
(
para
,
diRun
);
para
=
para
_prev
(
para
)
;
para
->
nFlags
&=
~
MEPF_ROWSTART
;
editor
->
pCursors
[
0
].
pPara
=
para
_get_di
(
para
)
;
editor
->
pCursors
[
0
].
pRun
=
run_get_di
(
para_first_run
(
para
)
);
editor
->
pCursors
[
1
]
=
editor
->
pCursors
[
0
];
ME_InsertTextFromCursor
(
editor
,
0
,
&
endl
,
1
,
editor
->
pCursors
[
0
].
pRun
->
member
.
run
.
style
);
para
=
editor
->
pBuffer
->
pFirst
->
member
.
para
.
next_para
;
editor_set_default_para_fmt
(
editor
,
&
para
->
member
.
para
.
fmt
);
para
->
member
.
para
.
nFlags
=
0
;
para_mark_rewrap
(
editor
,
&
para
->
member
.
para
);
editor
->
pCursors
[
0
].
pPara
=
para
;
editor
->
pCursors
[
0
].
pRun
=
ME_FindItemFwd
(
para
,
diRun
);
para
=
editor
_first_para
(
editor
)
;
editor_set_default_para_fmt
(
editor
,
&
para
->
fmt
);
para
->
nFlags
=
0
;
para_mark_rewrap
(
editor
,
para
);
editor
->
pCursors
[
0
].
pPara
=
para
_get_di
(
para
)
;
editor
->
pCursors
[
0
].
pRun
=
run_get_di
(
para_first_run
(
para
)
);
editor
->
pCursors
[
1
]
=
editor
->
pCursors
[
0
];
para
->
member
.
para
.
next_para
->
member
.
para
.
nFlags
|=
MEPF_ROWSTART
;
para
_next
(
para
)
->
nFlags
|=
MEPF_ROWSTART
;
ME_CommitCoalescingUndo
(
editor
);
ME_UpdateRepaint
(
editor
,
FALSE
);
return
TRUE
;
...
...
@@ -2540,17 +2540,17 @@ static BOOL handle_enter(ME_TextEditor *editor)
}
else
/* v1.0 - 3.0 */
{
ME_
DisplayItem
*
para
=
cursor
.
pP
ara
;
if
(
ME_IsInTable
(
para
))
ME_
Paragraph
*
para
=
&
cursor
.
pPara
->
member
.
p
ara
;
if
(
para_in_table
(
para
))
{
if
(
cursor
.
pRun
->
member
.
run
.
nFlags
&
MERF_ENDPARA
)
{
if
(
from
==
to
)
{
ME_ContinueCoalescingTransaction
(
editor
);
para
=
para_get_di
(
table_append_row
(
editor
,
&
para
->
member
.
para
)
);
editor
->
pCursors
[
0
].
pPara
=
para
;
editor
->
pCursors
[
0
].
pRun
=
ME_FindItemFwd
(
para
,
diRun
);
para
=
table_append_row
(
editor
,
para
);
editor
->
pCursors
[
0
].
pPara
=
para
_get_di
(
para
)
;
editor
->
pCursors
[
0
].
pRun
=
run_get_di
(
para_first_run
(
para
)
);
editor
->
pCursors
[
0
].
nOffset
=
0
;
editor
->
pCursors
[
1
]
=
editor
->
pCursors
[
0
];
ME_CommitCoalescingUndo
(
editor
);
...
...
@@ -2562,14 +2562,14 @@ static BOOL handle_enter(ME_TextEditor *editor)
{
ME_ContinueCoalescingTransaction
(
editor
);
if
(
cursor
.
pRun
->
member
.
run
.
nCharOfs
+
cursor
.
nOffset
==
0
&&
!
ME_IsInTable
(
para
->
member
.
para
.
prev_para
))
para_prev
(
para
)
&&
!
para_in_table
(
para_prev
(
para
)
))
{
/* Insert newline before table */
cursor
.
pRun
=
ME_FindItemBack
(
para
,
diRun
);
cursor
.
pRun
=
run_get_di
(
para_end_run
(
para_prev
(
para
)
)
);
if
(
cursor
.
pRun
)
{
editor
->
pCursors
[
0
].
pRun
=
cursor
.
pRun
;
editor
->
pCursors
[
0
].
pPara
=
para
->
member
.
para
.
prev_para
;
editor
->
pCursors
[
0
].
pPara
=
para
_get_di
(
para_prev
(
para
)
)
;
}
editor
->
pCursors
[
0
].
nOffset
=
0
;
editor
->
pCursors
[
1
]
=
editor
->
pCursors
[
0
];
...
...
@@ -2579,9 +2579,9 @@ static BOOL handle_enter(ME_TextEditor *editor)
else
{
editor
->
pCursors
[
1
]
=
editor
->
pCursors
[
0
];
para
=
para_get_di
(
table_append_row
(
editor
,
&
para
->
member
.
para
)
);
editor
->
pCursors
[
0
].
pPara
=
para
;
editor
->
pCursors
[
0
].
pRun
=
ME_FindItemFwd
(
para
,
diRun
);
para
=
table_append_row
(
editor
,
para
);
editor
->
pCursors
[
0
].
pPara
=
para
_get_di
(
para
)
;
editor
->
pCursors
[
0
].
pRun
=
run_get_di
(
para_first_run
(
para
)
);
editor
->
pCursors
[
0
].
nOffset
=
0
;
editor
->
pCursors
[
1
]
=
editor
->
pCursors
[
0
];
}
...
...
@@ -2597,8 +2597,8 @@ static BOOL handle_enter(ME_TextEditor *editor)
/* Normally the new eop style is the insert style, however in a list it is copied from the existing
eop style (this prevents the list label style changing when the new eop is inserted).
No extra ref is taken here on eop_style. */
if
(
para
->
member
.
para
.
fmt
.
wNumbering
)
eop_style
=
para
->
member
.
para
.
eop_run
->
style
;
if
(
para
->
fmt
.
wNumbering
)
eop_style
=
para
->
eop_run
->
style
;
else
eop_style
=
style
;
ME_ContinueCoalescingTransaction
(
editor
);
...
...
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