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
fab25802
Commit
fab25802
authored
Sep 11, 2008
by
Dylan Smith
Committed by
Alexandre Julliard
Sep 12, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
richedit: Fixed bugs in handling unterminated nested tables in RTF.
parent
0d8e9e62
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
15 deletions
+12
-15
editor.c
dlls/riched20/editor.c
+12
-13
reader.c
dlls/riched20/reader.c
+0
-2
No files found.
dlls/riched20/editor.c
View file @
fab25802
...
@@ -1461,8 +1461,6 @@ static LRESULT ME_StreamIn(ME_TextEditor *editor, DWORD format, EDITSTREAM *stre
...
@@ -1461,8 +1461,6 @@ static LRESULT ME_StreamIn(ME_TextEditor *editor, DWORD format, EDITSTREAM *stre
if
(
!
invalidRTF
&&
!
inStream
.
editstream
->
dwError
)
if
(
!
invalidRTF
&&
!
inStream
.
editstream
->
dwError
)
{
{
if
(
format
&
SF_RTF
)
{
if
(
format
&
SF_RTF
)
{
ME_DisplayItem
*
para
;
/* setup the RTF parser */
/* setup the RTF parser */
memset
(
&
parser
,
0
,
sizeof
parser
);
memset
(
&
parser
,
0
,
sizeof
parser
);
RTFSetEditStream
(
&
parser
,
&
inStream
);
RTFSetEditStream
(
&
parser
,
&
inStream
);
...
@@ -1486,13 +1484,13 @@ static LRESULT ME_StreamIn(ME_TextEditor *editor, DWORD format, EDITSTREAM *stre
...
@@ -1486,13 +1484,13 @@ static LRESULT ME_StreamIn(ME_TextEditor *editor, DWORD format, EDITSTREAM *stre
RTFRead
(
&
parser
);
RTFRead
(
&
parser
);
RTFFlushOutputBuffer
(
&
parser
);
RTFFlushOutputBuffer
(
&
parser
);
if
(
!
editor
->
bEmulateVersion10
)
{
/* v4.1 */
if
(
!
editor
->
bEmulateVersion10
)
{
/* v4.1 */
if
(
parser
.
tableDef
&&
parser
.
tableDef
->
tableRowStart
)
if
(
parser
.
tableDef
&&
parser
.
tableDef
->
tableRowStart
&&
(
parser
.
nestingLevel
>
0
||
parser
.
canInheritInTbl
))
{
{
/* Delete any incomplete table row at the end of the rich text. */
/* Delete any incomplete table row at the end of the rich text. */
int
nOfs
,
nChars
;
int
nOfs
,
nChars
;
ME_DisplayItem
*
pCell
;
ME_DisplayItem
*
pCell
;
ME_DisplayItem
*
para
;
para
=
parser
.
tableDef
->
tableRowStart
;
parser
.
rtfMinor
=
rtfRow
;
parser
.
rtfMinor
=
rtfRow
;
/* Complete the table row before deleting it.
/* Complete the table row before deleting it.
...
@@ -1501,14 +1499,14 @@ static LRESULT ME_StreamIn(ME_TextEditor *editor, DWORD format, EDITSTREAM *stre
...
@@ -1501,14 +1499,14 @@ static LRESULT ME_StreamIn(ME_TextEditor *editor, DWORD format, EDITSTREAM *stre
* will be added for this change to the current paragraph format. */
* will be added for this change to the current paragraph format. */
if
(
parser
.
nestingLevel
>
0
)
if
(
parser
.
nestingLevel
>
0
)
{
{
while
(
parser
.
nestingLevel
--
)
while
(
parser
.
nestingLevel
>
1
)
ME_RTFSpecialCharHook
(
&
parser
);
ME_RTFSpecialCharHook
(
&
parser
);
/* Decrements nestingLevel */
}
else
if
(
parser
.
canInheritInTbl
)
{
para
=
parser
.
tableDef
->
tableRowStart
;
ME_RTFSpecialCharHook
(
&
parser
);
ME_RTFSpecialCharHook
(
&
parser
);
}
}
else
{
if
(
parser
.
tableDef
&&
parser
.
tableDef
->
tableRowStart
&&
para
=
parser
.
tableDef
->
tableRowStart
;
para
->
member
.
para
.
nFlags
&
MEPF_ROWEND
)
ME_RTFSpecialCharHook
(
&
parser
);
{
assert
(
para
->
member
.
para
.
nFlags
&
MEPF_ROWEND
);
para
=
para
->
member
.
para
.
next_para
;
para
=
para
->
member
.
para
.
next_para
;
}
}
pCell
=
para
->
member
.
para
.
pCell
;
pCell
=
para
->
member
.
para
.
pCell
;
...
@@ -1518,7 +1516,8 @@ static LRESULT ME_StreamIn(ME_TextEditor *editor, DWORD format, EDITSTREAM *stre
...
@@ -1518,7 +1516,8 @@ static LRESULT ME_StreamIn(ME_TextEditor *editor, DWORD format, EDITSTREAM *stre
nOfs
=
ME_GetCursorOfs
(
editor
,
1
);
nOfs
=
ME_GetCursorOfs
(
editor
,
1
);
nChars
=
ME_GetCursorOfs
(
editor
,
0
)
-
nOfs
;
nChars
=
ME_GetCursorOfs
(
editor
,
0
)
-
nOfs
;
ME_InternalDeleteText
(
editor
,
nOfs
,
nChars
,
TRUE
);
ME_InternalDeleteText
(
editor
,
nOfs
,
nChars
,
TRUE
);
parser
.
tableDef
->
tableRowStart
=
NULL
;
if
(
parser
.
tableDef
)
parser
.
tableDef
->
tableRowStart
=
NULL
;
}
}
}
}
ME_CheckTablesForCorruption
(
editor
);
ME_CheckTablesForCorruption
(
editor
);
...
...
dlls/riched20/reader.c
View file @
fab25802
...
@@ -242,8 +242,6 @@ void RTFInit(RTF_Info *info)
...
@@ -242,8 +242,6 @@ void RTFInit(RTF_Info *info)
info
->
cpOutputBuffer
=
heap_alloc
(
info
->
dwMaxCPOutputCount
);
info
->
cpOutputBuffer
=
heap_alloc
(
info
->
dwMaxCPOutputCount
);
}
}
if
(
info
->
tableDef
)
ZeroMemory
(
info
->
tableDef
,
sizeof
(
info
->
tableDef
));
info
->
tableDef
=
NULL
;
info
->
tableDef
=
NULL
;
info
->
nestingLevel
=
0
;
info
->
nestingLevel
=
0
;
info
->
canInheritInTbl
=
FALSE
;
info
->
canInheritInTbl
=
FALSE
;
...
...
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