Apache OpenOffice (AOO) Bugzilla – Issue 64118
Macros: dispatcher.executeDispatch crashes withou error.
Last modified: 2006-05-09 14:33:58 UTC
I have Sub that crashes when it gets to dispatcher.executeDispatch . This Sub works fine in OOo 1.1.3 . I'm not sure if this has any relation to #20046 . The actual OOo version is 1.9.129. REM setRangeRowsToRepeat REM REM set a range of rows to repeat when printing new page REM sub setRangeRowsToRepeat(startRow as integer, endRow as integer) dim document as object dim dispatcher as object document = ThisComponent.CurrentController.Frame dispatcher = createUnoService("com.sun.star.frame.DispatchHelper") dim args2(2) as new com.sun.star.beans.PropertyValue args2(0).Name = "PrintArea" args2(0).Value = "" args2(1).Name = "PrintRepeatRow" args2(1).Value = "$A$" & CStr(startRow + 1) & ":$A$" & CStr(endRow + 1) args2(2).Name = "PrintRepeatCol" args2(2).Value = "" dispatcher.executeDispatch(document, ".uno:ChangePrintArea", "", 0, args2()) end sub
Changed Version due to report. I checked with "2.0.2 German version WIN XP: [680m5(Build9011)]": can't run macro, get error message "Runtime error, argument not optional" or for 'args2(1).Value = "$A$" & CStr(startRow + 1) & ":$A$" & CStr(endRow + 1) ', alternative error message " wrong number of parameters" @grval Pls. specify your platform and OS! Pls. attach some spreadsheet.sxc containing macro!
Sorry. The Array was declared with the wrong size. Should be: Dim args2(3) as new com.sun.star.beans.PropertyValue This appears to fix my problem. OOo 1 runs the original code fine. In fact it genarated the code produucing a 2 element array from record macro. This may be a bug in OOo 1. However, I should get a run time error instead of OOo crashing. Operating System: Linux 2.6.12-10-686-smp
Still no crash with new code line, but error messages (pls. see screenshots!) Special LINUX problem? @grval: Pls. attach your spreadsheet containing - macro causing crash - macro working for you
Created attachment 35610 [details] screenshots as attachment for "Additional comments from rainerbielefeld Mon Apr 10 08:08:19 -0700 2006 "
Created attachment 35611 [details] spreadsheet I've got by PM that demonstrates the crash
I checked with "2.0.2 German version WIN XP: [680m5(Build9011)]" and 'crash00o2.ods': reproducible. OOo disappeared after I clicked the button in the document. Unfortunately it seems that no error report has been generated, after document recovery OOo started without asking me whether I would want to send a report @grval: For further attachments pls. use function "Create a new attachment (proposed patch, testcase, etc.)" on Issue Tracker page!
Sorry again. The array is declared with the right size: dim args2(2) as new com.sun.star.beans.PropertyValue should do 0..2, so this does not appear to be an array bounds checking problem. Also, I've noticed that sometimes I can not reproduce this crash.
I get crashing even with: dim args2(3) as new com.sun.star.beans.PropertyValue An interesting note: There are times where I can repeat the crash over and over again. There are times when I cannot repeat the crash, retrying repeatedly.
Created a crash report with "2.0 (1.9.m113) German version WIN XP: [680m113(Build8930)]". ID is currently unknown, I will contribute it when I have received answer from 'Quality Feedback'
Crash report ID is rwn9jf
seems to be a double to Issue 60603 *** This issue has been marked as a duplicate of 60603 ***
closed double