Bug 162807 - Macro recording fail / .uno:LeftRightMargin regression
Summary: Macro recording fail / .uno:LeftRightMargin regression
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
24.2.5.2 release
Hardware: All Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisected, bisected, regression
Depends on:
Blocks: Macro-Recording
  Show dependency treegraph
 
Reported: 2024-09-05 12:04 UTC by mprotic
Modified: 2024-12-20 06:58 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
test file with macro (9.84 KB, application/vnd.oasis.opendocument.text)
2024-10-05 07:31 UTC, raal
Details

Note You need to log in before you can comment on or make changes to this bug.
Description mprotic 2024-09-05 12:04:06 UTC
Using LibreOffice from Ubuntu 24.04. repositories, here is version info

Version: 24.2.5.2 (X86_64) / LibreOffice Community
Build ID: 420(Build:2)
CPU threads: 8; OS: Linux 6.8; UI render: default; VCL: gtk3, Wayland
Locale: sr-RS (en_US.UTF-8); UI: en-US
Ubuntu package version: 4:24.2.5-0ubuntu0.24.04.2
Calc: threaded


Some of my old macros for setting margins in writer document fail since upgrade to Ubuntu 24.04 (Libreoffice 24.2.5.2). Here is the code of a macro that is failing to set margins:

  dim args1(3) as new com.sun.star.beans.PropertyValue
  args1(0).Name = "LeftRightMargin.LeftMargin"  
  args1(0).Value = 0
  args1(1).Name = "LeftRightMargin.TextLeftMargin"
  args1(1).Value = 0
  args1(2).Name = "LeftRightMargin.RightMargin"
  args1(2).Value = 0
  args1(3).Name = "LeftRightMargin.FirstLineIndent"
  args1(3).Value = 2540
  dispatcher.executeDispatch(document, ".uno:LeftRightMargin", "", 0, args1())

Looking at documentation for .uno:LeftRightMargin gives no parameters for .uno:LeftRightMargin:
  .uno:LeftRightMargin 		Edit 		SID_ATTR_LRSPACE (10048) 


Ok, thinking, maybe it's a change in api, I tried to simply rerecord a macro by just setting a margin and it also fails giving me the following:

document   = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")

rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:LeftRightParaMargin", "", 0, Array())

So, no margins are being set at all in recorded macro (which kind of makes sense since LeftRightParaMargin also has no params)

Steps to reproduce: Start recording macro, set margins for paragraph, stop recording macro, inspect recorded code.
Comment 1 raal 2024-10-05 07:27:40 UTC
Tested your macro in old version LO 7.3.7, but after run of macro nothing changed in Format > Page style > Margins. Please provide simple document and write steps by step instructions how to check the issue.
Comment 2 raal 2024-10-05 07:31:51 UTC
Created attachment 196899 [details]
test file with macro

It's not margin, but Indent in Paragraph options - Indents&Spacing - Indent. Macro set "First line" to 2,54 cm
Comment 3 raal 2024-10-05 07:48:12 UTC
This seems to have begun at the below commit in bibisect repository/OS linux-64-7.6.
Adding Cc: to Michael Stahl ; Could you possibly take a look at this one?
Thanks
 94ff994d396ae38edf4f72215452b4c4b086490d is the first bad commit
commit 94ff994d396ae38edf4f72215452b4c4b086490d
Author: Jenkins Build User <tdf@pollux.tdf>
Date:   Wed Oct 25 05:46:44 2023 +0200

    source db115bec9254417ef7a3faf687478fe5424ab378

147024: tdf#78510 sw,cui: split SvxLRSpaceItem for SwTextNode, SwTextFormatColl | https://gerrit.libreoffice.org/c/core/+/147024