[Solved] Determine location for Paste operation

Java, C++, C#, Delphi... - Using the UNO bridges
Post Reply
wanglong
Posts: 51
Joined: Fri Sep 09, 2022 10:57 am
Location: Beijing,China

[Solved] Determine location for Paste operation

Post by wanglong »

I'd like to use UNO with JAVA to copy some contents from one doc to another like this:

Code: Select all

xDispatchHelper.executeDispatch(xDispatchProvider, ".uno:Paste", "", 0, new PropertyValue[]{new PropertyValue()});
But I didn't find a convenient way to locate my "Paste" position,except ".uno:GoToNextPara",".uno:JumpToNextPara"and so on. :crazy:
And I don't know how the interface is implemented.So I don't know these ".uno:GoToxxxx" API influence which cursor.
Thus I want to know:
1、Can I use just an UNO command with some information to make it paste to the desired position?
2、I didn't find a detialed description with UNO command besides "https://wiki.openoffice.org/wiki/Framew ... x_Commands"
,but it didn't describe parameters.Please show me a link.

I really appreciate your help.
Last edited by MrProgrammer on Fri Jul 14, 2023 3:29 pm, edited 2 times in total.
Reason: Edited topic's subject
Libre Office 7.6 on Windows 11.
User avatar
Villeroy
Volunteer
Posts: 31323
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Is there one more way trace to my "Paste" location?

Post by Villeroy »

Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
JeJe
Volunteer
Posts: 2920
Joined: Wed Mar 09, 2016 2:40 pm

Re: Is there one more way trace to my "Paste" location?

Post by JeJe »

The paste occurs at the position of the document's current controller viewcursor and the cursor is then moved to the end of whatever is pasted.

Instead of using dispatch calls you should learn how to move the viewcursor, create a textcursor and so on with api calls.
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
wanglong
Posts: 51
Joined: Fri Sep 09, 2022 10:57 am
Location: Beijing,China

Re: Is there one more way trace to my "Paste" location?

Post by wanglong »

OK!
I make it with TextviewCursor!
Thank u very much,Jeje and Villeroy! :bravo: :bravo: :bravo:
Libre Office 7.6 on Windows 11.
Post Reply