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
4c9f013f
Commit
4c9f013f
authored
Aug 22, 2005
by
Phil Krylov
Committed by
Alexandre Julliard
Aug 22, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added handling of deff RTF control word.
parent
2cc40bac
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
6 deletions
+37
-6
editor.c
dlls/riched20/editor.c
+11
-6
reader.c
dlls/riched20/reader.c
+24
-0
rtf.h
dlls/riched20/rtf.h
+2
-0
No files found.
dlls/riched20/editor.c
View file @
4c9f013f
...
...
@@ -393,6 +393,7 @@ static void ME_RTFCharAttrHook(RTF_Info *info)
style2
=
ME_ApplyStyle
(
info
->
style
,
&
fmt
);
ME_ReleaseStyle
(
info
->
style
);
info
->
style
=
style2
;
info
->
styleChanged
=
TRUE
;
}
}
...
...
@@ -476,18 +477,22 @@ static void ME_RTFReadHook(RTF_Info *info) {
info
->
stack
[
info
->
stackTop
].
unicodeLength
=
info
->
unicodeLength
;
}
info
->
stackTop
++
;
info
->
styleChanged
=
FALSE
;
break
;
case
rtfEndGroup
:
{
ME_Style
*
s
;
RTFFlushOutputBuffer
(
info
);
info
->
stackTop
--
;
/* FIXME too slow ? how come ? */
s
=
ME_ApplyStyle
(
info
->
style
,
&
info
->
stack
[
info
->
stackTop
].
fmt
);
ME_ReleaseStyle
(
info
->
style
);
info
->
style
=
s
;
info
->
codePage
=
info
->
stack
[
info
->
stackTop
].
codePage
;
info
->
unicodeLength
=
info
->
stack
[
info
->
stackTop
].
unicodeLength
;
if
(
info
->
styleChanged
)
{
/* FIXME too slow ? how come ? */
s
=
ME_ApplyStyle
(
info
->
style
,
&
info
->
stack
[
info
->
stackTop
].
fmt
);
ME_ReleaseStyle
(
info
->
style
);
info
->
style
=
s
;
info
->
codePage
=
info
->
stack
[
info
->
stackTop
].
codePage
;
info
->
unicodeLength
=
info
->
stack
[
info
->
stackTop
].
unicodeLength
;
}
break
;
}
}
...
...
dlls/riched20/reader.c
View file @
4c9f013f
...
...
@@ -257,6 +257,7 @@ void RTFInit(RTF_Info *info)
info
->
ansiCodePage
=
1252
;
/* Latin-1; actually unused */
info
->
unicodeLength
=
1
;
/* \uc1 is the default */
info
->
codePage
=
info
->
ansiCodePage
;
info
->
defFont
=
0
;
info
->
rtfClass
=
-
1
;
info
->
pushedClass
=
-
1
;
...
...
@@ -1005,6 +1006,14 @@ static void ReadFontTbl(RTF_Info *info)
if
(
!
RTFCheckCM
(
info
,
rtfGroup
,
rtfEndGroup
))
RTFPanic
(
info
,
"%s: missing
\"
}
\"
"
,
fn
);
}
/* Apply the real properties of the default font */
if
(
fp
->
rtfFNum
==
info
->
defFont
)
{
if
(
info
->
ansiCodePage
!=
CP_UTF8
)
info
->
codePage
=
fp
->
rtfFCodePage
;
TRACE
(
"default font codepage %d
\n
"
,
info
->
codePage
);
}
}
if
(
fp
->
rtfFNum
==
-
1
)
RTFPanic
(
info
,
"%s: missing font number"
,
fn
);
...
...
@@ -2467,6 +2476,7 @@ void RTFPanic(RTF_Info *info, const char *fmt, ...)
static
void
TextClass
(
RTF_Info
*
info
);
static
void
ControlClass
(
RTF_Info
*
info
);
static
void
DefFont
(
RTF_Info
*
info
);
static
void
Destination
(
RTF_Info
*
info
);
static
void
SpecialChar
(
RTF_Info
*
info
);
static
void
RTFPutUnicodeChar
(
RTF_Info
*
info
,
int
c
);
...
...
@@ -2516,6 +2526,9 @@ ControlClass (RTF_Info *info)
case
rtfCharSet
:
CharSet
(
info
);
break
;
case
rtfDefFont
:
DefFont
(
info
);
break
;
case
rtfDestination
:
Destination
(
info
);
break
;
...
...
@@ -2542,6 +2555,7 @@ CharAttr(RTF_Info *info)
{
if
(
info
->
ansiCodePage
!=
CP_UTF8
)
info
->
codePage
=
font
->
rtfFCodePage
;
TRACE
(
"font %d codepage %d
\n
"
,
info
->
rtfParam
,
info
->
codePage
);
}
else
RTFMsg
(
info
,
"unknown font %d
\n
"
,
info
->
rtfParam
);
...
...
@@ -2592,8 +2606,18 @@ Destination (RTF_Info *info)
static
void
DefFont
(
RTF_Info
*
info
)
{
TRACE
(
"%d
\n
"
,
info
->
rtfParam
);
info
->
defFont
=
info
->
rtfParam
;
}
static
void
DocAttr
(
RTF_Info
*
info
)
{
TRACE
(
"minor %d, param %d
\n
"
,
info
->
rtfMinor
,
info
->
rtfParam
);
switch
(
info
->
rtfMinor
)
{
case
rtfAnsiCodePage
:
...
...
dlls/riched20/rtf.h
View file @
4c9f013f
...
...
@@ -1070,6 +1070,7 @@ struct _RTF_Info {
RTFColor
*
colorList
;
/* initialized to NULL */
RTFStyle
*
styleList
;
int
ansiCodePage
;
/* ANSI codepage used in conversion to Unicode */
int
defFont
;
/* Character attributes */
int
unicodeLength
;
/* The length of ANSI representation of Unicode characters */
...
...
@@ -1103,6 +1104,7 @@ struct _RTF_Info {
RTFState
stack
[
maxStack
];
int
stackTop
;
BOOL
styleChanged
;
};
...
...
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