riched20: Remove the table corruption check function.
Signed-off-by: Huw Davies <huw@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
3ba419081a
commit
f2d770d491
|
@ -1735,7 +1735,6 @@ static LRESULT ME_StreamIn(ME_TextEditor *editor, DWORD format, EDITSTREAM *stre
|
||||||
if (parser.tableDef) parser.tableDef->row_start = NULL;
|
if (parser.tableDef) parser.tableDef->row_start = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ME_CheckTablesForCorruption(editor);
|
|
||||||
RTFDestroy(&parser);
|
RTFDestroy(&parser);
|
||||||
|
|
||||||
if (parser.stackTop > 0)
|
if (parser.stackTop > 0)
|
||||||
|
@ -2515,7 +2514,6 @@ static BOOL handle_enter(ME_TextEditor *editor)
|
||||||
editor->pCursors[0].nOffset = 0;
|
editor->pCursors[0].nOffset = 0;
|
||||||
editor->pCursors[1] = editor->pCursors[0];
|
editor->pCursors[1] = editor->pCursors[0];
|
||||||
ME_CommitUndo(editor);
|
ME_CommitUndo(editor);
|
||||||
ME_CheckTablesForCorruption(editor);
|
|
||||||
ME_UpdateRepaint(editor, FALSE);
|
ME_UpdateRepaint(editor, FALSE);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -2541,7 +2539,6 @@ static BOOL handle_enter(ME_TextEditor *editor)
|
||||||
editor->pCursors[1] = editor->pCursors[0];
|
editor->pCursors[1] = editor->pCursors[0];
|
||||||
para->member.para.next_para->member.para.nFlags |= MEPF_ROWSTART;
|
para->member.para.next_para->member.para.nFlags |= MEPF_ROWSTART;
|
||||||
ME_CommitCoalescingUndo(editor);
|
ME_CommitCoalescingUndo(editor);
|
||||||
ME_CheckTablesForCorruption(editor);
|
|
||||||
ME_UpdateRepaint(editor, FALSE);
|
ME_UpdateRepaint(editor, FALSE);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -309,7 +309,6 @@ ME_Paragraph *table_row_end( ME_Paragraph *para ) DECLSPEC_HIDDEN;
|
||||||
ME_Cell *table_row_end_cell( ME_Paragraph *para ) DECLSPEC_HIDDEN;
|
ME_Cell *table_row_end_cell( ME_Paragraph *para ) DECLSPEC_HIDDEN;
|
||||||
ME_Cell *table_row_first_cell( ME_Paragraph *para ) DECLSPEC_HIDDEN;
|
ME_Cell *table_row_first_cell( ME_Paragraph *para ) DECLSPEC_HIDDEN;
|
||||||
ME_Paragraph *table_row_start( ME_Paragraph *para ) DECLSPEC_HIDDEN;
|
ME_Paragraph *table_row_start( ME_Paragraph *para ) DECLSPEC_HIDDEN;
|
||||||
void ME_CheckTablesForCorruption(ME_TextEditor *editor) DECLSPEC_HIDDEN;
|
|
||||||
struct RTFTable *ME_MakeTableDef(ME_TextEditor *editor) DECLSPEC_HIDDEN;
|
struct RTFTable *ME_MakeTableDef(ME_TextEditor *editor) DECLSPEC_HIDDEN;
|
||||||
void ME_InitTableDef(ME_TextEditor *editor, struct RTFTable *tableDef) DECLSPEC_HIDDEN;
|
void ME_InitTableDef(ME_TextEditor *editor, struct RTFTable *tableDef) DECLSPEC_HIDDEN;
|
||||||
static inline ME_DisplayItem *cell_get_di(ME_Cell *cell)
|
static inline ME_DisplayItem *cell_get_di(ME_Cell *cell)
|
||||||
|
|
|
@ -54,8 +54,6 @@
|
||||||
#include "editor.h"
|
#include "editor.h"
|
||||||
#include "rtf.h"
|
#include "rtf.h"
|
||||||
|
|
||||||
WINE_DEFAULT_DEBUG_CHANNEL(richedit_lists);
|
|
||||||
|
|
||||||
static const WCHAR cr_lf[] = {'\r', '\n', 0};
|
static const WCHAR cr_lf[] = {'\r', '\n', 0};
|
||||||
|
|
||||||
static ME_Paragraph* table_insert_end_para( ME_TextEditor *editor, ME_Cursor *cursor,
|
static ME_Paragraph* table_insert_end_para( ME_TextEditor *editor, ME_Cursor *cursor,
|
||||||
|
@ -214,93 +212,6 @@ ME_Paragraph *cell_end_para( ME_Cell *cell )
|
||||||
return &ME_FindItemBack( cell_get_di( next ), diParagraph )->member.para;
|
return &ME_FindItemBack( cell_get_di( next ), diParagraph )->member.para;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Make a bunch of assertions to make sure tables haven't been corrupted.
|
|
||||||
*
|
|
||||||
* These invariants may not hold true in the middle of streaming in rich text
|
|
||||||
* or during an undo and redo of streaming in rich text. It should be safe to
|
|
||||||
* call this method after an event is processed.
|
|
||||||
*/
|
|
||||||
void ME_CheckTablesForCorruption(ME_TextEditor *editor)
|
|
||||||
{
|
|
||||||
if(TRACE_ON(richedit_lists))
|
|
||||||
{
|
|
||||||
TRACE("---\n");
|
|
||||||
ME_DumpDocument(editor->pBuffer);
|
|
||||||
}
|
|
||||||
#ifndef NDEBUG
|
|
||||||
{
|
|
||||||
ME_DisplayItem *p, *pPrev;
|
|
||||||
pPrev = editor->pBuffer->pFirst;
|
|
||||||
p = pPrev->next;
|
|
||||||
if (!editor->bEmulateVersion10) /* v4.1 */
|
|
||||||
{
|
|
||||||
while (p->type == diParagraph)
|
|
||||||
{
|
|
||||||
assert(p->member.para.fmt.dwMask & PFM_TABLE);
|
|
||||||
assert(p->member.para.fmt.dwMask & PFM_TABLEROWDELIMITER);
|
|
||||||
if (p->member.para.pCell)
|
|
||||||
{
|
|
||||||
assert(p->member.para.nFlags & MEPF_CELL);
|
|
||||||
assert(p->member.para.fmt.wEffects & PFE_TABLE);
|
|
||||||
}
|
|
||||||
if (p->member.para.pCell != pPrev->member.para.pCell)
|
|
||||||
{
|
|
||||||
/* There must be a diCell in between the paragraphs if pCell changes. */
|
|
||||||
ME_DisplayItem *pCell = ME_FindItemBack(p, diCell);
|
|
||||||
assert(pCell);
|
|
||||||
assert(ME_FindItemBack(p, diRun) == ME_FindItemBack(pCell, diRun));
|
|
||||||
}
|
|
||||||
if (p->member.para.nFlags & MEPF_ROWEND)
|
|
||||||
{
|
|
||||||
/* ROWEND must come after a cell. */
|
|
||||||
assert(pPrev->member.para.pCell);
|
|
||||||
assert(p->member.para.pCell
|
|
||||||
== pPrev->member.para.pCell->member.cell.parent_cell);
|
|
||||||
assert(p->member.para.fmt.wEffects & PFE_TABLEROWDELIMITER);
|
|
||||||
}
|
|
||||||
else if (p->member.para.pCell)
|
|
||||||
{
|
|
||||||
assert(!(p->member.para.fmt.wEffects & PFE_TABLEROWDELIMITER));
|
|
||||||
assert(pPrev->member.para.pCell ||
|
|
||||||
pPrev->member.para.nFlags & MEPF_ROWSTART);
|
|
||||||
if (pPrev->member.para.pCell &&
|
|
||||||
!(pPrev->member.para.nFlags & MEPF_ROWSTART))
|
|
||||||
{
|
|
||||||
assert(p->member.para.pCell->member.cell.parent_cell
|
|
||||||
== pPrev->member.para.pCell->member.cell.parent_cell);
|
|
||||||
if (pPrev->member.para.pCell != p->member.para.pCell)
|
|
||||||
assert(pPrev->member.para.pCell
|
|
||||||
== p->member.para.pCell->member.cell.prev_cell);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (!(p->member.para.nFlags & MEPF_ROWSTART))
|
|
||||||
{
|
|
||||||
assert(!(p->member.para.fmt.wEffects & PFE_TABLEROWDELIMITER));
|
|
||||||
/* ROWSTART must be followed by a cell. */
|
|
||||||
assert(!(p->member.para.nFlags & MEPF_CELL));
|
|
||||||
/* ROWSTART must be followed by a cell. */
|
|
||||||
assert(!(pPrev->member.para.nFlags & MEPF_ROWSTART));
|
|
||||||
}
|
|
||||||
pPrev = p;
|
|
||||||
p = p->member.para.next_para;
|
|
||||||
}
|
|
||||||
} else { /* v1.0 - 3.0 */
|
|
||||||
while (p->type == diParagraph)
|
|
||||||
{
|
|
||||||
assert(!(p->member.para.nFlags & (MEPF_ROWSTART|MEPF_ROWEND|MEPF_CELL)));
|
|
||||||
assert(p->member.para.fmt.dwMask & PFM_TABLE);
|
|
||||||
assert(!(p->member.para.fmt.wEffects & PFE_TABLEROWDELIMITER));
|
|
||||||
assert(!p->member.para.pCell);
|
|
||||||
p = p->member.para.next_para;
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
assert(p->type == diTextEnd);
|
|
||||||
assert(!pPrev->member.para.pCell);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
BOOL ME_IsInTable(ME_DisplayItem *pItem)
|
BOOL ME_IsInTable(ME_DisplayItem *pItem)
|
||||||
{
|
{
|
||||||
PARAFORMAT2 *pFmt;
|
PARAFORMAT2 *pFmt;
|
||||||
|
|
|
@ -440,7 +440,6 @@ BOOL ME_Undo(ME_TextEditor *editor)
|
||||||
|
|
||||||
table_move_from_row_start( editor );
|
table_move_from_row_start( editor );
|
||||||
add_undo( editor, undo_end_transaction );
|
add_undo( editor, undo_end_transaction );
|
||||||
ME_CheckTablesForCorruption(editor);
|
|
||||||
editor->nUndoStackSize--;
|
editor->nUndoStackSize--;
|
||||||
editor->nUndoMode = nMode;
|
editor->nUndoMode = nMode;
|
||||||
ME_UpdateRepaint(editor, FALSE);
|
ME_UpdateRepaint(editor, FALSE);
|
||||||
|
@ -477,7 +476,6 @@ BOOL ME_Redo(ME_TextEditor *editor)
|
||||||
}
|
}
|
||||||
table_move_from_row_start( editor );
|
table_move_from_row_start( editor );
|
||||||
add_undo( editor, undo_end_transaction );
|
add_undo( editor, undo_end_transaction );
|
||||||
ME_CheckTablesForCorruption(editor);
|
|
||||||
editor->nUndoMode = nMode;
|
editor->nUndoMode = nMode;
|
||||||
ME_UpdateRepaint(editor, FALSE);
|
ME_UpdateRepaint(editor, FALSE);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
Loading…
Reference in New Issue