Bug 121822 - Macro execution from macro-assigned draw:custom-shape, involving a Save-as (FILESAVE) and subsequent Reload (FILEOPEN), Close and Reopen original makes application crash
Summary: Macro execution from macro-assigned draw:custom-shape, involving a Save-as (F...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Macro-StarBasic
  Show dependency treegraph
 
Reported: 2018-11-30 14:29 UTC by Thijs
Modified: 2025-12-07 16:31 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Test sheet and macro that reproduces the crash (1.52 KB, application/x-zip-compressed)
2018-11-30 14:36 UTC, Thijs
Details
Test spreadsheet (16.63 KB, application/vnd.oasis.opendocument.spreadsheet)
2018-12-01 22:13 UTC, Thijs
Details
Export-Test with form control (17.47 KB, application/vnd.oasis.opendocument.spreadsheet)
2018-12-02 07:41 UTC, Oliver Brinzing
Details
14396a70-0449-468c-9142-4dcae7027223.dmp (125.02 KB, application/octet-stream)
2018-12-02 07:56 UTC, Oliver Brinzing
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thijs 2018-11-30 14:29:33 UTC
Description:
Context description:
In a macro a sheet is being saved as .CSV, subsequently reloaded, the original spreadsheet re-opened and finally the .CSV sheet closed.
This macro has been assigned to a button in the original spreadsheet.
The Macro resides not in an spreadsheet but in the "My Macros" section
Problem happens under WIN10 and Linux alike and on all computers I possess (laptop, desktop under WIN10 and Suse Linux.

Problem description:
When activating this macro via Tools-Macros-Run Macro... (or ALT-F11 - run macro) everything runs normal and with envisioned result, however ..
When activating this macro via the button in the original spreadsheet that has the macro assigned to it, the application Calc crashes somewhere when re-opening (FILEOPEN) the spreadsheet and closing the CSV to which 1 sheet originally was "saved-as" (FILESAVE).


Steps to Reproduce:
1. Open the simple prepared test sheet with the macro available (*** where can I upload that one via this form? ***)
2. Press the button to which the macro has been assigned
3. Press the OK button on all message boxes shown (after the last one the crash follows)

TO run properly do the same, but start the macro "ThemeExport" via Tools|Macros|Run Macro ..


Actual Results:
Crash

Expected Results:
Original sheet would be opened at the point I called the macro; the exported CSV file contains the exported data


Reproducible: Always


User Profile Reset: No



Additional Info:
See Expected Results: saved the designated sheet as CSV export, reload it, reopen the original spreadsheet, close the open CSV sheet
Comment 1 Thijs 2018-11-30 14:36:30 UTC
Created attachment 147177 [details]
Test sheet and macro that reproduces the crash

The zip file contains the test-sheet, as well as the macro "Theme_Export.bas". This macro must be imported into the "My Macros" area in the macro editor. The button in the sheet must be assigned to this macro prior to running and reproducing the test:
- Button press: crash follows after committing all dialogs
- Run Theme_Export from macro editor: no crash and everything is as expected
Comment 2 Oliver Brinzing 2018-12-01 17:14:50 UTC
(In reply to Thijs from comment #1)
> The zip file contains the test-sheet, as well as the macro

the zip file only contains the *.bas file. 
could you please attach the test-file too?
Comment 3 Thijs 2018-12-01 22:13:39 UTC
Created attachment 147206 [details]
Test spreadsheet

Sorry, picked the wrong file when building the zip. Here is the test spreadsheet for reproducing the crash
Comment 4 Oliver Brinzing 2018-12-02 07:41:07 UTC
confirming crash if macro is called from:

<draw:custom-shape draw:z-index="0" draw:style-name="gr1" draw:text-style-name="P2" 
 svg:width="226.37pt" svg:height="24.41pt" svg:x="0pt" svg:y="0.03pt">
 <office:event-listeners>
   <script:event-listener script:language="ooo:script" 
     script:event-name="dom:click" 
     xlink:href="vnd.sun.star.script:Standard.Module1.ThemeExport?
     language=Basic&amp;location=application" xlink:type="simple"/>
  </office:event-listeners>
  <text:p text:style-name="P1">
   <text:span text:style-name="T1">Shell Script Export Button</text:span>
  </text:p>
  <draw:enhanced-geometry svg:viewBox="0 0 21600 21600" 
      [...]
  </draw:enhanced-geometry>
</draw:custom-shape>

but it will *not* crash, if macro is started via a form control.
Comment 5 Oliver Brinzing 2018-12-02 07:41:40 UTC
Created attachment 147215 [details]
Export-Test with form control
Comment 6 Oliver Brinzing 2018-12-02 07:56:10 UTC
Created attachment 147217 [details]
14396a70-0449-468c-9142-4dcae7027223.dmp

adding *.dmp
Comment 7 QA Administrators 2021-11-21 03:58:29 UTC Comment hidden (obsolete)
Comment 8 QA Administrators 2023-11-22 03:13:50 UTC Comment hidden (obsolete)
Comment 9 QA Administrators 2025-11-22 03:13:38 UTC Comment hidden (obsolete)
Comment 10 Thijs 2025-12-07 16:31:36 UTC
Hi, FYI: I just (December 7, 2025) did test on openSUSE Leap 16.0 and the bug still leads to an application crash.
Regards

Version info:

Version: 25.8.3.2 (X86_64)
Build ID: 8ca8d55c161d602844f5428fa4b58097424e324e
CPU threads: 4; OS: Linux 6.4; UI render: default; VCL: kf5 (cairo+xcb)
Locale: nl-NL (en_US.UTF-8); UI: en-US
Calc: threaded