Bug 147526 - Basic Macro manipulating text table crashes LibreOffice Writer
Summary: Basic Macro manipulating text table crashes LibreOffice Writer
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Caolán McNamara
URL:
Whiteboard: target:7.6.0 target:7.5.4
Keywords:
Depends on:
Blocks: Crash
  Show dependency treegraph
 
Reported: 2022-02-19 01:47 UTC by Colin
Modified: 2023-06-13 04:06 UTC (History)
3 users (show)

See Also:
Crash report or crash signature: https://crashreport.libreoffice.org/stats/crash_details/a2793566-5177-4ff0-86e0-9593d7a2a57e


Attachments
A writer document with three macros containing several text tables (26.36 KB, application/vnd.oasis.opendocument.text)
2022-02-19 01:48 UTC, Colin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Colin 2022-02-19 01:47:03 UTC
Description:
I have written a macro to alter the borders of a text table and the margins of the first row of the text table.

When running the macro the macro alters the first few text tables as expected but then crashes Libreoffice writer.

Similar code that does each step separately does not crash.

Of course I could be doing something not recommended in the macros but a crash is probably not a good thing.

Steps to Reproduce:
1.Enable medium macro security 
2. Open attached document and allow macros
3. Run macro ChangeTableBordersandMargins_Crash

Actual Results:
The first few tables are changed and Libreoffice writer crashes.

Expected Results:
I would have expected all the tables to have a new border and larger margins.


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 7.2.4.1 (x64) / LibreOffice Community
Build ID: 27d75539669ac387bb498e35313b970b7fe9c4f9
CPU threads: 4; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win
Locale: en-AU (en_AU); UI: en-GB
Calc: threaded

and

Version :5.2.7.2
Build ID: 1:5.2.7-1+rpi1+deb9u11
CPU Threads: 1; OS Version: Linux 4.19; UI Render: default; VCL: gtk2;
Local: en-AU (en_AU.UTF-8); Calc: group
Comment 1 Colin 2022-02-19 01:48:29 UTC
Created attachment 178389 [details]
A writer document with three macros containing several text tables
Comment 2 raal 2022-02-20 16:45:45 UTC
Confirm crash with Version: 7.4.0.0.alpha0+ / LibreOffice Community
Build ID: 8942956e05f2208ffb666a2118f5db092c30ce6a
CPU threads: 4; OS: Linux 5.11; UI render: default; VCL: gtk3
Locale: cs-CZ (cs_CZ.UTF-8); UI: en-US
Calc: threaded Jumbo

and Version 4.1.0.0.alpha0+ (Build ID: efca6f15609322f62a35619619a6d5fe5c9bd5a)
Comment 3 Timur 2022-03-21 13:27:15 UTC
Inherited. Interesting it doesn't crash if macro is Event on Open Document.
Comment 4 Caolán McNamara 2023-05-03 13:47:11 UTC
lets make it not crash at least
Comment 5 Commit Notification 2023-05-03 19:46:48 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

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

tdf#147526 a macro case which results in a null Lower() result

It will be available in 7.6.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 6 Caolán McNamara 2023-05-03 19:51:07 UTC
doesn't crash for me after that. backport to 7-5 in gerrit
Comment 7 Commit Notification 2023-05-04 08:32:19 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-7-5":

https://git.libreoffice.org/core/commit/11990fdfae41255a1f1446d1d00f50838c5fcc83

tdf#147526 a macro case which results in a null Lower() result

It will be available in 7.5.4.

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 8 Colin 2023-06-12 22:03:44 UTC
Tested in Libreoffice Writer Portable 7.5.4.2 and crash has been resolved and macro is working.

Thanks..
Comment 9 BogdanB 2023-06-13 04:06:52 UTC
Verified, based on comment 8 from reporter.