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
b7084cd7
Commit
b7084cd7
authored
Nov 06, 2020
by
Huw Davies
Committed by
Alexandre Julliard
Nov 06, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
riched20: Use cell ptrs in the paragraph splitting and joining functions.
Signed-off-by:
Huw Davies
<
huw@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
b692fb5e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
30 deletions
+37
-30
editor.h
dlls/riched20/editor.h
+1
-0
para.c
dlls/riched20/para.c
+30
-30
table.c
dlls/riched20/table.c
+6
-0
No files found.
dlls/riched20/editor.h
View file @
b7084cd7
...
...
@@ -289,6 +289,7 @@ ME_Paragraph *editor_end_para( ME_TextEditor *editor ) DECLSPEC_HIDDEN;
ME_Paragraph
*
editor_first_para
(
ME_TextEditor
*
editor
)
DECLSPEC_HIDDEN
;
/* table.c */
ME_Cell
*
cell_create
(
void
)
DECLSPEC_HIDDEN
;
ME_Paragraph
*
cell_end_para
(
ME_Cell
*
cell
)
DECLSPEC_HIDDEN
;
ME_Paragraph
*
cell_first_para
(
ME_Cell
*
cell
)
DECLSPEC_HIDDEN
;
ME_Cell
*
cell_next
(
ME_Cell
*
cell
)
DECLSPEC_HIDDEN
;
...
...
dlls/riched20/para.c
View file @
b7084cd7
...
...
@@ -243,7 +243,7 @@ static void table_update_flags( ME_Paragraph *para )
{
para
->
fmt
.
dwMask
|=
PFM_TABLE
|
PFM_TABLEROWDELIMITER
;
if
(
para
->
pCell
)
para
->
nFlags
|=
MEPF_CELL
;
if
(
para
_cell
(
para
)
)
para
->
nFlags
|=
MEPF_CELL
;
else
para
->
nFlags
&=
~
MEPF_CELL
;
if
(
para
->
nFlags
&
MEPF_ROWEND
)
para
->
fmt
.
wEffects
|=
PFE_TABLEROWDELIMITER
;
...
...
@@ -623,29 +623,28 @@ ME_Paragraph *para_split( ME_TextEditor *editor, ME_Run *run, ME_Style *style,
{
if
(
paraFlags
&
(
MEPF_ROWSTART
|
MEPF_CELL
))
{
ME_
DisplayItem
*
cell
=
ME_MakeDI
(
diCell
);
ME_InsertBefore
(
para_get_di
(
new_para
),
cell
);
new_para
->
pCell
=
cell
;
cell
->
member
.
cell
.
next_cell
=
NULL
;
ME_
Cell
*
cell
=
cell_create
(
);
ME_InsertBefore
(
para_get_di
(
new_para
),
cell
_get_di
(
cell
)
);
new_para
->
pCell
=
cell
_get_di
(
cell
)
;
cell
->
next_cell
=
NULL
;
if
(
paraFlags
&
MEPF_ROWSTART
)
{
old_para
->
nFlags
|=
MEPF_ROWSTART
;
cell
->
member
.
cell
.
prev_cell
=
NULL
;
cell
->
member
.
cell
.
parent_cell
=
old_para
->
pCell
;
if
(
old_para
->
pCell
)
cell
->
member
.
cell
.
nNestingLevel
=
old_para
->
pCell
->
member
.
cell
.
nNestingLevel
+
1
;
cell
->
prev_cell
=
NULL
;
cell
->
parent_cell
=
old_para
->
pCell
;
if
(
para_cell
(
old_para
)
)
cell
->
nNestingLevel
=
para_cell
(
old_para
)
->
nNestingLevel
+
1
;
else
cell
->
member
.
cell
.
nNestingLevel
=
1
;
cell
->
nNestingLevel
=
1
;
}
else
{
cell
->
member
.
cell
.
prev_cell
=
old_para
->
pCell
;
assert
(
cell
->
member
.
cell
.
prev_cell
);
cell
->
member
.
cell
.
prev_cell
->
member
.
cell
.
next_cell
=
cell
;
cell
->
prev_cell
=
old_para
->
pCell
;
cell_prev
(
cell
)
->
next_cell
=
cell_get_di
(
cell
);
assert
(
old_para
->
nFlags
&
MEPF_CELL
);
assert
(
!
(
old_para
->
nFlags
&
MEPF_ROWSTART
)
);
cell
->
member
.
cell
.
nNestingLevel
=
cell
->
member
.
cell
.
prev_cell
->
member
.
cell
.
nNestingLevel
;
cell
->
member
.
cell
.
parent_cell
=
cell
->
member
.
cell
.
prev_cell
->
member
.
cell
.
parent_cell
;
cell
->
nNestingLevel
=
cell_prev
(
cell
)
->
nNestingLevel
;
cell
->
parent_cell
=
cell_prev
(
cell
)
->
parent_cell
;
}
}
else
if
(
paraFlags
&
MEPF_ROWEND
)
...
...
@@ -653,11 +652,11 @@ ME_Paragraph *para_split( ME_TextEditor *editor, ME_Run *run, ME_Style *style,
old_para
->
nFlags
|=
MEPF_ROWEND
;
old_para
->
pCell
=
old_para
->
pCell
->
member
.
cell
.
parent_cell
;
new_para
->
pCell
=
old_para
->
pCell
;
assert
(
old_para
->
prev_para
->
member
.
para
.
nFlags
&
MEPF_CELL
);
assert
(
!
(
old_para
->
prev_para
->
member
.
para
.
nFlags
&
MEPF_ROWSTART
)
);
if
(
new_para
->
pCell
!=
new_para
->
next_para
->
member
.
para
.
pCell
&&
new_para
->
next_para
->
member
.
para
.
pCell
&&
!
new_para
->
next_para
->
member
.
para
.
pCell
->
member
.
cell
.
prev_cell
)
assert
(
para_prev
(
old_para
)
->
nFlags
&
MEPF_CELL
);
assert
(
!
(
para_prev
(
old_para
)
->
nFlags
&
MEPF_ROWSTART
)
);
if
(
new_para
->
pCell
!=
para_next
(
new_para
)
->
pCell
&&
para_next
(
new_para
)
->
pCell
&&
!
para_next
(
new_para
)
->
pCell
->
member
.
cell
.
prev_cell
)
{
/* Row starts just after the row that was ended. */
new_para
->
nFlags
|=
MEPF_ROWSTART
;
...
...
@@ -686,9 +685,10 @@ ME_Paragraph *para_split( ME_TextEditor *editor, ME_Run *run, ME_Style *style,
specified in use_first_fmt */
ME_Paragraph
*
para_join
(
ME_TextEditor
*
editor
,
ME_Paragraph
*
para
,
BOOL
use_first_fmt
)
{
ME_DisplayItem
*
tmp
,
*
pCell
=
NULL
;
ME_DisplayItem
*
tmp
;
ME_Paragraph
*
next
=
para_next
(
para
);
ME_Run
*
end_run
,
*
next_first_run
,
*
tmp_run
;
ME_Cell
*
cell
=
NULL
;
int
i
,
shift
;
int
end_len
;
CHARFORMAT2W
fmt
;
...
...
@@ -729,22 +729,22 @@ ME_Paragraph *para_join( ME_TextEditor *editor, ME_Paragraph *para, BOOL use_fir
{
if
(
tmp
->
type
==
diCell
)
{
pCell
=
tmp
;
cell
=
&
tmp
->
member
.
cell
;
break
;
}
}
}
add_undo_split_para
(
editor
,
next
,
eol_str
,
pCell
?
&
pCell
->
member
.
cell
:
NULL
);
add_undo_split_para
(
editor
,
next
,
eol_str
,
cell
);
if
(
pC
ell
)
if
(
c
ell
)
{
ME_Remove
(
pCell
);
if
(
pCell
->
member
.
cell
.
prev_cell
)
pCell
->
member
.
cell
.
prev_cell
->
member
.
cell
.
next_cell
=
pCell
->
member
.
cell
.
next_cell
;
if
(
pCell
->
member
.
cell
.
next_cell
)
pCell
->
member
.
cell
.
next_cell
->
member
.
cell
.
prev_cell
=
pCell
->
member
.
cell
.
prev_cell
;
ME_DestroyDisplayItem
(
pCell
);
ME_Remove
(
cell_get_di
(
cell
)
);
if
(
cell_prev
(
cell
)
)
cell_prev
(
cell
)
->
next_cell
=
cell_next
(
cell
)
?
cell_get_di
(
cell_next
(
cell
)
)
:
NULL
;
if
(
cell_next
(
cell
)
)
cell_next
(
cell
)
->
prev_cell
=
cell_prev
(
cell
)
?
cell_get_di
(
cell_prev
(
cell
)
)
:
NULL
;
ME_DestroyDisplayItem
(
cell_get_di
(
cell
)
);
}
if
(
!
use_first_fmt
)
...
...
dlls/riched20/table.c
View file @
b7084cd7
...
...
@@ -185,6 +185,12 @@ ME_Cell *table_row_end_cell( ME_Paragraph *para )
return
cell_next
(
para_cell
(
para
)
);
}
ME_Cell
*
cell_create
(
void
)
{
ME_DisplayItem
*
item
=
ME_MakeDI
(
diCell
);
return
&
item
->
member
.
cell
;
}
ME_Cell
*
cell_next
(
ME_Cell
*
cell
)
{
if
(
!
cell
->
next_cell
)
return
NULL
;
...
...
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