trichview.support
Re: Merge cell table corruption? |
Author |
Message |
Franco Skrzypczak |
Posted: 07/29/2004 12:48:42 Hello Sergey, Thank you for your feedback. I looked through the code and I managed to find the problems. They were the following; 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. 2. Application exception on exit If you assign an integer to a tag of a table when the RVE TagsAsPChar = True and you call RVE.Clear you get an exception. This I fixed by setting TagsAsPChar = False. This caused the exception when I exited the application because I cleared the RVE on exit. 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. (?) Once again thanks for your help! Franco "Sergey Tkachenko" <[email protected]> wrote: >> 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