Incompatibility between Apache OpenOffice and LibreOffice

Discussions about using 3rd party extension with OpenOffice.org
Post Reply
Gapen
Posts: 3
Joined: Wed Feb 15, 2017 11:28 am

Incompatibility between Apache OpenOffice and LibreOffice

Post by Gapen »

I'm developing a grammar checker extension for LibreOffice and OpenOffice. I developed everything using the LibreOffice's SDK, and it works . I thought it would be compatible with OpenOffice too, but it gives me the following error when I try to use it:

/opt/openoffice4/program/uno.bin: symbol lookup error: .../.config/.openoffice/4/user/uno_packages/cache/uno_packages/sv6perdd.tmp_/myextension.so: undefined symbol: rtl_uString_newFromLiteral

Even if both systems use libuno_sal.so.3 library, I found that the LibreOffice's version contains a symbol that the OpenOffice's don't: rtl_uString_newFromLiteral

Do you think it is a bug? Or just that LibreOffice decided to change the UNO API? I'm not using that function directly in my code, so I don't know how could I fix it to make the same code compatible for both systems.

Other related symbols are exactly the same:

libuno_sal.so.3 (OpenOffice 4.1.3):
0000000000048ef0 T rtl_uString_newFromAscii
0000000000048e30 T rtl_uString_newFromCodePoints
0000000000049350 T rtl_uString_newFromStr
00000000000493d0 T rtl_uString_newFromString
00000000000491b0 T rtl_uString_newFromStr_WithLength

libuno_sal.so.3 (LibreOffice 5.3):
000000000002ef90 T rtl_uString_newFromAscii
000000000002f020 T rtl_uString_newFromCodePoints
000000000002e000 T rtl_uString_newFromLiteral
000000000002def0 T rtl_uString_newFromStr
000000000002de90 T rtl_uString_newFromString
000000000002df80 T rtl_uString_newFromStr_WithLength

Any ideas how could I resolve this problem?

Thanks in advance.
OpenOffice 4.1.3 on Lubuntu16.04
User avatar
RoryOF
Moderator
Posts: 34612
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Incompatibility between Apache OpenOffice and LibreOffic

Post by RoryOF »

I suspect that in their reworking of the API, LibreOffice coders make use of rtl_uString_newFromLiteral in the derivation of the other returned values. A possible solution (not elegant!) may be to use other API calls common to the two implementations that are not currently affected by this, or to distinguish at runtime between OO and LibreOffice, invoking the correct API for the version in question and involving whatever modifications your code needs to accommodate this.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
Gapen
Posts: 3
Joined: Wed Feb 15, 2017 11:28 am

Re: Incompatibility between Apache OpenOffice and LibreOffic

Post by Gapen »

Thanks for your reply, RoryOF.

The problem is that I do not call the mentioned function in my code. I suppose it is called by other API functions that I'm using, which are very difficult to replace.

What surprises me is that I can't find anyone else having the same problem. It seems it's not a recent change, and I thought it was common to create a single extension for both LO and OO.
OpenOffice 4.1.3 on Lubuntu16.04
User avatar
RoryOF
Moderator
Posts: 34612
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Incompatibility between Apache OpenOffice and LibreOffic

Post by RoryOF »

Regrettably the LibreOffice and OpenOffice codebases are parting. The OO licence allows LibreOffice use OO code, but unfortunately not the other way around.

I suspect you will need to dive into LibreOffice C+ code for that area; I think you will find that some of the API functions you use actually employ that construct in their coding.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
JeJe
Volunteer
Posts: 2779
Joined: Wed Mar 09, 2016 2:40 pm

Re: Incompatibility between Apache OpenOffice and LibreOffic

Post by JeJe »

The best thing to do is probably to develop in OpenOffice rather than LibreOffice for the best chance of it being compatible with both - this is my main motive for using OpenOffice myself - having the least features. LibreOffice have an extra spin button control for example in the OOBasic IDE - if I used that it would obviously make things incompatible (and I can easily make a spin button from the other controls). LibreOffice also crashed more when I tried the IDE - might just be my experience there though.

If I'm following all this this looks to have been introduced in LibreOffice 3.6
@internal
@since LibreOffice 3.6
*/
SAL_DLLPUBLIC void SAL_CALL rtl_uString_newFromLiteral(
rtl_uString ** newStr, const sal_Char * value, sal_Int32 len,
sal_Int32 allocExtra ) SAL_THROW_EXTERN_C();

/** Allocate a new string from an array of Unicode code points.
https://searchcode.com/codesearch/view/34220563/
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
Gapen
Posts: 3
Joined: Wed Feb 15, 2017 11:28 am

Re: Incompatibility between Apache OpenOffice and LibreOffic

Post by Gapen »

Thank you guys for your quick responses. I think I will try developing in OpenOffice, and see if it is compatible with LibreOffice. That might be a good idea.
OpenOffice 4.1.3 on Lubuntu16.04
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: Incompatibility between Apache OpenOffice and LibreOffic

Post by acknak »

I'm not sure working with OO is going to help. As I recall, the problem is that AOO has accumulated several different functions/macros for dealing with string constants. The LibO developers decided this needed to be addressed and deprecated the old functions and changed them all to use only one function. I don't know if the one solution is a new function (not in OO) or one that existed in AOO also. I don't know the details of how the change was made, but I'm sure you can find out.

Can you not ask the LibO developers whether it's still possible to develop extension code that will work for both?
AOO4/LO5 • Linux • Fedora 23
Post Reply