Apache OpenOffice (AOO) Bugzilla – Issue 18035
macro recorder in scalc not recording all border selections correctly
Last modified: 2017-05-20 11:13:56 UTC
I recorded a macro for the purpose of defining a border around a group of cells, as well as, a vertical line between the cells. I then cleared the border format and ran the macro. The border around the cells got created but the vertical between the cells did not. It does appear that coding was put in the macro to do the vertical line between the cells, it just does not do anything. I include the macro as created by the recorder for your reference. Thanks for your help, david sub Main 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 = "$A$6:$P$8" dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args1()) rem ---------------------------------------------------------------------- dim args2(7) as new com.sun.star.beans.PropertyValue args2(0).Name = "BorderOuter.LeftBorder" args2(0).Value = Array(0,0,2,0) args2(1).Name = "BorderOuter.LeftDistance" args2(1).Value = 0 args2(2).Name = "BorderOuter.RightBorder" args2(2).Value = Array(0,0,2,0) args2(3).Name = "BorderOuter.RightDistance" args2(3).Value = 0 args2(4).Name = "BorderOuter.TopBorder" args2(4).Value = Array(0,0,2,0) args2(5).Name = "BorderOuter.TopDistance" args2(5).Value = 0 args2(6).Name = "BorderOuter.BottomBorder" args2(6).Value = Array(0,0,2,0) args2(7).Name = "BorderOuter.BottomDistance" args2(7).Value = 0 dispatcher.executeDispatch(document, ".uno:BorderOuter", "", 0, args2()) rem ---------------------------------------------------------------------- dim args3(4) as new com.sun.star.beans.PropertyValue args3(0).Name = "BorderInner.Horizontal" args3(0).Value = Array(0,0,0,0) args3(1).Name = "BorderInner.Vertical" args3(1).Value = Array(0,0,2,0) args3(2).Name = "BorderInner.Flags" args3(2).Value = 1 args3(3).Name = "BorderInner.ValidFlags" args3(3).Value = 127 args3(4).Name = "BorderInner.DefaultDistance" args3(4).Value = 0 dispatcher.executeDispatch(document, ".uno:BorderInner", "", 0, args3()) rem ---------------------------------------------------------------------- dim args4(0) as new com.sun.star.beans.PropertyValue args4(0).Name = "ToPoint" args4(0).Value = "$D$10" dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args4()) end sub
Hi Joerg, please have a look
Confirmed. BorderInner is not recorded/replayed correctly. rem ---------------------------------------------------------------------- dim args8(4) as new com.sun.star.beans.PropertyValue args8(0).Name = "BorderInner.Horizontal" args8(0).Value = Array(0,0,88,0) args8(1).Name = "BorderInner.Vertical" args8(1).Value = Array(0,0,2,0) args8(2).Name = "BorderInner.Flags" args8(2).Value = 1 args8(3).Name = "BorderInner.ValidFlags" args8(3).Value = 127 args8(4).Name = "BorderInner.DefaultDistance" args8(4).Value = 0 dispatcher.executeDispatch(document, ".uno:BorderInner", "", 0, args8())
Reassign to NN
note: later?
Accepting, but don't expect any quick progress. There are currently no plans to extend the coverage of the macro recorder.
According to the OpenOffice.org roadmap (http://tools.openoffice.org/releases) this issue was retargeted to OOo Later.
In swriter-tables (OOo 1.1.4) there seems to be the same problem with BorderInner. The macro-recorder in swriter produces the same code when recording the changes to border attributes of a seleceted group of cells in a table. But when replaying the macro, only the outer borders are changed correctly, while the inner borders are erased completely ! @jsk: why do you rewrite the code to args8(0).Name = "BorderInner.Horizontal" args8(0).Value = Array(0,0,88,0) args8(1).Name = "BorderInner.Vertical" args8(1).Value = Array(0,0,2,0) while dwoody1 only wanted to have a vertical line ? @all: what would a code look like which can make inner borders thicker ? Gisbert
Now there is OOo 2.2 out - and this bug exists furthermore. A interesting thing is that the recorder create other code if you record the using of the icon for the border formatting. So you can rewrite the above code as sub Main 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 args2(12) as new com.sun.star.beans.PropertyValue args2(0).Name = "OuterBorder.LeftBorder" args2(0).Value = Array(0,0,2,0) args2(1).Name = "OuterBorder.LeftDistance" args2(1).Value = 0 args2(2).Name = "OuterBorder.RightBorder" args2(2).Value = Array(0,0,2,0) args2(3).Name = "OuterBorder.RightDistance" args2(3).Value = 0 args2(4).Name = "OuterBorder.TopBorder" args2(4).Value = Array(0,0,2,0) args2(5).Name = "OuterBorder.TopDistance" args2(5).Value = 0 args2(6).Name = "OuterBorder.BottomBorder" args2(6).Value = Array(0,0,2,0) args2(7).Name = "OuterBorder.BottomDistance" args2(7).Value = 0 args2(8).Name = "InnerBorder.Horizontal" args2(8).Value = Array(0,0,0,0) args2(9).Name = "InnerBorder.Vertical" args2(9).Value = Array(0,0,2,0) args2(10).Name = "InnerBorder.Flags" args2(10).Value = 1 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()) end sub This works. Is there a explanation for the difference between the use of ".uno:BorderOuter"/".uno:BorderInner" and ".uno:SetBorderStyle" with the definitions of "InnerBorder" and "OuterBorder"? Where can i find the specifications for the dispatch parameters, especially for the ".uno:"-constructs and their accepted properties? Mathias
Reset assigne to the default "issues@openoffice.apache.org".