Bug 93701 - crash running StarDesktop.getPropertySetInfo().getProperties()
Summary: crash running StarDesktop.getPropertySetInfo().getProperties()
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
5.0.1.2 release
Hardware: x86-64 (AMD64) Windows (All)
: medium trivial
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-08-27 06:07 UTC by himajin100000
Modified: 2015-09-29 18:42 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description himajin100000 2015-08-27 06:07:17 UTC
STEPS TO REPRODUCE:

1. Run the following code

REM  *****  BASIC  *****
Option Explicit

Sub Main()
	StarDesktop.getPropertySetInfo().getProperties()
End Sub

ACTUAL RESULT:

crash

EXPECTED RESULT:

no crash

ENVIRONMENT:

Version: 5.0.1.2 (x64)
Build ID: 81898c9f5c0d43f3473ba111d7b351050be20261
Locale: ja-JP (ja_JP)
OS: Windows 10
Comment 1 Cor Nouws 2015-08-27 10:23:36 UTC
Hi,

Thanks for filing the issue!

What you see is due to a api-change
Please try the following:

	If HasUnoInterfaces(ThisComponent, "com.sun.star.document.XDocumentInfoSupplier") Then
	' 3.x
		oDocInfo = ThisComponent.getDocumentInfo()
		oDocSetInfo = oDocInfo.getPropertySetInfo
	Else
		oDocSetInfo = ThisComponent.getDocumentProperties.getUserDefinedProperties.getPropertySetInfo
		oDocInfo = ThisComponent.getDocumentProperties.getUserDefinedProperties
	End If

 	If oDocSetInfo.hasPropertyByName(sName) Then
		ReadMyDocProp =	oDocInfo.getPropertyValue(sName) 
	End If	


Cheers,
Cor
Comment 2 himajin100000 2015-08-28 04:28:24 UTC
Thanks for the comment.

but actually I did not intend to get document properties or to write meaningful code, but was trying to find a line of code that crashes LibreOffice.

I still believe we should not leave the crash as is. 
at least the StarBasic should be changed so that it gives a runtime error.

reopening this bug.
Comment 3 Cor Nouws 2015-08-28 06:05:13 UTC
Thanks for reopening!

I had a little doubt already when commenting. Sorry for not understanding you well enough.

I cannot reproduce the crash on Linux 32 bits.
(But it's not exceptional that something crashes on one platform and returns an error on the other, see e.g. tdf#92446)
Comment 4 Buovjaga 2015-09-12 19:26:52 UTC
Doesn't crash here.. I have 32-bit build, though.

Win 7 Pro 64-bit, Version: 5.0.1.2 (32-bit)
Build ID: 81898c9f5c0d43f3473ba111d7b351050be20261
Locale: fi-FI (fi_FI)
Comment 5 raal 2015-09-29 16:16:13 UTC
No crash with Version: 5.1.0.0.alpha1+ (x64)
Build ID: bf2116353a89c402bf19b79d49eadf4454103423
TinderBox: Win-x86_64@62-TDF, Branch:MASTER, Time: 2015-09-16_11:35:23
Comment 6 Cor Nouws 2015-09-29 18:42:00 UTC
Hi,

I see three WorksForMe. So safe to close and assume something else gives a problem?

Cheers - Cor