Bug 96889 - getPrintAreas generates [automation bridge] exception (but works in AOO>=3.4.1)
Summary: getPrintAreas generates [automation bridge] exception (but works in AOO>=3.4.1)
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
(earliest affected)
Inherited From OOo
Hardware: All Windows (All)
: medium normal
Assignee: Not Assigned
Depends on:
Blocks: Macro-VBA
  Show dependency treegraph
Reported: 2016-01-04 17:22 UTC by Angelo
Modified: 2018-04-04 13:26 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:
Regression By:

VBScript test (1.40 KB, text/plain)
2016-01-04 17:22 UTC, Angelo

Note You need to log in before you can comment on or make changes to this bug.
Description Angelo 2016-01-04 17:22:17 UTC
Created attachment 121715 [details]
VBScript test

[automation bridge] [UNO]

The attached VBScript test replicates the unexpected exception

The exception is generated programming LibreOffice by COM Automation.

The array of struct CellRangeAddress reported by getPrintAreas() method is unusable. If you try to refer a property (e.g. EndRow) an [automation bridge] exception is generated.

The problem originated in OpenOffice v3.3.0 and has been fixed since AOO v3.4.1.

Option explicit

'    LINE 37 [automation bridge] produces unexpected result
call TestGetPrintArea

Sub TestGetPrintArea
	dim SM,CR, Dsk, args(), doc, sheets, sheet0, sheet1, NewAreas(0), areas

	Set SM 	= WScript.CreateObject("com.sun.star.ServiceManager")
	Set CR 	= SM.createInstance("com.sun.star.reflection.CoreReflection")
	Set Dsk = SM.createInstance("com.sun.star.frame.Desktop")

	Set doc = Dsk.loadComponentFromURL("private:factory/scalc", "_blank", 0, args)
	set sheets = doc.getSheets()
	call sheets.insertNewByName("Sheet 2", 0)

	set sheet0 = sheets.getByIndex(0)
	set NewAreas(0) = SM.Bridge_GetStruct("com.sun.star.table.CellRangeAddress")
	NewAreas(0).Sheet = 0
	NewAreas(0).StartRow = 0
	NewAreas(0).StartColumn = 0
	NewAreas(0).EndRow = 9
	NewAreas(0).EndColumn = 1
	msgbox "Created RangeAddress [A1:B10]",, "Step 1/4"

	msgbox "Set PrintArea for sheet [" & sheet0.getName() & "]",, "Step 2/4"

	areas = sheet0.getPrintAreas()
	set sheet1 = sheets.getByIndex(1)
	msgbox "Got object sheet1 [" & sheet1.getName() & "]",, "Step 3/4"

	call sheet1.setPrintAreas(areas)
	msgbox "Copied PrintArea from sheet [" & sheet0.getName() & "] to sheet [" & sheet1.getName() & "]",, "Step 4/4"
	msgbox "Test completed successfully!",, "DONE"
end sub
Comment 1 Oliver Brinzing 2016-01-07 18:03:27 UTC
Comment 2 Carlos 2017-04-04 15:38:07 UTC Comment hidden (obsolete)
Comment 3 QA Administrators 2018-03-02 10:01:26 UTC Comment hidden (obsolete)
Comment 4 QA Administrators 2018-04-04 13:26:48 UTC
Dear Bug Submitter,

Please read this message in its entirety before proceeding.

Your bug report is being closed as INSUFFICIENTDATA due to inactivity and
a lack of information which is needed in order to accurately
reproduce and confirm the problem. We encourage you to retest
your bug against the latest release. If the issue is still
present in the latest stable release, we need the following
information (please ignore any that you've already provided):

a) Provide details of your system including your operating
   system and the latest version of LibreOffice that you have
   confirmed the bug to be present

b) Provide easy to reproduce steps – the simpler the better

c) Provide any test case(s) which will help us confirm the problem

d) Provide screenshots of the problem if you think it might help

e) Read all comments and provide any requested information

Once all of this is done, please set the bug back to UNCONFIRMED
and we will attempt to reproduce the issue. Please do not:

a) respond via email 

b) update the version field in the bug or any of the other details
   on the top section of our bug tracker

Warm Regards,
QA Team