Bug 160784 - Uno Api - Java - Cursor error when move it to beginning of the table
Summary: Uno Api - Java - Cursor error when move it to beginning of the table
Status: UNCONFIRMED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: sdk (show other bugs)
Version:
(earliest affected)
24.2.2.2 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: possibleRegression
Depends on:
Blocks:
 
Reported: 2024-04-22 19:11 UTC by Arthur Zanona
Modified: 2024-05-09 16:32 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Java Code for reproduces (7.33 KB, text/x-java)
2024-04-22 19:11 UTC, Arthur Zanona
Details
template example (10.49 KB, application/vnd.oasis.opendocument.text)
2024-04-22 19:16 UTC, Arthur Zanona
Details
Execution working as expected - v7.4.1.2 (1.79 MB, video/webm)
2024-05-09 14:07 UTC, Fabio Reina
Details
Execution with error - v7.4.2.1 (2.25 MB, video/webm)
2024-05-09 14:09 UTC, Fabio Reina
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Arthur Zanona 2024-04-22 19:11:04 UTC
Created attachment 193806 [details]
Java Code for reproduces

I have an extension in Writer that allows the user to create templates with custom metadata that will be processed later.

After version 7.4 of LibreOffice, this extension is presenting an Uno Api error when moving the cursor to the beginning of the table when the user's cursor is in any cell of the table.

Stack trace:

Exception in thread "main" com.sun.star.uno.RuntimeException: at /home/buildslave/source/libo-core/sw/source/core/unocore/unoobj.cxx:1231
	at com.sun.star.lib.uno.environments.remote.Job.remoteUnoRequestRaisedException(Job.java:158)


I created an example simulating this error on GitHub.
https://github.com/zanonaa/TableWithDynamicCursor

* OpenJDK 8.0.412-zulu
* LibreOffice >= 7.4 - 24.2.2.2
* Linux Mint 21.3 Virginia x64
* Fedora release 39 (Thirty Nine) x64
* Windows 10 x64
Comment 1 Arthur Zanona 2024-04-22 19:16:20 UTC
Created attachment 193807 [details]
template example
Comment 2 Stéphane Guillou (stragu) 2024-05-08 02:24:24 UTC
Thanks for the report.
How do you source ooo.connector for your development environment?
Do you know which 7.4 version exactly was the earliest affected?
Comment 3 Fabio Reina 2024-05-09 14:05:22 UTC
Hello Stéphane, thanks for your response.

We are sourcing the ooo.connector to the development environment through a maven dependency in the pom's project.
The dependency we are using is as following:
groupId: com.github.jeremysolarz
artifactId: bootstrap-connector
version: 1.0.0

<dependency>
	<groupId>com.github.jeremysolarz</groupId>
	<artifactId>bootstrap-connector</artifactId>
	<version>1.0.0</version>
	<exclusions>
		<exclusion>
			<groupId>org.libreoffice</groupId>
			<artifactId>*</artifactId>
		</exclusion>
	</exclusions>
</dependency>

Regarding to the version, we started noticing the problem with the version 7.4.2.1. 
We haven't tested the versions 7.4.0.0.alpha1 nor 7.4.0.0.beta1 but until the version 7.4.1.2 it works just fine.
Therefore the latest version in which the problem did not occur is version 7.4.1.2.

Attached there are two videos, one for each of the versions: 7.4.1.2 and 7.4.2.1. 
In the first test it works as expected and in the second we get the error reported. The code used in the tests is the one posted in the description of this bug (https://github.com/zanonaa/TableWithDynamicCursor).
Comment 4 Fabio Reina 2024-05-09 14:07:22 UTC
Created attachment 194056 [details]
Execution working as expected - v7.4.1.2
Comment 5 Fabio Reina 2024-05-09 14:09:01 UTC
Created attachment 194057 [details]
Execution with error - v7.4.2.1
Comment 6 Stéphane Guillou (stragu) 2024-05-09 16:32:11 UTC
I haven't been able to get a jar running to try to bibisect it. (Getting "java.lang.NoClassDefFoundError: com/sun/star/text/XTextContent", not sure what I'm doing wrong...)

Looking at: https://wiki.documentfoundation.org/Releases/7.4.2/RC1
...I'm wondering if it could have something to do with cursor position changes by László, like 189aa05c6ea17a8e823b4eab18ea0d1131d9d73e or 24087697d5cf78aac346d4dcea0596373e15a95c. But that's with tracked changes, which the ODT doesn't have on.

László, what do you think?

Alternatively, there's Mike's eb30df9b8e86f756ebc66be86ae2eb345fafc850. Mike?