Issue 109535 - getParent() of a table control's list box control does not work anymore
Summary: getParent() of a table control's list box control does not work anymore
Status: CLOSED FIXED
Alias: None
Product: gsl
Classification: Code
Component: code (show other issues)
Version: OOo 3.2
Hardware: PC Windows XP
: P3 Trivial with 5 votes (vote)
Target Milestone: OOo 3.2.1
Assignee: marc.neumann
QA Contact: issues@gsl
URL:
Keywords: regression
: 110555 (view as issue list)
Depends on:
Blocks: 109046
  Show dependency tree
 
Reported: 2010-02-23 11:41 UTC by kretek
Modified: 2017-05-20 10:23 UTC (History)
1 user (show)

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


Attachments
The OOo Base document containing the form affected (11.01 KB, application/vnd.sun.xml.base)
2010-02-23 12:01 UTC, kretek
no flags Details
document to reproduce the bug case (12.57 KB, application/vnd.sun.xml.base)
2010-03-11 12:23 UTC, Frank Schönheit
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description kretek 2010-02-23 11:41:24 UTC
The ListBox subcomponent in grid control has broken automation in v3.2. It
doesn't response to getParent() function correctly.

The following code, triggered by ListBox column subcomponent in a grid control,
works fine to the version 3.1.1 and stops working in 3.2:

Sub blah(oEvent)
	dim oForm as object
	dim oMasterForm as object
	oForm = oEvent.Source
	oMasterForm = oForm.getParent().getParent().GetParent().GetParent()
	'some following code
end Sub

Since 3.2, every try of using getParent() on ListBox subcontrol ends up with
"illegal object given" message. I also used XRay on oEvent.Source and it also
gave the same error when I tried to inspect getParent() method of the object.

Since the code breaks in 3.2, I reverted to 3.1.1 and it resumed to work.
Comment 1 kretek 2010-02-23 12:01:26 UTC
Created attachment 67993 [details]
The OOo Base document containing the form affected
Comment 2 philipp.lohmann 2010-02-23 12:25:17 UTC
@fs: please have a look
Comment 3 Frank Schönheit 2010-02-23 12:31:50 UTC
putting into our pool for to-be-confirmed issues
Comment 4 m90216 2010-03-09 23:02:11 UTC
I have found the same issue with a push button control on a main form (on 
Windows Vista 32bit OS). Several of my macros that have worked since v2.4 are 
broken in 3.2. I am using the "auto" property <Object>.source.model.parent
Comment 5 Frank Schönheit 2010-03-10 07:55:09 UTC
fs->kretek: The document you attached is not self-contained, it does not contain
any actual tables or data, so the contained form does not work, so the macro is
never triggered.

fs->m90216: I tried to replicate the problem with a button, bound to the
following macro:
Sub hello(oEvent)
  dim oEventSource as object
  oEventSource = oEvent.Source

  MsgBox "event source: " & oEventSource.ImplementationName

  Dim oModel as Object
  oModel = oEventSource.Model
  MsgBox "event source's model: " & oModel.ImplementationName

  MsgBox "parent :" & oModel.getParent().ImplementationName
  MsgBox "parent.parent :" & oModel.getParent().getParent().ImplementationName
  MsgBox "parent.parent.parent :" & _
    oModel.getParent().getParent().getParent().ImplementationName
  MsgBox "parent.parent.parent.parent :" & _
    oModel.getParent().getParent().getParent().getParent().ImplementationName
end Sub

This works perfectly fine in OOo 3.2.
Comment 6 m90216 2010-03-10 22:58:29 UTC
I may have jumped to conclusions. The actual code that failed was bound to a 
checkbox control in a sub-form (Item Status Changed event). This is it...

Sub onClickUpdateMeal(Ob as Object)
Dim bStat as Boolean, MenuID as double, sSQL as string
bStat = (Ob.Selected=1)
'Xray Ob
MenuID =Ob.source.model.parent.GetByName("ID").GetCurrentValue
...

This gets the value from the selected row in the subform grid. I have used 
similar code as a quick reference to the form in macros bound to buttons but I 
must be wrong in assuming they suffer the same problem. I have reverted to 
3.1.1 now so can't test further for the time being.

If I uncommented the Xray, "Ob" had no name and gave the same error when 
Xraying the parent property. Looks as if the error is limited to controls 
within a grid control. Sorry if I raised a red herring.
Comment 7 Frank Schönheit 2010-03-11 12:23:24 UTC
Created attachment 68292 [details]
document to reproduce the bug case
Comment 8 Frank Schönheit 2010-03-11 12:24:24 UTC
confirming. Targeting to 3.2.1 'cause it's a regression.
Comment 9 Frank Schönheit 2010-03-11 12:27:20 UTC
fixed in CWS dba321a

find more information about this CWS, like when it is available in the master
builds, in EIS, the Environment Information System:
http://eis.services.openoffice.org/EIS2/cws.ShowCWS?Path=DEV300%2Fdba321a
Comment 10 robttwlee 2010-03-12 16:31:15 UTC
I have the same problem with a Combobox control in a grid, in a subform
the event parameter shows a null parent.
Comment 11 Frank Schönheit 2010-03-24 09:25:30 UTC
fs->msc: please verify in CWS dba321a
Comment 12 marc.neumann 2010-03-26 10:12:58 UTC
verified in CWS dba321a

find more information about this CWS, like when it is available in the master
builds, in EIS, the Environment Information System:
http://eis.services.openoffice.org/EIS2/cws.ShowCWS?Path=DEV300%2Fdba321a
Comment 13 tony_52 2010-04-01 22:43:55 UTC
Hi

Using Ubuntu with OpenOffice 3.2.0 build 9483 i get the same error when using a
checkbox, and then using a Macro to reference it.
Comment 14 marc.neumann 2010-04-06 08:01:45 UTC
*** Issue 110555 has been marked as a duplicate of this issue. ***