Hi The recording of macros does catch the keyboard selection of cells to the sides left, right, up and down, but the commands are comented in the code: see this example: sub Formatacao3 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 ---------------------------------------------------------------------- rem dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) rem ---------------------------------------------------------------------- rem dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) rem ---------------------------------------------------------------------- rem dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) rem ---------------------------------------------------------------------- rem dispatcher.executeDispatch(document, ".uno:GoDownSel", "", 0, Array()) rem ---------------------------------------------------------------------- rem dispatcher.executeDispatch(document, ".uno:GoDownSel", "", 0, Array()) rem ---------------------------------------------------------------------- rem dispatcher.executeDispatch(document, ".uno:GoDownSel", "", 0, Array()) rem ---------------------------------------------------------------------- rem dispatcher.executeDispatch(document, ".uno:GoDownSel", "", 0, Array()) The issue is the "rem" in front of the command This is a bug. When selecting the same range with the mouse, the command is different and not "rem-ed". For example: rem ---------------------------------------------------------------------- dim args1(0) as new com.sun.star.beans.PropertyValue args1(0).Name = "ToPoint" args1(0).Value = "$A$15:$D$22" dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args1())
OpenOffice.org 3.3.0 under Windows does not show this bug.
In OpenOffice 3.0 the uno command used for cursor selection is GoDown with property "Sel" as True: rem ---------------------------------------------------------------------- dim args4(1) as new com.sun.star.beans.PropertyValue args4(0).Name = "By" args4(0).Value = 1 args4(1).Name = "Sel" args4(1).Value = true dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, args4()) In LibreOffice, the uno command is GoDownSel, as shown above.
Re-targeting, rising criticality. This prevent use of macro recording of basic cursor operations in the spreadsheet, turn it unreliable and thus useless with a severe loss of functionality for large companies. As the macro programming of the LO API is so complex and hard to get familiar, most would-be macro programmers records macros and use it as a base for their macros. This loss of functionality is a no-go. A regression to OOo macro recording is welcome.
Looks like the macro recorder distinguishes between such requests as "done" and "not done" by a flag set in it request after its processed. If its not marked as "done" it leaves it commented in the recording as "attempted but didn't succeed" The commit of: http://cgit.freedesktop.org/libreoffice/calc/commit/?id=e6ffcc9e12567dbff3197d3976339aab59456107 should do the trick as far as I can see. caolanm->kohei: I pushed the above fix to master, I'll reassign this to you for sanity check.
Very interesting. kohei->caolan: yes, the fix looks very sane. In fact, I'm glad to learn that what the Done() method does which was mysteriously sprinkled across the event handling code. Apparently I forgot to add that method there.
Can I ask your very kindness to also commit this patch in the forthcomming 3.3.4 maintenance release? A very large deployment depends on this release. Thank you guys.
No problem. I've cherry-picked Caolan's change to the 3-4 and 3-3 branches. This is an extremely safe change even for the 3.3 branch.
*** Bug 39961 has been marked as a duplicate of this bug. ***