trichview.com

trichview.support




Re: Merge cell table corruption?


Return to index


Author

Message

Sergey Tkachenko

Posted: 07/31/2004 21:15:26


> 1. Entire table color changes when setting cell color.

>

> The function call that I used was SetCellColor(Value: TColor; Row,Col:

Integer);

>  When I call this method the entire table color changed AFTER merging a

cells

> on the table.  I replaced this function with Table.Cells[,].Color and it

> fixed the problem.


I do not understand why SetCellColor does not work.

I created a test code:


var rve: TCustomRichViewEdit;

    item: TCustomRVItemInfo;

    table: TRVTableItemInfo;

begin

  if RichViewEdit1.GetCurrentItemEx(TRVTableItemInfo, rve, item) then begin

    table := item as TRVTableItemInfo;

    rve.BeginUndoGroup(rvutModifyItem);

    table.SetCellColor(clRed, 0, 0);

    rve.Change;

    rve.Invalidate;

    rve.TopLevelEditor.Invalidate;

  end;

end;


and it works as expected

(this is a typical code for table editing operations;

SetUndoGroupMode(true)...SetUndoGroupMode(false) is not necessary because

there is only one operation here;

BeginItemModify...EndItemModify is not necessary because this operations

does not change table size, so Invalidate is used instead).

Unlike direct assignment to Cell.Color, the operation above can be undone by

user.



>

> 3.  Pasting HTML

>

> There was a misunderstanding.  The problem that I had was the following.

>  I create a table in RVE.  I export the HTML.  I open it in IE.  I copy

the

> content from IE (Not the source) and paste it into RVE.  This gets treated

> as RTF then.  It works well but the problem was that if I created and

exported

> a table with a merged cell then I could not copy and paste the displayed

> html in IE back into the RVE.  However, after I changed the two items

above

> the problem doesn't occur anymore.  (?)


Ok, at least this problem is solved.





Powered by ABC Amber Outlook Express Converter