Bug 162555 - Crash adding current drawing to the Gallery
Summary: Crash adding current drawing to the Gallery
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Draw (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Mike Kaganski
URL:
Whiteboard: target:25.2.0 target:24.8.1
Keywords:
Depends on:
Blocks:
 
Reported: 2024-08-22 09:01 UTC by Mike Kaganski
Modified: 2024-08-23 12:13 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-08-22 09:01:33 UTC
Create a Draw document, put there something (e.g., a line, or a rectangle), and execute the following Basic code:

Sub AddToGallery
  oGalleryProvider = createUnoService("com.sun.star.gallery.GalleryThemeProvider")
  oTheme = oGalleryProvider.insertNewByName("_TestTheme1")
  oTheme.insertDrawingByIndex(ThisComponent, 0)
End Sub

=> Crash
Comment 1 Mike Kaganski 2024-08-22 09:09:58 UTC
https://gerrit.libreoffice.org/c/core/+/172196
Comment 2 Cor Nouws 2024-08-22 10:16:38 UTC
(In reply to Mike Kaganski from comment #0)
>   oTheme.insertDrawingByIndex(ThisComponent, 0)
> ...
> => Crash
It should not crash... OTOH, it is not expected to pass the document as argument, since it requires a Drawing.
Was to test, or?
Comment 3 Mike Kaganski 2024-08-22 10:24:24 UTC
(In reply to Cor Nouws from comment #2)
It expects an XComponent, so any XComponent should do. And ThisComponent is a good option for the intended use, why not?
Comment 4 Commit Notification 2024-08-22 12:24:20 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/0afb4cfc5ed1e926dfd287007c5a35585584daec

tdf#162555: change rtl::Reference creation order

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 Cor Nouws 2024-08-22 19:05:51 UTC
made a fresh build
Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 2c9821d391c243ae83a408163f054d7a7a9a1daa
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded

Added TestTheme as gallery theme.
Could 'add' elements via the UI (find files, add, ok)
But these were not visible.
Closed and restarted.
Opened Impress. Trying to open the Gallery reliably crashes.
Have a backtrace.log available..
Comment 6 Commit Notification 2024-08-23 11:19:39 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "libreoffice-24-8":

https://git.libreoffice.org/core/commit/5d9181f479513826d0eedc49520ede7f05b6f7b5

tdf#162555: change rtl::Reference creation order

It will be available in 24.8.1.

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.