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
77895ecd
Commit
77895ecd
authored
Oct 29, 2020
by
Huw Davies
Committed by
Alexandre Julliard
Oct 29, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
riched20: Use cell ptrs in the append table row function.
Signed-off-by:
Huw Davies
<
huw@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
20b4a035
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
19 deletions
+16
-19
table.c
dlls/riched20/table.c
+16
-19
No files found.
dlls/riched20/table.c
View file @
77895ecd
...
...
@@ -429,16 +429,14 @@ ME_Paragraph* table_append_row( ME_TextEditor *editor, ME_Paragraph *table_row )
{
WCHAR
endl
=
'\r'
,
tab
=
'\t'
;
ME_Run
*
run
;
PARAFORMAT2
*
pFmt
;
int
i
;
assert
(
table_row
);
if
(
!
editor
->
bEmulateVersion10
)
/* v4.1 */
{
ME_
DisplayItem
*
insertedC
ell
,
*
cell
;
ME_Paragraph
*
para
,
*
prev_table_end
;
ME_
Cell
*
new_c
ell
,
*
cell
;
ME_Paragraph
*
para
,
*
prev_table_end
,
*
new_row_start
;
cell
=
ME_FindItemFwd
(
para_get_di
(
table_row_start
(
table_row
)
),
diCell
);
cell
=
table_row_first_cell
(
table_row
);
prev_table_end
=
table_row_end
(
table_row
);
para
=
para_next
(
prev_table_end
);
run
=
para_first_run
(
para
);
...
...
@@ -446,38 +444,37 @@ ME_Paragraph* table_append_row( ME_TextEditor *editor, ME_Paragraph *table_row )
editor
->
pCursors
[
0
].
pRun
=
run_get_di
(
run
);
editor
->
pCursors
[
0
].
nOffset
=
0
;
editor
->
pCursors
[
1
]
=
editor
->
pCursors
[
0
];
para
=
table_insert_row_start
(
editor
,
editor
->
pCursors
);
insertedCell
=
ME_FindItemFwd
(
para_get_di
(
para
),
diCell
);
new_row_start
=
table_insert_row_start
(
editor
,
editor
->
pCursors
);
new_cell
=
table_row_first_cell
(
new_row_start
);
/* Copy cell properties */
insertedCell
->
member
.
cell
.
nRightBoundary
=
cell
->
member
.
cell
.
nRightBoundary
;
insertedCell
->
member
.
cell
.
border
=
cell
->
member
.
cell
.
border
;
while
(
cell
->
member
.
cell
.
next_cell
)
new_cell
->
nRightBoundary
=
cell
->
nRightBoundary
;
new_cell
->
border
=
cell
->
border
;
while
(
cell
_next
(
cell
)
)
{
cell
=
cell
->
member
.
cell
.
next_cell
;
cell
=
cell
_next
(
cell
)
;
para
=
table_insert_cell
(
editor
,
editor
->
pCursors
);
insertedCell
=
ME_FindItemBack
(
para_get_di
(
para
),
diCell
);
new_cell
=
para_cell
(
para
);
/* Copy cell properties */
insertedCell
->
member
.
cell
.
nRightBoundary
=
cell
->
member
.
cell
.
nRightBoundary
;
insertedCell
->
member
.
cell
.
border
=
cell
->
member
.
cell
.
border
;
new_cell
->
nRightBoundary
=
cell
->
nRightBoundary
;
new_cell
->
border
=
cell
->
border
;
};
para
=
table_insert_row_end
(
editor
,
editor
->
pCursors
);
para
->
fmt
=
prev_table_end
->
fmt
;
/* return the table row start for the inserted paragraph */
return
para_next
(
&
ME_FindItemFwd
(
cell
,
diParagraph
)
->
member
.
para
)
;
return
new_row_start
;
}
else
/* v1.0 - 3.0 */
{
run
=
para_end_run
(
table_row
);
pFmt
=
&
table_row
->
fmt
;
assert
(
pFmt
->
dwMask
&
PFM_TABLE
&&
pFmt
->
wEffects
&
PFE_TABLE
);
assert
(
para_in_table
(
table_row
)
);
editor
->
pCursors
[
0
].
pPara
=
para_get_di
(
table_row
);
editor
->
pCursors
[
0
].
pRun
=
run_get_di
(
run
);
editor
->
pCursors
[
0
].
nOffset
=
0
;
editor
->
pCursors
[
1
]
=
editor
->
pCursors
[
0
];
ME_InsertTextFromCursor
(
editor
,
0
,
&
endl
,
1
,
run
->
style
);
run
=
&
editor
->
pCursors
[
0
].
pRun
->
member
.
run
;
for
(
i
=
0
;
i
<
pFmt
->
cTabCount
;
i
++
)
ME_InsertTextFromCursor
(
editor
,
0
,
&
tab
,
1
,
run
->
style
);
for
(
i
=
0
;
i
<
table_row
->
fmt
.
cTabCount
;
i
++
)
ME_InsertTextFromCursor
(
editor
,
0
,
&
tab
,
1
,
run
->
style
);
return
para_next
(
table_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