Apache OpenOffice (AOO) Bugzilla – Issue 106277
[From Symphony]ComboBox event can't work well in MacOSX
Last modified: 2017-05-20 11:29:57 UTC
Root Cause: In the sample, we call VBA API to switch to another sheet in the selection changed event of ComboBox, when switch to another sheet, all the control in current sheet will be disposed, that causes OO3 crashes. Resolution: Store the variable ImplListBox* pOldLB = mpImplLB; After Modify() is called, we check if the mpImplLB is disposed or not: if (ImplGetWindowImpl() != NULL && mpImplLB != NULL && pOldLB == mpImplLB) { ... }
Created attachment 65612 [details] Patch for this issue
Created attachment 65613 [details] Test case sample file for this issue
The reason of this fix: In the VBA codes, we activate another sheet in the change event of ComboBox, that cause this ComboBox control being disposed, because in OOo, when we switch to another sheet, all the form control in current sheet will be disposed: Private Sub ComboBox1_Change() Worksheets(ComboBox1.Text).Activate End Sub We fire the ComboBox_Change VBA event in the method of ComboBox:: Modify(), after ComboBox:: Modify() was called, this ComboBox was disposed, so once Select() is called, OOo crash. We store the variable: ImplListBox* pOldLB = mpImplLB, before Modify() is called, after Modify() is called, we check if pOldLB == mpImplLB, if these two variables are not equal, that means, this ComboBox has been disposed. combobox.cxx: IMPL_LINK( ComboBox, ImplSelectHdl, void*, EMPTYARG ) { ... if ( bCallSelect ) { ImplListBox* pOldLB = mpImplLB; mpSubEdit->SetModifyFlag(); mbSyntheticModify = TRUE; Modify(); mbSyntheticModify = FALSE; if (ImplGetWindowImpl() != NULL && mpImplLB != NULL && pOldLB == mpImplLB) { Select(); } } ... }
needs cws npower12 ( for the api ) and ab71 for the fake event handling to be in place before this can be upstreamed, after that probably pl ( vcl guru ) needs to review this fix, please take ownership for now
>needs cws npower12 ( for the api ) and ab71 for the fake event handling actually seems like it just needs ab71
Reset assigne to the default "issues@openoffice.apache.org".