https://bz.apache.org/ooo/show_bug.cgi?id=64377 took great effort to assure compatibility when using new large image (binary format 0x12 - see basic/source/inc/filefmt.hxx). Every OOo, LO and AOO versions since 2006 can use that format without problems. This had prepared grounds to finally start using this binary format in ODF, allowing to remove the limitation of module size in password-protected libraries.
However, LibreOffice now uses incompatible binary format 0x13, which was introduced in version 5.0.3 and 5.1 in tdf#94617. Since 5.2 (tdf#87530), that format is written into ODF. This makes the image unusable for any other suite.
The proposal here is only use binary format 0x13 when actually needed, i.e. when there are methods starting at an offset that would overflow 16 bits, and use format 0x12 in other cases. That would make the resulting binary compatible with ~100% OOo derivatives used today *wherever possible* (and when there is such a method that requires use of format 0x13, use of incompatible format would be justified, since such a module would be impossible to use in those versions/derivatives anyway).
The warning that appears when saving such a module should explicitly mention compatibility issues.
See also tdf#92620.
The code pointers are in the related change https://git.libreoffice.org/core/+/ddb45261590939d884ac2bcb1fd258de7b2370da that introduced 0x13.
Created attachment 172193 [details]
Test file from i#64377
Steps for testing:
1. Open the attached document in LibreOffice >= 5.2; allow macros
2. In Basic IDE, Tools->Select Module
3. On Libraries tab, choose "test-ray-bigmodule.odt" in Location drop-down list
4. Select Xray library, click on Password button, set some password -> OK
5. Close the dialog and IDE
6. Save the document (accept the warning telling about module _Main, which is too large to store in binary format by pressing OK).
7. Reopen the document, check that pressing Button starts Xray; check that Xray module is password-protected.
8. Try to do the same in LibreOffice 5.1, or in AOO (the button does not work).
(In reply to Mike Kaganski from comment #1)
> 8. Try to do the same in LibreOffice 5.1, or in AOO (the button does not
Sorry, a thinko: LibreOffice before 5.0.3 was meant (so e.g., LibreOffice 5.0.2 or 4.4).
I was looking to work on this issue and was following the steps you mentioned and
> Save the document (accept the warning telling about module _Main, which is too large to store in binary format by pressing OK)
But i didn't got this error message on saving the document.
> 1. Open the attached document in LibreOffice >= 5.2;
I'm using 7.2 Libreoffice
(In reply to Tarun Sharma from comment #3)
> But i didn't got this error message on saving the document.
Which would mean that you didn't set the password, as mentioned in step 4 of comment 1. If you are sure you have followed all steps carefully, then please attach the resulting file.
Created attachment 173302 [details]
Test file with password on macro
attachment 173302 [details]
Yes i have followed every step and didn't got the warning. Tried for the second time also.
https://imgur.com/a/wKcMSMN . <- Here I'm getting old password enabled as i have set a password. Also ii'm attaching the file.
(In reply to Tarun Sharma from comment #6)
> Yes i have followed every step and didn't got the warning. Tried for the
> second time also.
No you didn't :-D
> https://imgur.com/a/wKcMSMN . <- Here I'm getting old password enabled as i
> have set a password. Also ii'm attaching the file.
Yes, and the screenshot shows exactly where you didn't follow the steps: comment 1 step 3.
Okk, yess sorry got the warning didn;t select xray from the dropdown.
Maybe a noob question but
I was looking in to the proposal and i was kinda stuck on binary format 0x12 or 0x13. Is it like (in binary 19 ) it has 19 bit for 0x13 ?
What does it represent/ ?
(In reply to Tarun Sharma from comment #9)
I'm sorry, I don't quite understand the question.
What "in binary 19" means? "it has 19 bit for 0x13" - what is "it", what "19 bit" are meant? 0x13 is indeed decimal 19, but I fail to see other relation of the mentioned numbers.
"What does it represent/ ?" - what is "it" in the question? I suspect you ask about the number in the version - then it should be described in basic/source/inc/filefmt.hxx, which is mentioned in comment 0...
sorry for bad phrasing of the question.
i wanted to know what is binary format 0x13 ?
(In reply to Tarun Sharma from comment #11)
That is the number of the binary image version, described in basic/source/inc/filefmt.hxx.
I wasn't able to understand from the attached links that how to resolve this issue.
I reverted the changes in sbxmod.cxx, like it was before the introduction of 0x13 https://git.libreoffice.org/core/+/ddb45261590939d884ac2bcb1fd258de7b2370da
but still was getting the warning in xRay.
Can i get more help in this!?