trichview.com

trichview.support




Re: Merge cell table corruption?


Return to index


Author

Message

Sergey Tkachenko

Posted: 07/28/2004 19:42:00


> 1.) If I try to set the color of a single cell in a table ALL the cells in

> the table get the same color.


How do you change cell color?

table.Color is a color of the whole table.

table.Cell[r,c].Color is a color of the specific cell.


>

> 2.) If I close the application I get an exception in the TRichView

package.


Any application or some specific application?


>

> 3.) If I export the table in HTML format and open it in a browser, it

displays

> correctly.  But if I copy this table, it is not possible to paste it into

> the richview component.


By default, when you copy a web page from IE, RichViewEdit pastes it as RTF.

IE sometimes generates low quality RTF (and event does not generate it for

web pages with complicated layout).

You can test it in MS Word - command Edit | Paste Special, select "Rich Text

Format". Results should be almost the same as pasting in RichViewEdit.

Results must be better if pasting in HTML format. Unfortunately, HTML import

is not supported directly yet.

HTML can be imported/pasted using freeware thirdparty TRVHTMLImporter

component (http://www.trichview.com/resources/).

RichViewActions (http://www.trichview.com/resources/actions/) support it



>

> To me it seems like the table item gets corrupted.  Maybe I am doing

something

> wrong since I am not so familiar with this component set yet.

>

> Below are the source used for cell merging.


The full sequence of operations is below:

(please note: calls of SetUndoGroupMode(True) and SetUndoGroupMode(False)

must be strictly paired, they decrement/increment an internal counter)


var rve: TCustomRichViewEdit;

    item: TCustomRVItemInfo;

    table: TRVTableItemInfo;

    ItemNo, Data: Integer;

begin

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

    table := item as TRVTableItemInfo;

    ItemNo := rve.GetItemNo(table);

    rve.BeginItemModify(ItemNo, Data);

    rve.BeginUndoGroup(rvutModifyItem);

    rve.SetUndoGroupMode(True);

    table.MergeSelectedCells(True);

    table.DeleteEmptyRows;

    table.DeleteEmptyCols;

    rve.SetUndoGroupMode(False);

    rve.EndItemModify(ItemNo, Data);

    rve.Change;

  end;

end;





Powered by ABC Amber Outlook Express Converter