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
c69e60ef
Commit
c69e60ef
authored
Oct 12, 2016
by
Huw Davies
Committed by
Alexandre Julliard
Oct 12, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
riched20: Emit RTF for paragraph numbering.
Signed-off-by:
Huw Davies
<
huw@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
3e9a31ed
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
78 additions
and
1 deletion
+78
-1
writer.c
dlls/riched20/writer.c
+78
-1
No files found.
dlls/riched20/writer.c
View file @
c69e60ef
...
...
@@ -456,6 +456,76 @@ ME_StreamOutRTFTableProps(ME_TextEditor *editor, ME_OutStream *pStream,
return
TRUE
;
}
static
BOOL
stream_out_para_num
(
ME_OutStream
*
stream
,
ME_Paragraph
*
para
,
BOOL
pn_dest
)
{
static
const
char
fmt_label
[]
=
"{
\\
*
\\
pn
\\
pnlvlbody
\\
pnf%u
\\
pnindent%d
\\
pnstart%d%s%s}"
;
static
const
char
fmt_bullet
[]
=
"{
\\
*
\\
pn
\\
pnlvlblt
\\
pnf%u
\\
pnindent%d{
\\
pntxtb
\\
'b7}}"
;
static
const
char
dec
[]
=
"
\\
pndec"
;
static
const
char
lcltr
[]
=
"
\\
pnlcltr"
;
static
const
char
ucltr
[]
=
"
\\
pnucltr"
;
static
const
char
lcrm
[]
=
"
\\
pnlcrm"
;
static
const
char
ucrm
[]
=
"
\\
pnucrm"
;
static
const
char
period
[]
=
"{
\\
pntxta.}"
;
static
const
char
paren
[]
=
"{
\\
pntxta)}"
;
static
const
char
parens
[]
=
"{
\\
pntxtb(}{
\\
pntxta)}"
;
const
char
*
type
,
*
style
=
""
;
unsigned
int
idx
;
find_font_in_fonttbl
(
stream
,
&
para
->
para_num
.
style
->
fmt
,
&
idx
);
if
(
!
ME_StreamOutPrint
(
stream
,
"{
\\
pntext
\\
f%u "
,
idx
))
return
FALSE
;
if
(
!
ME_StreamOutRTFText
(
stream
,
para
->
para_num
.
text
->
szData
,
para
->
para_num
.
text
->
nLen
))
return
FALSE
;
if
(
!
ME_StreamOutPrint
(
stream
,
"
\\
tab}"
))
return
FALSE
;
if
(
!
pn_dest
)
return
TRUE
;
if
(
para
->
fmt
.
wNumbering
==
PFN_BULLET
)
{
if
(
!
ME_StreamOutPrint
(
stream
,
fmt_bullet
,
idx
,
para
->
fmt
.
wNumberingTab
))
return
FALSE
;
}
else
{
switch
(
para
->
fmt
.
wNumbering
)
{
case
PFN_ARABIC
:
default:
type
=
dec
;
break
;
case
PFN_LCLETTER
:
type
=
lcltr
;
break
;
case
PFN_UCLETTER
:
type
=
ucltr
;
break
;
case
PFN_LCROMAN
:
type
=
lcrm
;
break
;
case
PFN_UCROMAN
:
type
=
ucrm
;
break
;
}
switch
(
para
->
fmt
.
wNumberingStyle
&
0xf00
)
{
case
PFNS_PERIOD
:
style
=
period
;
break
;
case
PFNS_PAREN
:
style
=
paren
;
break
;
case
PFNS_PARENS
:
style
=
parens
;
break
;
}
if
(
!
ME_StreamOutPrint
(
stream
,
fmt_label
,
idx
,
para
->
fmt
.
wNumberingTab
,
para
->
fmt
.
wNumberingStart
,
type
,
style
))
return
FALSE
;
}
return
TRUE
;
}
static
BOOL
ME_StreamOutRTFParaProps
(
ME_TextEditor
*
editor
,
ME_OutStream
*
pStream
,
ME_DisplayItem
*
para
)
...
...
@@ -501,11 +571,18 @@ ME_StreamOutRTFParaProps(ME_TextEditor *editor, ME_OutStream *pStream,
}
if
(
prev_para
&&
!
memcmp
(
fmt
,
&
prev_para
->
fmt
,
sizeof
(
*
fmt
)
))
{
if
(
fmt
->
wNumbering
)
return
stream_out_para_num
(
pStream
,
&
para
->
member
.
para
,
FALSE
);
return
TRUE
;
}
if
(
!
ME_StreamOutPrint
(
pStream
,
"
\\
pard"
))
return
FALSE
;
if
(
fmt
->
wNumbering
)
if
(
!
stream_out_para_num
(
pStream
,
&
para
->
member
.
para
,
TRUE
))
return
FALSE
;
if
(
!
editor
->
bEmulateVersion10
)
{
/* v4.1 */
if
(
pStream
->
nNestingLevel
>
0
)
strcat
(
props
,
"
\\
intbl"
);
...
...
@@ -515,7 +592,7 @@ ME_StreamOutRTFParaProps(ME_TextEditor *editor, ME_OutStream *pStream,
if
(
fmt
->
dwMask
&
PFM_TABLE
&&
fmt
->
wEffects
&
PFE_TABLE
)
strcat
(
props
,
"
\\
intbl"
);
}
/* TODO: PFM_BORDER. M$ does not emit any keywords for these properties, and
* when streaming border keywords in, PFM_BORDER is set, but wBorder field is
* set very different from the documentation.
...
...
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