Issue 108895

Summary: Support new parameter for API: UserForm.Show(modal as boolean)
Product: App Dev Reporter: lihuiibm <lihuibj>
Component: vbaAssignee: AOO issues mailing list <issues>
Status: CONFIRMED --- QA Contact:
Severity: Trivial    
Priority: P3 CC: issues
Version: 3.3.0 or older (OOo)   
Target Milestone: ---   
Hardware: All   
OS: All   
Issue Type: DEFECT Latest Confirmation in: ---
Developer Difficulty: ---
Attachments:
Description Flags
Changes for the API
none
alternative patch none

Description lihuiibm 2010-02-03 07:29:53 UTC
Support new parameter for API: UserForm.Show(modal as boolean)
Comment 1 lihuiibm 2010-02-03 07:30:27 UTC
Created attachment 67575 [details]
Changes for the API
Comment 2 noel.power 2010-03-10 10:03:58 UTC
starting to look at this...
Comment 3 noel.power 2010-03-10 19:31:16 UTC
XDialog3.idl is missing from the patch, I don't understand the need for this
interface at all, also I don't understand the changes either to toolkit or vcl (
except the mnCancelClose change which seems to be a bug fix ) Alot of these
changes seem completely uncessesary. The changes to vcl and toolkit look like
they affect normal Dialog operation so they make me nervous, they also would be
harder to upstream, Additionally essentially duplicating the Eventlistener that
is in sbxmod.cxx in vbauserform.cxx doesn't seem a good thing to do.
With that in mind I rewrote the patch, it seems to work ( but I don't know what
you have tested your implementation against ) it attach it here, but... I still
wonder were there some reasons why the patch made the invasive changes to
toolkit and vcl, perhaps I missed something ???
Comment 4 noel.power 2010-03-10 19:32:54 UTC
Created attachment 68280 [details]
alternative patch
Comment 5 lihuiibm 2010-03-12 16:04:29 UTC
1. One change in vcl:
if ( mpWindowImpl->mxWindowPeer.is() && IsCreatedWithToolkit() && !IsInExecute()
&& !IsInShow() ). Adding '!IsInShow()' in the 'if' statement, is used to fix the
issue: When userform is showing in modeless, click the Close icon of the dialog
can't close the dialog.

2. another change in vcl:
    else if ( IsInShow() )
    {
        Hide();
        mbInClose = FALSE;
        return TRUE;
    }
Adding this 'else if' statement is used to fix the issue:
When showing the userform in modeless, click the Close icon to close the dialog,
the "Terminate" event of UserForm will be fired two times.