Dylan Smith : richedit: Prevent assertion failure when streaming out nested tables.

Alexandre Julliard julliard at winehq.org
Wed Oct 1 14:09:34 CDT 2008


Module: wine
Branch: master
Commit: ee5342e43295f07cf0a927a6b2b8f256fad0ba29
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=ee5342e43295f07cf0a927a6b2b8f256fad0ba29

Author: Dylan Smith <dylan.ah.smith at gmail.com>
Date:   Tue Sep 30 17:11:41 2008 -0400

richedit: Prevent assertion failure when streaming out nested tables.

The table properties are streamed out at the start of the table for
non-nested tables, and at the end of the table for nested tables.  The
assertion caught the fact that I didn't get the start of the table row
for nested tables before trying to stream out the properties.

The call to ME_GetTableRowStart will handle both of these cases by
getting the table row start paragraph and asserting that it is found.
This call was also the reason for removing the const qualifier on one
of the parameters.

---

 dlls/riched20/writer.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/riched20/writer.c b/dlls/riched20/writer.c
index 6a6ad54..50c0c61 100644
--- a/dlls/riched20/writer.c
+++ b/dlls/riched20/writer.c
@@ -286,7 +286,7 @@ ME_StreamOutRTFFontAndColorTbl(ME_OutStream *pStream, ME_DisplayItem *pFirstRun,
 
 static BOOL
 ME_StreamOutRTFTableProps(ME_TextEditor *editor, ME_OutStream *pStream,
-                          const ME_DisplayItem *para)
+                          ME_DisplayItem *para)
 {
   ME_DisplayItem *cell;
   char props[STREAMOUT_BUFFER_SIZE] = "";
@@ -294,7 +294,7 @@ ME_StreamOutRTFTableProps(ME_TextEditor *editor, ME_OutStream *pStream,
   if (!ME_StreamOutPrint(pStream, "\\trowd"))
     return FALSE;
   if (!editor->bEmulateVersion10) { /* v4.1 */
-    assert(para->member.para.nFlags & MEPF_ROWSTART);
+    para = ME_GetTableRowStart(para);
     cell = para->member.para.next_para->member.para.pCell;
     assert(cell);
     do {




More information about the wine-cvs mailing list