Copied tables from richedits are displayed incorrectly

General TRichView support forum. Please post your questions here
Post Reply
tomr
Posts: 26
Joined: Wed Dec 09, 2020 9:36 am

Copied tables from richedits are displayed incorrectly

Post by tomr »

Hello TRichview Support,
While working with tables in Richedits, I had the following issue:
I have inserted a table from Excel into a Richedit. Now I want to copy the table from the richedit into an E-Mail.
Tabelle in Demo.png
Tabelle in Demo.png (41.12 KiB) Viewed 12246 times
If I start the selection from the left side, copy it, and paste it into my E-Mail, the table is displayed incorrectly.
Selektion von Link nach Rechts.png
Selektion von Link nach Rechts.png (24.27 KiB) Viewed 12246 times
Tabelle falsch dargestellt.png
Tabelle falsch dargestellt.png (9.77 KiB) Viewed 12246 times
If I start the selection from the opposite side (right to left), copy it, and paste it into my E-Mail, everything is fine.
Selektion von Rechts nach Links.png
Selektion von Rechts nach Links.png (26.63 KiB) Viewed 12246 times
Tabelle richtig dargestellt.png
Tabelle richtig dargestellt.png (7.21 KiB) Viewed 12246 times
As you can see in the screenshots I could reproduce this issue with the richviewactiontest demo project. Is there anything I can do to solve this?

Kind regards
Tom
Sergey Tkachenko
Site Admin
Posts: 17748
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Copied tables from richedits are displayed incorrectly

Post by Sergey Tkachenko »

It's not the direction that matters.
There two kinds of selection:
1. Table as a whole object. You can select the table as a whole object (maybe together with surrounding items, or maybe only the table). You can start selection to the left of the table and end to the right of it. Or vice versa. Or in vertical direction.
2. All table cells. You can select cells in the table (maybe all cells). To select all cells, you can start from the top left cell and end to the bottom right. Or vice versa. Just start from one corner and end at the opposite corner.

These kinds of selection look identically it TRichViewEdit, but they are different.
When copying as RVF, both kinds of selection are copied identically. as a table.
When copying as text, both kinds of selection are copied identically. as text from all selected cells.
When copying as RTF, only the first kind of selection is implemented.
What's why, if you copy to non-TRichViewEdit editor:
- the first kind of selection is copied via RTF as a table
- the second kind of selection is copied as a plain text.
Post Reply