Apache OpenOffice (AOO) Bugzilla – Issue 3001
macro keybinding crashes writer beyond recovery
Last modified: 2003-09-08 16:56:16 UTC
I have written a little macro which will, about fifty per cent of the time, when used in a newly opened document, crash OO completely, sometimes so badly it must be renistalled. This wasn't what I was trying to do. Here is the macro: Sub bigleft Dim oDocument, oDesktop, oText, oVCursor, oCursor As Object ' the two following lines get the active document oDesktop = createUnoService("com.sun.star.frame.Desktop") oDocument= oDesktop.getCurrentComponent() oText = oDocument.Text ' after this, an obscure call gets the current cursor position oVCursor = oDocument.currentcontroller.getViewCursor() ' but the move-by-word functions need an invisible cursor oCursor =oText.createTextCursorByRange(oVCursor.getstart()) if oCursor.isStartofWord() then oCursor.gotoPreviousWord(FALSE) oCursor.gotoStartOfWord(FALSE) else oCursor.gotoStartOfWord(FALSE) endif ' finally send the visible cursor where it should be oVCursor.gotoRange(oCursor,FALSE) End Sub Bind this to ctrl-left arrow. Open a document -- the one that most recenlty crashed on me is in the url -- go to somewhere in the middle. Press and hold ctrl-left and see what happens. After the first crash, the program will exit every time I try to access the configuration dialogue so I can't even change the keybinding away from the one that causes trouble. Only a complete reinstall seems to fix it. There must be some error in the macro, though I can't see what. But even if there is, such a mistake should never crash the whole program and then make it impossible to repair. So I think this is a very serious bug.
changed url to correct a typo: should be http://www.darwinwars.com/lunatic/bugs/ctrl-left_crash.sxw
Joost->Stephan: please have a look at it
Your macro works for me, which version of OpenOffice do you use ? BTW: your macro moves the cursor to the start of the previous word. AFAIK this behaviour is bound by default to the 'CTRL-LEFT' button.
Works for me is not a sufficient resolution of this bug. I am using 641C and it definitely doesn't work here. If it works with 641b, fine: then it's a different sort of bug. I don't have that around to test. Nor does it hapen every time I use the macro. It only appears in certain documents. Did you test it on the one I posted a link to? What happened was that I wrote the macro, tested it and bound it to a key; all without trouble. But when I reopened OO and tried with another document (the one I have enclosed) it blew up as described. It had earlier done so on another document, but by the time I had uninstalled and reinstalled everything, I couldn't remember which one. By the way, the macro does not mimic the default ctrl-left behaviour in an important respect: that's why I wrote it. The default behaviour counts spaces as words, so that it moves to the beginning of the word you are in, then the _end_ of the preceding word, and then the beginning of the one before. I had put in an enhancement request about that, and wrote the macro as a fill-in while waiting to see what would happen.
The current Openoffice version seem to have a problem with writing the configuration in 'soffice.cfg'. The described behaviour is independent from the macro. Even an easy macro like sub sayHello print "hello" end sub bound to a key raises the same problem. Since the behaviour doesn't appear in the current inhouse version anymore I suppose it'll be fixed in the next OpenOffice build.
Folowing this hint, I went to the soffice.cfg sudirectory and deleted writerkeybindings.xml. on restart, I was able to reconfigure the keys without, so far, causing any crashes. But I shall keep a backup of that file somewhere safe, in case it happens again
yes. It happened again. Any macro bound to any key seems able to produce this error
SW: works in OOo1.1RC3 => closed