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
3e9a31ed
Commit
3e9a31ed
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: Add a helper to find a colour in the colour table.
Signed-off-by:
Huw Davies
<
huw@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
48c0c664
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
32 deletions
+30
-32
writer.c
dlls/riched20/writer.c
+30
-32
No files found.
dlls/riched20/writer.c
View file @
3e9a31ed
...
...
@@ -277,6 +277,23 @@ static void add_color_to_colortbl( ME_OutStream *stream, COLORREF color )
}
}
static
BOOL
find_color_in_colortbl
(
ME_OutStream
*
stream
,
COLORREF
color
,
unsigned
int
*
idx
)
{
int
i
;
*
idx
=
0
;
for
(
i
=
1
;
i
<
stream
->
nColorTblLen
;
i
++
)
{
if
(
stream
->
colortbl
[
i
]
==
color
)
{
*
idx
=
i
;
break
;
}
}
return
i
<
stream
->
nFontTblLen
;
}
static
BOOL
ME_StreamOutRTFFontAndColorTbl
(
ME_OutStream
*
pStream
,
ME_DisplayItem
*
pFirstRun
,
ME_DisplayItem
*
pLastRun
)
...
...
@@ -391,17 +408,13 @@ ME_StreamOutRTFTableProps(ME_TextEditor *editor, ME_OutStream *pStream,
{
if
(
borders
[
i
]
->
width
)
{
unsigned
int
j
;
unsigned
int
idx
;
COLORREF
crColor
=
borders
[
i
]
->
colorRef
;
sprintf
(
props
+
strlen
(
props
),
"
\\
clbrdr%c"
,
sideChar
[
i
]);
sprintf
(
props
+
strlen
(
props
),
"
\\
brdrs"
);
sprintf
(
props
+
strlen
(
props
),
"
\\
brdrw%d"
,
borders
[
i
]
->
width
);
for
(
j
=
1
;
j
<
pStream
->
nColorTblLen
;
j
++
)
{
if
(
pStream
->
colortbl
[
j
]
==
crColor
)
{
sprintf
(
props
+
strlen
(
props
),
"
\\
brdrcf%u"
,
j
);
break
;
}
}
if
(
find_color_in_colortbl
(
pStream
,
crColor
,
&
idx
))
sprintf
(
props
+
strlen
(
props
),
"
\\
brdrcf%u"
,
idx
);
}
}
sprintf
(
props
+
strlen
(
props
),
"
\\
cellx%d"
,
cell
->
member
.
cell
.
nRightBoundary
);
...
...
@@ -423,17 +436,13 @@ ME_StreamOutRTFTableProps(ME_TextEditor *editor, ME_OutStream *pStream,
{
if
(
borders
[
i
]
->
width
)
{
unsigned
int
j
;
unsigned
int
idx
;
COLORREF
crColor
=
borders
[
i
]
->
colorRef
;
sprintf
(
props
+
strlen
(
props
),
"
\\
trbrdr%c"
,
sideChar
[
i
]);
sprintf
(
props
+
strlen
(
props
),
"
\\
brdrs"
);
sprintf
(
props
+
strlen
(
props
),
"
\\
brdrw%d"
,
borders
[
i
]
->
width
);
for
(
j
=
1
;
j
<
pStream
->
nColorTblLen
;
j
++
)
{
if
(
pStream
->
colortbl
[
j
]
==
crColor
)
{
sprintf
(
props
+
strlen
(
props
),
"
\\
brdrcf%u"
,
j
);
break
;
}
}
if
(
find_color_in_colortbl
(
pStream
,
crColor
,
&
idx
))
sprintf
(
props
+
strlen
(
props
),
"
\\
brdrcf%u"
,
idx
);
}
}
for
(
i
=
0
;
i
<
pFmt
->
cTabCount
;
i
++
)
...
...
@@ -642,26 +651,15 @@ ME_StreamOutRTFCharProps(ME_OutStream *pStream, CHARFORMAT2W *fmt)
strcat
(
props
,
"
\\
caps"
);
if
(
fmt
->
dwMask
&
CFM_ANIMATION
)
sprintf
(
props
+
strlen
(
props
),
"
\\
animtext%u"
,
fmt
->
bAnimation
);
if
(
fmt
->
dwMask
&
CFM_BACKCOLOR
)
{
if
(
!
(
fmt
->
dwEffects
&
CFE_AUTOBACKCOLOR
))
{
for
(
i
=
1
;
i
<
pStream
->
nColorTblLen
;
i
++
)
if
(
pStream
->
colortbl
[
i
]
==
fmt
->
crBackColor
)
{
sprintf
(
props
+
strlen
(
props
),
"
\\
cb%u"
,
i
);
break
;
}
}
}
if
((
fmt
->
dwMask
&
CFM_BACKCOLOR
)
&&
!
(
fmt
->
dwEffects
&
CFE_AUTOBACKCOLOR
))
if
(
find_color_in_colortbl
(
pStream
,
fmt
->
crBackColor
,
&
i
))
sprintf
(
props
+
strlen
(
props
),
"
\\
cb%u"
,
i
);
if
(
fmt
->
dwMask
&
CFM_BOLD
&&
fmt
->
dwEffects
&
CFE_BOLD
)
strcat
(
props
,
"
\\
b"
);
if
(
fmt
->
dwMask
&
CFM_COLOR
)
{
if
(
!
(
fmt
->
dwEffects
&
CFE_AUTOCOLOR
))
{
for
(
i
=
1
;
i
<
pStream
->
nColorTblLen
;
i
++
)
if
(
pStream
->
colortbl
[
i
]
==
fmt
->
crTextColor
)
{
sprintf
(
props
+
strlen
(
props
),
"
\\
cf%u"
,
i
);
break
;
}
}
}
if
((
fmt
->
dwMask
&
CFM_COLOR
)
&&
!
(
fmt
->
dwEffects
&
CFE_AUTOCOLOR
))
if
(
find_color_in_colortbl
(
pStream
,
fmt
->
crTextColor
,
&
i
))
sprintf
(
props
+
strlen
(
props
),
"
\\
cf%u"
,
i
);
/* TODO: CFM_DISABLED */
if
(
fmt
->
dwMask
&
CFM_EMBOSS
&&
fmt
->
dwEffects
&
CFE_EMBOSS
)
strcat
(
props
,
"
\\
embo"
);
...
...
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