Issue 65420

Summary: OO crashes when 'revieve focus' event switches on the Filter Mode
Product: Base Reporter: drewjensen.inbox
Component: codeAssignee: marc.neumann
Status: CLOSED FIXED QA Contact: issues@dba <issues>
Severity: Trivial    
Priority: P2 CC: issues
Version: 680m167   
Target Milestone: OOo 2.1   
Hardware: All   
OS: All   
Issue Type: DEFECT Latest Confirmation in: ---
Developer Difficulty: ---
Description Flags
subject database
Crash report
DB doc with form with macro contained none

Description drewjensen.inbox 2006-05-16 06:16:25 UTC
NOTE - this is found in dev. build 169...

Attached is a database with a form 'eventAttendees2'.

This form contains a text field that has the events recieve and lose focus set
to call two macros. 

The receiving focus event calls the sub setFormFilterOn

sub SetFormFilterOn
dim document   as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document   = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("")

rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:FormFilter", "", 0, Array())

end sub

With the above macro assigned entering the text field will crash OO.
Comment 1 drewjensen.inbox 2006-05-16 06:16:58 UTC
Created attachment 36498 [details]
subject database
Comment 2 drewjensen.inbox 2006-05-16 06:17:55 UTC
Created attachment 36499 [details]
Crash report
Comment 3 drewjensen.inbox 2006-05-16 16:03:15 UTC
Couple of further tests on this. 

The crash happens under release 2.0.2 also.
It only happens when this particular macro is called - using dispatch to enter
form filter mode.
It only happens if dispatch is used to enter form filter mode, from the 'when
receiving focus' evnet. If I instead call the macro from say, 'on mouse key
release' instead then there is no problem.
Comment 4 Frank Schönheit 2006-06-12 14:25:01 UTC
uhoh, this is ambitious. When switching to filter mode, the controls in the form
are exchanged with special "filter control" versions. So when you do this from
within a focus notification, you're probably destroying the control which just
calls you.

Not sure how this can best be fixed. Of course OOo should not crash. Notifying
the events asynchronously might be an option.
Comment 5 Frank Schönheit 2006-06-12 14:28:12 UTC
Created attachment 37078 [details]
DB doc with form with macro contained
Comment 6 Frank Schönheit 2006-06-12 14:28:51 UTC
The attached file has the respective macro contained in the form (i.e. is
self-contained), so you can reproduce the crash directly.
Comment 7 Frank Schönheit 2006-06-12 14:30:01 UTC
slightly adjusting the summary to reflect that the crux is switching on the
filter mode
Comment 8 marc.neumann 2006-06-30 09:14:44 UTC
reassign to the right developer
Comment 9 Frank Schönheit 2006-06-30 10:33:39 UTC
Comment 10 Frank Schönheit 2006-07-18 12:43:24 UTC
The immediate crash is fixed in CWS 204b, i.e. for 2.0.4. However, it still
crashs when focusing the control with the mouse. Instead of also fixing symptoms
only here, we need a more comprehensive solution for the cases where a Basic
macro is called synchronously, and does unwanted things via the form UNO API
(issue 67147 is another example for this).

I have an idea, but the fix is risky, and checks need to be made whether
existing macros are affected, so this will be for 2.0.5 only.
Comment 11 Frank Schönheit 2006-07-25 14:50:28 UTC
fixed in CWS dba205a

find more information about this CWS, like when it is available in the master
builds, in EIS, the Environment Information System:
Comment 12 Frank Schönheit 2006-08-02 11:44:00 UTC
fs-> msc: please verify in CWS dba205a
Comment 13 Frank Schönheit 2006-08-11 11:33:15 UTC
targeting to 2.1, since the fix is part of a CWS aiming for this release
Comment 14 marc.neumann 2006-08-21 10:46:29 UTC
verified in CWS dba205a

find more information about this CWS, like when it is available in the master
builds, in EIS, the Environment Information System:
Comment 15 marc.neumann 2006-10-20 12:55:34 UTC

this is fixed in the current master. The current master is available at

I close this issue now.

Bye Marc