Bug 40874

Summary: [MACRO RECORDING] uno:SetBorderStyle with wrong number of params
Product: LibreOffice Reporter: Olivier Hallot <olivier.hallot>
Component: BASICAssignee: Not Assigned <libreoffice-bugs>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium CC: cedric.bosdonnat.ooo, mst.fdo
Version: 3.4.3 releaseKeywords: regression
Hardware: Other   
OS: All   
Whiteboard: target:3.6.0 target:3.5.5
i915 platform: i915 features:
Attachments: sample file with macro recorded where issue occurs

Description Olivier Hallot 2011-09-14 06:07:45 UTC
Created attachment 51198 [details]
sample file with macro recorded where issue occurs

Hi

Recording macro in LibreOffice 3.4.3 where user set cell border line does not work.

The same operation recorded in OpenOffice 3.2 works correctly.

The issue is that in 3.4.x (and master 3.5) uno:SetBorderStyle uses border style with an array of 5 parameters, while in version 3.2 it has 4 parameters.

Eliminating the 5th parameter in the border line struct recorded in 3.4 or 3.5 makes uno:SetBorderStyle work correctly.

Summary: uno:SetBordeStyle does not work with the recent BordeStyle Struct (best guess).

The attached file has the recorded macro as example. Sheet 1 is the desired results. Sheet 2 is the actual result (no borderline drawn).

Fragment of code indicating the issue:

Macro OpenOffice 3.2

dim args14(12) as new com.sun.star.beans.PropertyValue
args14(0).Name = "OuterBorder.LeftBorder"
args14(0).Value = Array(0,0,2,0)                      <- issue!
args14(1).Name = "OuterBorder.LeftDistance"
args14(1).Value = 0
args14(2).Name = "OuterBorder.RightBorder"
args14(2).Value = Array(0,0,2,0)                      <- issue !
args14(3).Name = "OuterBorder.RightDistance"
args14(3).Value = 0
args14(4).Name = "OuterBorder.TopBorder"
args14(4).Value = Array(0,0,2,0)
args14(5).Name = "OuterBorder.TopDistance"
args14(5).Value = 0
args14(6).Name = "OuterBorder.BottomBorder"
args14(6).Value = Array(0,0,2,0)
args14(7).Name = "OuterBorder.BottomDistance"
args14(7).Value = 0
args14(8).Name = "InnerBorder.Horizontal"
args14(8).Value = Array(0,0,2,0)
args14(9).Name = "InnerBorder.Vertical"
args14(9).Value = Array(0,0,2,0)
args14(10).Name = "InnerBorder.Flags"
args14(10).Value = 0
args14(11).Name = "InnerBorder.ValidFlags"
args14(11).Value = 127
args14(12).Name = "InnerBorder.DefaultDistance"
args14(12).Value = 0

dispatcher.executeDispatch(document, ".uno:SetBorderStyle", "", 0, args14())

Macro LibreOffice 3.4

dim args2(12) as new com.sun.star.beans.PropertyValue
args2(0).Name = "OuterBorder.LeftBorder"
args2(0).Value = Array(0,0,2,0,0)                 <- issue: 5 params!
args2(1).Name = "OuterBorder.LeftDistance"
args2(1).Value = 0
args2(2).Name = "OuterBorder.RightBorder"
args2(2).Value = Array(0,0,2,0,0)
args2(3).Name = "OuterBorder.RightDistance"
args2(3).Value = 0
args2(4).Name = "OuterBorder.TopBorder"
args2(4).Value = Array(0,0,2,0,0)
args2(5).Name = "OuterBorder.TopDistance"
args2(5).Value = 0
args2(6).Name = "OuterBorder.BottomBorder"
args2(6).Value = Array(0,0,2,0,0)
args2(7).Name = "OuterBorder.BottomDistance"
args2(7).Value = 0
args2(8).Name = "InnerBorder.Horizontal"
args2(8).Value = Array(0,0,2,0,0)
args2(9).Name = "InnerBorder.Vertical"
args2(9).Value = Array(0,0,2,0,0)
args2(10).Name = "InnerBorder.Flags"
args2(10).Value = 0
args2(11).Name = "InnerBorder.ValidFlags"
args2(11).Value = 127
args2(12).Name = "InnerBorder.DefaultDistance"
args2(12).Value = 0

dispatcher.executeDispatch(document, ".uno:SetBorderStyle", "", 0, args2())
Comment 1 Olivier Hallot 2011-09-15 03:21:25 UTC
I guess this is BordeLine2 adjustment in the recording code or UNO object

http://api.libreoffice.org/docs/common/ref/com/sun/star/table/BorderLine2.html
Comment 2 Björn Michaelsen 2011-12-23 12:35:58 UTC
[This is an automated message.]
This bug was filed before the changes to Bugzilla on 2011-10-16. Thus it
started right out as NEW without ever being explicitly confirmed. The bug is
changed to state NEEDINFO for this reason. To move this bug from NEEDINFO back
to NEW please check if the bug still persists with the 3.5.0 beta1 or beta2 prereleases.
Details on how to test the 3.5.0 beta1 can be found at:
http://wiki.documentfoundation.org/QA/BugHunting_Session_3.5.0.-1

more detail on this bulk operation: http://nabble.documentfoundation.org/RFC-Operation-Spamzilla-tp3607474p3607474.html
Comment 3 Michael Stahl 2012-05-21 09:36:42 UTC
indeed there is some special code for macros there that assumes a
sequence with fixed number of 4 elements, but the BorderLine2 has
added 2 more (it seems there was also a version with 5 elements).

fixing that is easy enough; now it works just as before,
which means the  ".uno:BorderOuter" and ".uno:SetBorderStyle" work
but ".uno:BorderInner" does not, which is a pre-exisiting problem
that i tried to debug as well but it's not obvious how to get
that to work, seems dispatching that is explicitly disabled
because when it is dispatched it also resets the outer borders...
Comment 4 Not Assigned 2012-05-21 09:41:39 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=18ab7f52ebf78f41f824b2245a8a180d97081716

fdo#40874: make recorded border macros run:
Comment 5 Not Assigned 2012-05-22 07:57:09 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-3-5":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=8980ce1b3a9a43aeb6ee1a412697157976cddbe8&g=libreoffice-3-5

fdo#40874: make recorded border macros run:


It will be available in LibreOffice 3.5.5.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.