Bug 163362 - Icons in in-document custom toolbars created since 6.4 aren't shown in previous versions
Summary: Icons in in-document custom toolbars created since 6.4 aren't shown in previo...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
6.4.0.3 release
Hardware: All All
: medium normal
Assignee: Mike Kaganski
URL:
Whiteboard: target:25.2.0 target:24.8.3
Keywords: bisected, regression
Depends on:
Blocks:
 
Reported: 2024-10-09 08:26 UTC by Mike Kaganski
Modified: 2024-10-17 09:12 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Kaganski 2024-10-09 08:26:24 UTC
1. Create a new Writer document;
2. Tools->Customize; open Toolbars tab;
3. Scope: "Untitled 1";
4. Push the "hamburger" button next to "Target" drop-down, and choose "Add...", accept "New Toolbar 1" saved in "Untitled 1" (i.e., press OK);
5. In the command list to the right, choose "Macros" category, and select any macro from the list, then Click the Right Arrow "Add Item" button;
6. With the newly added item selected, press "Modify" button at the bottom, and choose "Change Icon...";
7. "Import..." an image, then locate it in the list, and select, then press OK;
8. See that the image is shown at the added item;
9. Press OK;
10. See that the toolbar is shown, with the icon;
11. Save the document, reload to check that the image is still shown;
12. Try to open the document in a version 6.3 or earlier.

=> the item on the toolbar is shown without the icon in 6.3 and earlier.

What to watch: the icon size in Options->LibreOffice->View must be the same (large or small) in both the generating and testing versions; the "Automatic" changed over the time, so it's best to select one explicitly before the creation in the newer version, and the same in the testing version.

The problem appeared in two steps. Before commit 825e3f66497c673dd7ac11a8fce830874288977d, it saved OK, and the icon was shown in all versions, including OOo 3.2 (and AOO). After that said commit, it started to save wrong, with the icon not shown at all, even in the generating version. And finally, after commit d367ee2f8c204f351072c0eb10259fd7aa497770, it started to save with the image visible in the generating and newer versions, but not in older.
Comment 1 Mike Kaganski 2024-10-09 09:26:17 UTC
Ah, sorry; saving so that the icon is visible in 6.4+ started after commit 8ef781e68f66a9bf7501ef82ee5625b3758b6c88.

And commit d367ee2f8c204f351072c0eb10259fd7aa497770 only made those images show, but saving was still broken.
Comment 2 Mike Kaganski 2024-10-09 09:36:34 UTC
The problematic difference is in Configurations2/images/lc_imagelist.xml:

Version 6.3 generated this:

> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE image:imagecontainer PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "image.dtd">
> <image:imagescontainer xmlns:image="http://openoffice.org/2001/image" xmlns:xlink="http://www.w3.org/1999/xlink">
>  <image:images xlink:type="simple" xlink:href="Bitmaps/lc_userimages.png" image:maskcolor="#0" image:maskmode="maskcolor">
>   <image:entry image:bitmap-index="0" image:command="vnd.sun.star.script:Standard.Module1.Main?language=Basic&amp;location=application"/>
>  </image:images>
> </image:imagescontainer>

and version 7.1 generates this:

> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE image:imagecontainer PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "image.dtd">
> <image:imagescontainer xmlns:image="http://openoffice.org/2001/image" xmlns:xlink="http://www.w3.org/1999/xlink">
>  <image:images xlink:type="simple">
>   <image:entry image:command="vnd.sun.star.script:Standard.Module1.Main?language=Basic&amp;location=application"/>
>  </image:images>
> </image:imagescontainer>

Adding the missing data to 'image:images' and 'image:entry' elements (both!) restores normal opening in older versions.
Comment 3 Mike Kaganski 2024-10-09 12:19:58 UTC
https://gerrit.libreoffice.org/c/core/+/174721
Comment 4 Commit Notification 2024-10-09 13:41:05 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/85d1e6662b09be414565c6aa512abf5bc9b83f3d

tdf#163362: write xlink:href in image:images, image:bitmap-index in image:entry

It will be available in 25.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 5 Commit Notification 2024-10-17 09:12:08 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "libreoffice-24-8":

https://git.libreoffice.org/core/commit/c3f8c4c7ba806d3a53850f6d708f92d7995cf65e

tdf#163362: write xlink:href in image:images, image:bitmap-index in image:entry

It will be available in 24.8.3.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.