Bug 126058 - No inner borders after replaying a recorded macro
Summary: No inner borders after replaying a recorded macro
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
(earliest affected) release
Hardware: All Linux (All)
: medium normal
Assignee: Not Assigned
Depends on:
Blocks: Macro-Recording
  Show dependency treegraph
Reported: 2019-06-23 16:16 UTC by Adam Niedling
Modified: 2022-07-24 20:07 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:
Regression By:


Note You need to log in before you can comment on or make changes to this bug.
Description Adam Niedling 2019-06-23 16:16:53 UTC
There will be no inner borders after replaying a recorded macro.

I'm including the whole macro in the Additional Information field.

Steps to Reproduce:
1. Record a macro in which you add both outer and inner borders to the selected cells.
2. Save the macro.
3. Replay it.

Actual Results:
There will be only outer borders around the cells.

Expected Results:
There should be inner borders as well.

Reproducible: Always

User Profile Reset: No

Additional Info:
sub test
rem ----------------------------------------------------------------------
rem define variables
dim document   as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document   = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")

rem ----------------------------------------------------------------------
dim args1(0) as new com.sun.star.beans.PropertyValue
args1(0).Name = "ToPoint"
args1(0).Value = "$E$12:$G$15"

dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args1())

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

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

rem ----------------------------------------------------------------------
dim args4(7) as new com.sun.star.beans.PropertyValue
args4(0).Name = "BorderOuter.LeftBorder"
args4(0).Value = Array(0,0,26,0,0,26)
args4(1).Name = "BorderOuter.LeftDistance"
args4(1).Value = 0
args4(2).Name = "BorderOuter.RightBorder"
args4(2).Value = Array(0,0,26,0,0,26)
args4(3).Name = "BorderOuter.RightDistance"
args4(3).Value = 0
args4(4).Name = "BorderOuter.TopBorder"
args4(4).Value = Array(0,0,26,0,0,26)
args4(5).Name = "BorderOuter.TopDistance"
args4(5).Value = 0
args4(6).Name = "BorderOuter.BottomBorder"
args4(6).Value = Array(0,0,26,0,0,26)
args4(7).Name = "BorderOuter.BottomDistance"
args4(7).Value = 0

dispatcher.executeDispatch(document, ".uno:BorderOuter", "", 0, args4())

rem ----------------------------------------------------------------------
dim args5(4) as new com.sun.star.beans.PropertyValue
args5(0).Name = "BorderInner.Horizontal"
args5(0).Value = Array(0,0,26,0,0,26)
args5(1).Name = "BorderInner.Vertical"
args5(1).Value = Array(0,0,26,0,0,26)
args5(2).Name = "BorderInner.Flags"
args5(2).Value = 3
args5(3).Name = "BorderInner.ValidFlags"
args5(3).Value = 127
args5(4).Name = "BorderInner.DefaultDistance"
args5(4).Value = 0

dispatcher.executeDispatch(document, ".uno:BorderInner", "", 0, args5())

end sub
Comment 1 raal 2019-08-11 21:25:13 UTC
confirm with Version:
Build ID: 63889d3d465e9b4292dd5bb630bd3394494c8a6d
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; 

and Version (Build ID: efca6f15609322f62a35619619a6d5fe5c9bd5a)
Comment 2 b. 2020-07-06 08:22:14 UTC

additional observation, if you select different styles for the borders (outer, didn't test inner as they are omitted anyway) the macro applies only on of them ... 

see also: https://ask.libreoffice.org/en/question/253532/calc-setting-borders-via-a-macro/?comment=253617#post-id-253617
Comment 3 b. 2020-07-10 20:33:16 UTC
pls. look at: 


the OP there found a solution, citation: 1

'The clue I had been missing was the use of the Table2 and Border2 objects rather than the more obvious Table and Border objects.'

recorded macros are often not 'perfect', but a base to build own solutions, together with above solution i'd close as 'wfm' if nobody objects.
Comment 4 QA Administrators 2022-07-11 03:29:27 UTC Comment hidden (obsolete)
Comment 5 Igor 2022-07-24 20:07:50 UTC
No, it doesn't work. Can't set the vertical inner border double line. 2-columns range is previously selected.

Sub SetBorderInnerVertical()
	Dim document As Object
	Dim dispatcher As Object

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

	Dim args(4) as new com.sun.star.beans.PropertyValue
	args(0).Name = "BorderInner.Horizontal"
	args(0).Value = Array(0, 0, 0, 0, 0, 0)
	args(1).Name = "BorderInner.Vertical"
	args(1).Value = Array(0, 18, 18, 4, 15, 2)
	args(2).Name = "BorderInner.Flags"
	args(2).Value = 2
	args(3).Name = "BorderInner.ValidFlags"
	args(3).Value = 127
	args(4).Name = "BorderInner.DefaultDistance"
	args(4).Value = 0

	dispatcher.executeDispatch(document, ".uno:BorderInner", "", 0, args())
End Sub