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
3131f919
Commit
3131f919
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 to link the cells.
Signed-off-by:
Huw Davies
<
huw@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
b7084cd7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
24 deletions
+19
-24
editstr.h
dlls/riched20/editstr.h
+2
-2
para.c
dlls/riched20/para.c
+14
-17
table.c
dlls/riched20/table.c
+3
-5
No files found.
dlls/riched20/editstr.h
View file @
3131f919
...
...
@@ -206,7 +206,7 @@ typedef struct tagME_Paragraph
PARAFORMAT2
fmt
;
ME_String
*
text
;
struct
tagME_
DisplayItem
*
pC
ell
;
/* v4.1 */
struct
tagME_
Cell
*
c
ell
;
/* v4.1 */
ME_BorderRect
border
;
int
nCharOfs
;
...
...
@@ -228,7 +228,7 @@ typedef struct tagME_Cell /* v4.1 */
POINT
pt
;
int
nHeight
,
nWidth
;
int
yTextOffset
;
/* The text offset is caused by the largest top border. */
struct
tagME_
DisplayItem
*
prev_cell
,
*
next_cell
,
*
parent_cell
;
struct
tagME_
Cell
*
prev_cell
,
*
next_cell
,
*
parent_cell
;
}
ME_Cell
;
typedef
struct
tagME_Row
...
...
dlls/riched20/para.c
View file @
3131f919
...
...
@@ -126,8 +126,7 @@ BOOL para_in_table( ME_Paragraph *para )
ME_Cell
*
para_cell
(
ME_Paragraph
*
para
)
{
if
(
!
para
->
pCell
)
return
NULL
;
return
&
para
->
pCell
->
member
.
cell
;
return
para
->
cell
;
}
ME_Row
*
para_first_row
(
ME_Paragraph
*
para
)
...
...
@@ -625,13 +624,13 @@ ME_Paragraph *para_split( ME_TextEditor *editor, ME_Run *run, ME_Style *style,
{
ME_Cell
*
cell
=
cell_create
();
ME_InsertBefore
(
para_get_di
(
new_para
),
cell_get_di
(
cell
)
);
new_para
->
pCell
=
cell_get_di
(
cell
)
;
new_para
->
cell
=
cell
;
cell
->
next_cell
=
NULL
;
if
(
paraFlags
&
MEPF_ROWSTART
)
{
old_para
->
nFlags
|=
MEPF_ROWSTART
;
cell
->
prev_cell
=
NULL
;
cell
->
parent_cell
=
old_para
->
pC
ell
;
cell
->
parent_cell
=
old_para
->
c
ell
;
if
(
para_cell
(
old_para
))
cell
->
nNestingLevel
=
para_cell
(
old_para
)
->
nNestingLevel
+
1
;
else
...
...
@@ -639,8 +638,8 @@ ME_Paragraph *para_split( ME_TextEditor *editor, ME_Run *run, ME_Style *style,
}
else
{
cell
->
prev_cell
=
old_para
->
pC
ell
;
cell_prev
(
cell
)
->
next_cell
=
cell
_get_di
(
cell
)
;
cell
->
prev_cell
=
old_para
->
c
ell
;
cell_prev
(
cell
)
->
next_cell
=
cell
;
assert
(
old_para
->
nFlags
&
MEPF_CELL
);
assert
(
!
(
old_para
->
nFlags
&
MEPF_ROWSTART
)
);
cell
->
nNestingLevel
=
cell_prev
(
cell
)
->
nNestingLevel
;
...
...
@@ -650,19 +649,19 @@ ME_Paragraph *para_split( ME_TextEditor *editor, ME_Run *run, ME_Style *style,
else
if
(
paraFlags
&
MEPF_ROWEND
)
{
old_para
->
nFlags
|=
MEPF_ROWEND
;
old_para
->
pCell
=
old_para
->
pCell
->
member
.
cell
.
parent_cell
;
new_para
->
pCell
=
old_para
->
pC
ell
;
old_para
->
cell
=
old_para
->
cell
->
parent_cell
;
new_para
->
cell
=
old_para
->
c
ell
;
assert
(
para_prev
(
old_para
)
->
nFlags
&
MEPF_CELL
);
assert
(
!
(
para_prev
(
old_para
)
->
nFlags
&
MEPF_ROWSTART
)
);
if
(
new_para
->
pCell
!=
para_next
(
new_para
)
->
pC
ell
&&
para_next
(
new_para
)
->
pC
ell
&&
!
para_next
(
new_para
)
->
pCell
->
member
.
cell
.
prev_cell
)
if
(
new_para
->
cell
!=
para_next
(
new_para
)
->
c
ell
&&
para_next
(
new_para
)
->
c
ell
&&
!
cell_prev
(
para_next
(
new_para
)
->
cell
)
)
{
/* Row starts just after the row that was ended. */
new_para
->
nFlags
|=
MEPF_ROWSTART
;
}
}
else
new_para
->
pCell
=
old_para
->
pC
ell
;
else
new_para
->
cell
=
old_para
->
c
ell
;
table_update_flags
(
old_para
);
table_update_flags
(
new_para
);
...
...
@@ -721,7 +720,7 @@ ME_Paragraph *para_join( ME_TextEditor *editor, ME_Paragraph *para, BOOL use_fir
{
/* Table cell/row properties are always moved over from the removed para. */
para
->
nFlags
=
next
->
nFlags
;
para
->
pCell
=
next
->
pC
ell
;
para
->
cell
=
next
->
c
ell
;
/* Remove cell boundary if it is between the end paragraph run and the next
* paragraph display item. */
...
...
@@ -740,10 +739,8 @@ ME_Paragraph *para_join( ME_TextEditor *editor, ME_Paragraph *para, BOOL use_fir
if
(
cell
)
{
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
;
if
(
cell_prev
(
cell
))
cell_prev
(
cell
)
->
next_cell
=
cell_next
(
cell
);
if
(
cell_next
(
cell
))
cell_next
(
cell
)
->
prev_cell
=
cell_prev
(
cell
);
ME_DestroyDisplayItem
(
cell_get_di
(
cell
)
);
}
...
...
dlls/riched20/table.c
View file @
3131f919
...
...
@@ -96,7 +96,7 @@ ME_Paragraph* table_insert_row_start_at_para( ME_TextEditor *editor, ME_Paragrap
while
(
para
!=
end_para
)
{
para
->
pCell
=
cell_get_di
(
para_cell
(
prev_para
)
);
para
->
cell
=
para_cell
(
prev_para
);
para
->
nFlags
|=
MEPF_CELL
;
para
->
nFlags
&=
~
(
MEPF_ROWSTART
|
MEPF_ROWEND
);
para
->
fmt
.
dwMask
|=
PFM_TABLE
|
PFM_TABLEROWDELIMITER
;
...
...
@@ -193,14 +193,12 @@ ME_Cell *cell_create( void )
ME_Cell
*
cell_next
(
ME_Cell
*
cell
)
{
if
(
!
cell
->
next_cell
)
return
NULL
;
return
&
cell
->
next_cell
->
member
.
cell
;
return
cell
->
next_cell
;
}
ME_Cell
*
cell_prev
(
ME_Cell
*
cell
)
{
if
(
!
cell
->
prev_cell
)
return
NULL
;
return
&
cell
->
prev_cell
->
member
.
cell
;
return
cell
->
prev_cell
;
}
ME_Paragraph
*
cell_first_para
(
ME_Cell
*
cell
)
...
...
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