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
9265a915
Commit
9265a915
authored
Oct 10, 2016
by
Huw Davies
Committed by
Alexandre Julliard
Oct 10, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
riched20: Add support for letter labelled lists.
Signed-off-by:
Huw Davies
<
huw@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
db783986
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
1 deletion
+34
-1
para.c
dlls/riched20/para.c
+34
-1
No files found.
dlls/riched20/para.c
View file @
9265a915
...
...
@@ -155,13 +155,46 @@ static ME_String *para_num_get_str( ME_Paragraph *para, WORD num )
ME_String
*
str
=
ME_MakeStringEmpty
(
5
+
2
);
WCHAR
*
p
=
str
->
szData
;
static
const
WCHAR
fmtW
[]
=
{
'%'
,
'd'
,
0
};
static
const
WORD
letter_base
[]
=
{
1
,
26
,
26
*
26
,
26
*
26
*
26
};
int
i
,
len
;
WORD
letter
,
total
,
char_offset
=
0
;
if
(
!
str
)
return
NULL
;
if
((
para
->
fmt
.
wNumberingStyle
&
0xf00
)
==
PFNS_PARENS
)
*
p
++
=
'('
;
p
+=
sprintfW
(
p
,
fmtW
,
num
);
switch
(
para
->
fmt
.
wNumbering
)
{
case
PFN_ARABIC
:
default:
p
+=
sprintfW
(
p
,
fmtW
,
num
);
break
;
case
PFN_LCLETTER
:
char_offset
=
'a'
-
'A'
;
/* fall through */
case
PFN_UCLETTER
:
if
(
!
num
)
num
=
1
;
/* This is not base-26 (or 27) as zeros don't count unless they are leading zeros.
It's simplest to start with the least significant letter, so first calculate how many letters are needed. */
for
(
i
=
0
,
total
=
0
;
i
<
sizeof
(
letter_base
)
/
sizeof
(
letter_base
[
0
]);
i
++
)
{
total
+=
letter_base
[
i
];
if
(
num
<
total
)
break
;
}
len
=
i
;
for
(
i
=
0
;
i
<
len
;
i
++
)
{
num
-=
letter_base
[
i
];
letter
=
(
num
/
letter_base
[
i
])
%
26
;
p
[
len
-
i
-
1
]
=
letter
+
'A'
+
char_offset
;
}
p
+=
len
;
*
p
=
0
;
break
;
}
switch
(
para
->
fmt
.
wNumberingStyle
&
0xf00
)
{
...
...
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