Issue 64118 - Macros: dispatcher.executeDispatch crashes withou error.
Summary: Macros: dispatcher.executeDispatch crashes withou error.
Status: CLOSED DUPLICATE of issue 60603
Alias: None
Product: Calc
Classification: Application
Component: programming (show other issues)
Version: 680m129
Hardware: All All
: P2 Trivial (vote)
Target Milestone: ---
Assignee: spreadsheet
QA Contact: issues@sc
URL:
Keywords: crash, oooqa
Depends on:
Blocks:
 
Reported: 2006-04-07 19:52 UTC by grval
Modified: 2006-05-09 14:33 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
screenshots as attachment for "Additional comments from rainerbielefeld Mon Apr 10 08:08:19 -0700 2006 " (42.07 KB, application/vnd.oasis.opendocument.graphics)
2006-04-10 16:10 UTC, Rainer Bielefeld
no flags Details
spreadsheet I've got by PM that demonstrates the crash (7.75 KB, application/vnd.oasis.opendocument.spreadsheet)
2006-04-10 16:21 UTC, Rainer Bielefeld
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description grval 2006-04-07 19:52:42 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
Comment 1 Rainer Bielefeld 2006-04-08 09:50:13 UTC
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! 
Comment 2 grval 2006-04-10 14:53:03 UTC
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
Comment 3 Rainer Bielefeld 2006-04-10 16:08:19 UTC
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
Comment 4 Rainer Bielefeld 2006-04-10 16:10:14 UTC
Created attachment 35610 [details]
screenshots as attachment for "Additional comments from rainerbielefeld Mon Apr 10 08:08:19 -0700 2006 "
Comment 5 Rainer Bielefeld 2006-04-10 16:21:26 UTC
Created attachment 35611 [details]
spreadsheet I've got by PM that demonstrates the crash
Comment 6 Rainer Bielefeld 2006-04-10 16:25:04 UTC
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!
Comment 7 grval 2006-04-10 17:20:06 UTC
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.

Comment 8 grval 2006-04-10 17:26:01 UTC
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.



Comment 9 Rainer Bielefeld 2006-04-13 18:59:41 UTC
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'
Comment 10 Rainer Bielefeld 2006-04-14 07:27:34 UTC
Crash report ID is rwn9jf
Comment 11 frank 2006-05-09 14:33:34 UTC
seems to be a double to Issue 60603

*** This issue has been marked as a duplicate of 60603 ***
Comment 12 frank 2006-05-09 14:33:58 UTC
closed double