Re: How to copy text from shape to body text in a unit test

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Regina,

On Wed, Jan 10, 2024 at 06:29:24PM +0100, Regina Henschel <rb.henschel@xxxxxxxxxxx> wrote:
> please have a look at the unit test in
> https://gerrit.libreoffice.org/c/core/+/161842. It works but it looks
> strange to me.
> The task is this:
> Copy the text content of a shape and paste it in rich text format to the
> body text. Make sure, that a line break (shift enter) in the original text
> is preserved in the pasted text.
> 
> It there a better way for this task in a unit test?

I think you do want to copy and paste there, because that's how the
editeng RTF export is invoked. An alternative would be to go via
text::XTextCopy, but that is more about copying from Writer to Writer.

The other odd part of the test is how you enter and leave the shape text
edit mode. You can see how SwTiledRenderingTest's testViewLock uses
BeginTextEdit() and EndTextEdit() for this. If it works in your case,
then using those functions instead of pressing "enter" and "esc" at
magic places would be more clean, I guess.

Regards,

Miklos



[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux