View | Details | Raw Unified | Return to issue 108895
Collapse All | Expand All

(-)a/basic/inc/basic/sbmod.hxx (+2 lines)
Lines 49-54 Link Here
49
49
50
struct SbClassData;
50
struct SbClassData;
51
class SbModuleImpl;
51
class SbModuleImpl;
52
class	FormObjEventListenerImpl;
52
53
53
class SbModule : public SbxObject
54
class SbModule : public SbxObject
54
{
55
{
Lines 58-63 Link Here
58
	friend class	SbiRuntime;
59
	friend class	SbiRuntime;
59
	friend class	StarBASIC;
60
	friend class	StarBASIC;
60
	friend class	SbClassModuleObject;
61
	friend class	SbClassModuleObject;
62
	friend class	FormObjEventListenerImpl;
61
63
62
	SbModuleImpl*	mpSbModuleImpl;		// Impl data
64
	SbModuleImpl*	mpSbModuleImpl;		// Impl data
63
	std::vector< String > mModuleVariableNames;
65
	std::vector< String > mModuleVariableNames;
(-)a/basic/inc/basic/sbobjmod.hxx (-1 / +6 lines)
Lines 14-20 Link Here
14
 *
14
 *
15
 *    GNU Lesser General Public License Version 2.1
15
 *    GNU Lesser General Public License Version 2.1
16
 *    =============================================
16
 *    =============================================
17
 *    Copyright 2005 by Sun Microsystems, Inc.
17
 *    Copyright 2005, 2010 by Sun Microsystems, Inc.
18
 *    901 San Antonio Road, Palo Alto, CA 94303, USA
18
 *    901 San Antonio Road, Palo Alto, CA 94303, USA
19
 *
19
 *
20
 *    This library is free software; you can redistribute it and/or
20
 *    This library is free software; you can redistribute it and/or
Lines 59-66 Link Here
59
    void SetUnoObject( const com::sun::star::uno::Any& aObj )throw ( com::sun::star::uno::RuntimeException ) ;
59
    void SetUnoObject( const com::sun::star::uno::Any& aObj )throw ( com::sun::star::uno::RuntimeException ) ;
60
};
60
};
61
61
62
class FormObjEventListenerImpl;
62
class SbUserFormModule : public SbObjModule
63
class SbUserFormModule : public SbObjModule
63
{
64
{
65
    friend class FormObjEventListenerImpl;
66
64
    css::uno::Reference<css::lang::XEventListener> m_DialogListener;
67
    css::uno::Reference<css::lang::XEventListener> m_DialogListener;
65
    css::uno::Reference<css::awt::XDialog> m_xDialog;
68
    css::uno::Reference<css::awt::XDialog> m_xDialog;
66
    css::uno::Reference<css::frame::XModel> m_xModel;
69
    css::uno::Reference<css::frame::XModel> m_xModel;
Lines 69-79 Link Here
69
    SbUserFormModule( const SbUserFormModule& );
72
    SbUserFormModule( const SbUserFormModule& );
70
    SbUserFormModule();
73
    SbUserFormModule();
71
74
75
    void UnloadImpl();
72
protected:
76
protected:
73
    virtual void InitObject();
77
    virtual void InitObject();
74
public:
78
public:
75
    TYPEINFO();
79
    TYPEINFO();
76
    SbUserFormModule( const String& rName, const com::sun::star::script::ModuleInfo& mInfo, bool bIsVBACompat );
80
    SbUserFormModule( const String& rName, const com::sun::star::script::ModuleInfo& mInfo, bool bIsVBACompat );
81
    ~SbUserFormModule();
77
    virtual SbxVariable* Find( const XubString& rName, SbxClassType t );
82
    virtual SbxVariable* Find( const XubString& rName, SbxClassType t );
78
    void ResetApiObj();
83
    void ResetApiObj();
79
    void Unload();
84
    void Unload();
(-)a/basic/source/classes/sbxmod.cxx (-22 / +91 lines)
Lines 2-8 Link Here
2
 *
2
 *
3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
 *
4
 *
5
 * Copyright 2008 by Sun Microsystems, Inc.
5
 * Copyright 2008, 2010 by Sun Microsystems, Inc.
6
 *
6
 *
7
 * OpenOffice.org - a multi-platform office productivity suite
7
 * OpenOffice.org - a multi-platform office productivity suite
8
 *
8
 *
Lines 1713-1718 Link Here
1713
    sal_Bool mbShowing;
1713
    sal_Bool mbShowing;
1714
    FormObjEventListenerImpl(); // not defined
1714
    FormObjEventListenerImpl(); // not defined
1715
    FormObjEventListenerImpl(const FormObjEventListenerImpl&); // not defined
1715
    FormObjEventListenerImpl(const FormObjEventListenerImpl&); // not defined
1716
1717
    DECL_LINK( disposeDialog, void* );
1718
1716
public:
1719
public:
1717
    FormObjEventListenerImpl( SbUserFormModule* pUserForm, const uno::Reference< lang::XComponent >& xComponent ) : mpUserForm( pUserForm ), mxComponent( xComponent) , mbDisposed( false ), mbOpened( sal_False ), mbActivated( sal_False ), mbShowing( sal_False )
1720
    FormObjEventListenerImpl( SbUserFormModule* pUserForm, const uno::Reference< lang::XComponent >& xComponent ) : mpUserForm( pUserForm ), mxComponent( xComponent) , mbDisposed( false ), mbOpened( sal_False ), mbActivated( sal_False ), mbShowing( sal_False )
1718
    {
1721
    {
Lines 1730-1735 Link Here
1730
        removeListener();
1733
        removeListener();
1731
    }
1734
    }
1732
    sal_Bool isShowing() { return mbShowing; }
1735
    sal_Bool isShowing() { return mbShowing; }
1736
    bool isDisposed() { return mbDisposed; }
1733
    void removeListener()
1737
    void removeListener()
1734
    {
1738
    {
1735
        try
1739
        try
Lines 1781-1786 Link Here
1781
					mpUserForm->triggerMethod( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Userform_QueryClose") ),
1785
					mpUserForm->triggerMethod( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Userform_QueryClose") ),
1782
												aParams);
1786
												aParams);
1783
					xVbaMethodParameter->setVbaMethodParameter( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Cancel")), aParams[0]);
1787
					xVbaMethodParameter->setVbaMethodParameter( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Cancel")), aParams[0]);
1788
					aParams[ 0 ] >>= nCancel;
1789
					// if no veto attempt to dispose ( non-modal ) dialogs
1790
					if ( !nCancel )
1791
        					Application::PostUserEvent( LINK( this, FormObjEventListenerImpl, disposeDialog ), NULL ); 
1784
					return;
1792
					return;
1785
	
1793
	
1786
				}			
1794
				}			
Lines 1824-1835 Link Here
1824
        if ( mpUserForm )
1832
        if ( mpUserForm )
1825
            mpUserForm->ResetApiObj();
1833
            mpUserForm->ResetApiObj();
1826
    }
1834
    }
1827
};
1835
};	
1836
1837
IMPL_LINK( FormObjEventListenerImpl, disposeDialog, void*, pParam )
1838
{
1839
	if ( !mbDisposed && mpUserForm  && mpUserForm->pDocObject )
1840
	{
1841
		// see if this is a non modal dialog, modal dialogs normally get disposed ( when endexecute is called )
1842
		// if this is a non-modal dialog then attempt to unload the userform
1843
		SbUnoObject* pUnoObj = PTR_CAST(SbUnoObject,(SbxVariable*)mpUserForm->pDocObject); 
1844
		if ( pUnoObj )
1845
		{
1846
			uno::Reference< script::XInvocation > xInv( pUnoObj->getUnoAny(), uno::UNO_QUERY );
1847
			if ( xInv.is() )
1848
			{
1849
				// Don't handle close window messages from Modal dialogs ( there are handled when endExecute is called )
1850
				sal_Bool bIsModal = sal_True;
1851
				if ( ( xInv->getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("_IsModal") ) ) >>= bIsModal ) && !bIsModal )
1852
						mpUserForm->UnloadImpl();
1853
			}
1854
		}
1855
	}
1856
	return 0;
1857
}
1828
1858
1829
SbUserFormModule::SbUserFormModule( const String& rName, const com::sun::star::script::ModuleInfo& mInfo, bool bIsCompat )
1859
SbUserFormModule::SbUserFormModule( const String& rName, const com::sun::star::script::ModuleInfo& mInfo, bool bIsCompat )
1830
    :SbObjModule( rName, mInfo, bIsCompat ), mbInit( false )
1860
    :SbObjModule( rName, mInfo, bIsCompat ), mbInit( false )
1831
{
1861
{
1832
        m_xModel.set( mInfo.ModuleObject, uno::UNO_QUERY_THROW );
1862
        m_xModel.set( mInfo.ModuleObject, uno::UNO_QUERY_THROW );
1863
}
1864
1865
SbUserFormModule::~SbUserFormModule()
1866
{
1867
	bool bHasDisposed = true;
1868
	FormObjEventListenerImpl* pFormListener = dynamic_cast< FormObjEventListenerImpl* >( m_DialogListener.get() );
1869
	if ( pFormListener )
1870
	{
1871
		bHasDisposed = pFormListener->isDisposed();
1872
		pFormListener->removeListener();
1873
	}
1874
1875
	// Sometime, when the SbUserFormModule is destructed, but the dialog is not disposed, we need to dispose the dialog here.
1876
	// Such as: If the dialog is shown in modeless mode, we can close the document, but the dialog is not closed, so we dispose it.
1877
	if ( m_xDialog.is() && !bHasDisposed )
1878
	{
1879
		try
1880
		{
1881
			uno::Reference< lang::XComponent > xComponent( m_xDialog, uno::UNO_QUERY );
1882
			if ( xComponent.is() )
1883
			{
1884
				xComponent->dispose();
1885
			}
1886
		}
1887
		catch( const uno::Exception& ex )
1888
		{
1889
		}
1890
	}
1891
	m_xDialog = NULL;
1892
	m_DialogListener = NULL;
1893
	pDocObject = NULL;
1833
}
1894
}
1834
1895
1835
void SbUserFormModule::ResetApiObj()
1896
void SbUserFormModule::ResetApiObj()
Lines 1930-1956 Link Here
1930
        InitObject();
1991
        InitObject();
1931
}
1992
}
1932
1993
1933
//liuchen 2009-7-21 change to accmordate VBA's beheavior
1994
// the unload functionality without call and handling for QueryClose
1934
void SbUserFormModule::Unload()
1995
void SbUserFormModule::UnloadImpl()
1935
{
1996
{
1936
    OSL_TRACE("** Unload() ");
1937
1938
	sal_Int8 nCancel = 0;
1939
	sal_Int8 nCloseMode = 1;
1940
1941
	Sequence< Any > aParams;
1942
	aParams.realloc(2);
1943
	aParams[0] <<= nCancel;
1944
	aParams[1] <<= nCloseMode;
1945
1946
	triggerMethod( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Userform_QueryClose") ), aParams);
1947
1948
	aParams[0] >>= nCancel;
1949
	if (nCancel == 1)
1950
	{
1951
		return;
1952
	}
1953
	
1954
    if ( m_xDialog.is() )
1997
    if ( m_xDialog.is() )
1955
    {
1998
    {
1956
		triggerTerminateEvent();
1999
		triggerTerminateEvent();
Lines 1969-1975 Link Here
1969
			bWaitForDispose = pFormListener->isShowing();
2012
			bWaitForDispose = pFormListener->isShowing();
1970
			OSL_TRACE("Showing %d", bWaitForDispose );
2013
			OSL_TRACE("Showing %d", bWaitForDispose );
1971
		}
2014
		}
2015
		// Hold the reference of pDocObject, because call pMeth->Get( aVals) will use this reference, but pDocObject will be set to NULL in the call.
2016
		SbxObjectRef pObjectHold = pDocObject;
1972
		pMeth->Get( aVals);
2017
		pMeth->Get( aVals);
2018
		// Release the reference after call pMeth->Get( aVals);
2019
		pObjectHold = NULL;
1973
                if ( !bWaitForDispose )
2020
                if ( !bWaitForDispose )
1974
                {
2021
                {
1975
                    // we've either already got a dispose or we'er never going to get one 
2022
                    // we've either already got a dispose or we'er never going to get one 
Lines 1977-1982 Link Here
1977
                } // else wait for dispose
2024
                } // else wait for dispose
1978
		OSL_TRACE("UnloadObject completed ( we hope )");
2025
		OSL_TRACE("UnloadObject completed ( we hope )");
1979
	}
2026
	}
2027
}
2028
2029
//liuchen 2009-7-21 change to accmordate VBA's beheavior
2030
void SbUserFormModule::Unload()
2031
{
2032
    OSL_TRACE("** Unload() ");
2033
2034
	sal_Int8 nCancel = 0;
2035
	sal_Int8 nCloseMode = 1;
2036
2037
	Sequence< Any > aParams;
2038
	aParams.realloc(2);
2039
	aParams[0] <<= nCancel;
2040
	aParams[1] <<= nCloseMode;
2041
2042
	triggerMethod( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Userform_QueryClose") ), aParams);
2043
2044
	aParams[0] >>= nCancel;
2045
	if ( nCancel )
2046
		return;
2047
	
2048
    UnloadImpl();
1980
}
2049
}
1981
//liuchen
2050
//liuchen
1982
2051
(-)a/oovbaapi/ooo/vba/msforms/XUserForm.idl (-2 / +2 lines)
Lines 14-20 Link Here
14
 *
14
 *
15
 *    GNU Lesser General Public License Version 2.1
15
 *    GNU Lesser General Public License Version 2.1
16
 *    =============================================
16
 *    =============================================
17
 *    Copyright 2005 by Sun Microsystems, Inc.
17
 *    Copyright 2005, 2010 by Sun Microsystems, Inc.
18
 *    901 San Antonio Road, Palo Alto, CA 94303, USA
18
 *    901 San Antonio Road, Palo Alto, CA 94303, USA
19
 *
19
 *
20
 *    This library is free software; you can redistribute it and/or
20
 *    This library is free software; you can redistribute it and/or
Lines 47-53 Link Here
47
	//interface ::ooo::vba::XHelperInterface;
47
	//interface ::ooo::vba::XHelperInterface;
48
	interface ::com::sun::star::script::XInvocation;
48
	interface ::com::sun::star::script::XInvocation;
49
    [attribute] string Caption;
49
    [attribute] string Caption;
50
    void Show();
50
    void Show( [in] any modal );
51
    void Hide();
51
    void Hide();
52
    void RePaint();
52
    void RePaint();
53
    void UnloadObject();
53
    void UnloadObject();
(-)a/vbahelper/source/msforms/vbauserform.cxx (-17 / +98 lines)
Lines 14-20 Link Here
14
 *
14
 *
15
 *    GNU Lesser General Public License Version 2.1
15
 *    GNU Lesser General Public License Version 2.1
16
 *    =============================================
16
 *    =============================================
17
 *    Copyright 2005 by Sun Microsystems, Inc.
17
 *    Copyright 2005, 2010 by Sun Microsystems, Inc.
18
 *    901 San Antonio Road, Palo Alto, CA 94303, USA
18
 *    901 San Antonio Road, Palo Alto, CA 94303, USA
19
 *
19
 *
20
 *    This library is free software; you can redistribute it and/or
20
 *    This library is free software; you can redistribute it and/or
Lines 36-42 Link Here
36
#include "vbauserform.hxx"
36
#include "vbauserform.hxx"
37
#include <com/sun/star/awt/XControl.hpp>
37
#include <com/sun/star/awt/XControl.hpp>
38
#include <com/sun/star/awt/XControlContainer.hpp>
38
#include <com/sun/star/awt/XControlContainer.hpp>
39
#include <com/sun/star/awt/XTopWindow.hpp>
39
#include <com/sun/star/beans/PropertyConcept.hpp>
40
#include <com/sun/star/beans/PropertyConcept.hpp>
41
#include <vcl/svapp.hxx>
40
#include <basic/sbx.hxx>
42
#include <basic/sbx.hxx>
41
#include <basic/sbstar.hxx>
43
#include <basic/sbstar.hxx>
42
#include <basic/sbmeth.hxx>
44
#include <basic/sbmeth.hxx>
Lines 44-49 Link Here
44
46
45
using namespace ::ooo::vba;
47
using namespace ::ooo::vba;
46
using namespace ::com::sun::star;
48
using namespace ::com::sun::star;
49
50
// backdoor access keys ( note these are names not legal in OLE/IDL )
51
const static rtl::OUString ISMODAL( RTL_CONSTASCII_USTRINGPARAM("_IsModal") );
47
52
48
// some little notes
53
// some little notes
49
// XDialog implementation has the following interesting bits
54
// XDialog implementation has the following interesting bits
Lines 55-61 Link Here
55
//     the models in ControlModels can be accessed by name
60
//     the models in ControlModels can be accessed by name
56
// also the XDialog is a XControl ( to access the model above
61
// also the XDialog is a XControl ( to access the model above
57
62
58
ScVbaUserForm::ScVbaUserForm( uno::Sequence< uno::Any > const& aArgs, uno::Reference< uno::XComponentContext >const& xContext ) throw ( lang::IllegalArgumentException ) :  ScVbaUserForm_BASE( getXSomethingFromArgs< XHelperInterface >( aArgs, 0 ), xContext, getXSomethingFromArgs< uno::XInterface >( aArgs, 1 ), getXSomethingFromArgs< frame::XModel >( aArgs, 2 ), static_cast< ooo::vba::AbstractGeometryAttributes* >(0) ),  mbDispose( true )
63
ScVbaUserForm::ScVbaUserForm( uno::Sequence< uno::Any > const& aArgs, uno::Reference< uno::XComponentContext >const& xContext ) throw ( lang::IllegalArgumentException ) :  ScVbaUserForm_BASE( getXSomethingFromArgs< XHelperInterface >( aArgs, 0 ), xContext, getXSomethingFromArgs< uno::XInterface >( aArgs, 1 ), getXSomethingFromArgs< frame::XModel >( aArgs, 2 ), static_cast< ooo::vba::AbstractGeometryAttributes* >(0) ),  mbDispose( true ), mbModal( false )
59
{
64
{
60
    m_xDialog.set( m_xControl, uno::UNO_QUERY_THROW );
65
    m_xDialog.set( m_xControl, uno::UNO_QUERY_THROW );
61
    uno::Reference< awt::XControl > xControl( m_xDialog, uno::UNO_QUERY_THROW );
66
    uno::Reference< awt::XControl > xControl( m_xDialog, uno::UNO_QUERY_THROW );
Lines 70-95 Link Here
70
}
75
}
71
76
72
void SAL_CALL 
77
void SAL_CALL 
73
ScVbaUserForm::Show(  ) throw (uno::RuntimeException)
78
ScVbaUserForm::Show( const uno::Any& modal ) throw (uno::RuntimeException)
74
{
79
{
75
	OSL_TRACE("ScVbaUserForm::Show(  )");
80
	OSL_TRACE("***** !!!!!! *(************** ScVbaUserForm::Show( new and improved )");
76
	short aRet = 0;
81
77
        mbDispose = true;
82
	sal_Bool isModal = sal_True;
78
	if ( m_xDialog.is() )
83
	// Convert the parameter.
79
		aRet = m_xDialog->execute();
84
	uno::Reference< script::XTypeConverter > xConverter = getTypeConverter( mxContext );
80
	OSL_TRACE("ScVbaUserForm::Show() execute returned %d", aRet);
85
	if ( modal.hasValue() && xConverter.is() )
81
	if ( mbDispose )
82
	{
86
	{
87
		uno::Any aConverted;
83
		try
88
		try
84
		{
89
		{
85
			uno::Reference< lang::XComponent > xComp( m_xDialog, uno::UNO_QUERY_THROW );
90
			aConverted = xConverter->convertTo( modal, getCppuType( (const sal_Bool*) 0 ) );
86
			m_xDialog = NULL;
91
			aConverted >>= isModal;
87
			xComp->dispose();
88
			mbDispose = false; 
89
		}
92
		}
90
		catch( uno::Exception& )
93
		catch( const uno::Exception& ex )
91
		{
94
		{
92
		}
95
		}
96
	}
97
98
	mbDispose = true;
99
	if ( isModal ) // Show the dialog in modal mode.
100
	{
101
		short aRet = 0;		
102
		mbModal = true;
103
		if ( m_xDialog.is() )
104
		{
105
			aRet = m_xDialog->execute();
106
		}
107
		OSL_TRACE("ScVbaUserForm::Show() execute returned %d", aRet);
108
		if ( mbDispose )
109
		{
110
			try
111
			{
112
				uno::Reference< lang::XComponent > xComponent( m_xDialog, uno::UNO_QUERY_THROW );
113
				m_xDialog = NULL;
114
				xComponent->dispose();
115
				mbDispose = false;
116
			}
117
			catch( const uno::Exception& ex )
118
			{
119
			}
120
		}
121
		mbModal = false;
122
	}
123
	else // Show the dialog in modeless mode.
124
	{
125
		mbModal = false;
126
		uno::Reference< awt::XWindow > xWindow( getDialogWindow() );
127
		if ( xWindow.is() )
128
			xWindow->setVisible( sal_True );
93
	}
129
	}
94
}
130
}
95
131
Lines 111-117 Link Here
111
{
147
{
112
	mbDispose = false;  // hide not dispose
148
	mbDispose = false;  // hide not dispose
113
	if ( m_xDialog.is() )
149
	if ( m_xDialog.is() )
114
		m_xDialog->endExecute();
150
	{
151
		if ( mbModal ) // Hide the Modal Dialog.
152
		{
153
			m_xDialog->endExecute();
154
		}
155
		else // Hide the Modeless Dialog.
156
		{
157
			uno::Reference< awt::XWindow > xWindow ( getDialogWindow() );
158
			if ( xWindow.is() )
159
				xWindow->setVisible( sal_False );
160
		}
161
	}
162
}
163
164
uno::Reference< awt::XWindow > 
165
ScVbaUserForm::getDialogWindow()
166
{
167
    uno::Reference< awt::XWindow > xWindow;
168
    uno::Reference< awt::XControl > xCntrl( m_xDialog, uno::UNO_QUERY );
169
    if ( xCntrl.is() )
170
       xWindow.set( xCntrl->getPeer(), uno::UNO_QUERY );
171
    return xWindow;
115
}
172
}
116
173
117
void SAL_CALL 
174
void SAL_CALL 
Lines 125-131 Link Here
125
{
182
{
126
	mbDispose = true;
183
	mbDispose = true;
127
	if ( m_xDialog.is() )
184
	if ( m_xDialog.is() )
128
		m_xDialog->endExecute();
185
	{
186
		if ( mbModal ) // End the Modal Dialog.
187
		{
188
			m_xDialog->endExecute();
189
		}
190
		else // Hide the Modeless Dialog and dispose it.
191
		{
192
			uno::Reference< awt::XWindow > xWindow( getDialogWindow() );
193
			if ( xWindow.is() )
194
				xWindow->setVisible( sal_False );
195
			try
196
			{
197
				uno::Reference< lang::XComponent > xComponent( m_xDialog, uno::UNO_QUERY_THROW );
198
				xComponent->dispose();
199
			}
200
			catch( const uno::Exception& ex )
201
			{
202
			}
203
			m_xDialog = NULL;
204
		}
205
	}
129
}
206
}
130
207
131
rtl::OUString& 
208
rtl::OUString& 
Lines 177-182 Link Here
177
uno::Any SAL_CALL 
254
uno::Any SAL_CALL 
178
ScVbaUserForm::getValue( const ::rtl::OUString& aPropertyName ) throw (beans::UnknownPropertyException, uno::RuntimeException)
255
ScVbaUserForm::getValue( const ::rtl::OUString& aPropertyName ) throw (beans::UnknownPropertyException, uno::RuntimeException)
179
{
256
{
257
	// Some back door access to allow basic runtime to query various states
258
	if ( aPropertyName.equals( ISMODAL ) )
259
		return uno::makeAny( mbModal );
260
 
180
	uno::Reference< awt::XControl > xDialogControl( m_xDialog, uno::UNO_QUERY_THROW );
261
	uno::Reference< awt::XControl > xDialogControl( m_xDialog, uno::UNO_QUERY_THROW );
181
	uno::Reference< awt::XControlContainer > xContainer( m_xDialog, uno::UNO_QUERY_THROW );
262
	uno::Reference< awt::XControlContainer > xContainer( m_xDialog, uno::UNO_QUERY_THROW );
182
	uno::Reference< awt::XControl > xControl = xContainer->getControl( aPropertyName );
263
	uno::Reference< awt::XControl > xControl = xContainer->getControl( aPropertyName );
(-)a/vbahelper/source/msforms/vbauserform.hxx (-2 / +5 lines)
Lines 14-20 Link Here
14
 *
14
 *
15
 *    GNU Lesser General Public License Version 2.1
15
 *    GNU Lesser General Public License Version 2.1
16
 *    =============================================
16
 *    =============================================
17
 *    Copyright 2005 by Sun Microsystems, Inc.
17
 *    Copyright 2005, 2010 by Sun Microsystems, Inc.
18
 *    901 San Antonio Road, Palo Alto, CA 94303, USA
18
 *    901 San Antonio Road, Palo Alto, CA 94303, USA
19
 *
19
 *
20
 *    This library is free software; you can redistribute it and/or
20
 *    This library is free software; you can redistribute it and/or
Lines 51-64 Link Here
51
private:
51
private:
52
    css::uno::Reference< css::awt::XDialog > m_xDialog;
52
    css::uno::Reference< css::awt::XDialog > m_xDialog;
53
    bool mbDispose;
53
    bool mbDispose;
54
    bool mbModal;
54
    rtl::OUString m_sLibName;
55
    rtl::OUString m_sLibName;
56
    css::uno::Reference< css::awt::XWindow > getDialogWindow();
55
protected:
57
protected:
56
public:
58
public:
57
    ScVbaUserForm( css::uno::Sequence< css::uno::Any > const& aArgs, css::uno::Reference< css::uno::XComponentContext >const& xContext ) throw ( css::lang::IllegalArgumentException );
59
    ScVbaUserForm( css::uno::Sequence< css::uno::Any > const& aArgs, css::uno::Reference< css::uno::XComponentContext >const& xContext ) throw ( css::lang::IllegalArgumentException );
58
    virtual ~ScVbaUserForm();
60
    virtual ~ScVbaUserForm();
61
59
    // XUserForm
62
    // XUserForm
60
    virtual void SAL_CALL RePaint(  ) throw (css::uno::RuntimeException);
63
    virtual void SAL_CALL RePaint(  ) throw (css::uno::RuntimeException);
61
    virtual void SAL_CALL Show(  ) throw (css::uno::RuntimeException);
64
    virtual void SAL_CALL Show( const css::uno::Any& modal ) throw (css::uno::RuntimeException);
62
    // XIntrospection
65
    // XIntrospection
63
    virtual css::uno::Reference< css::beans::XIntrospectionAccess > SAL_CALL getIntrospection(  ) throw (css::uno::RuntimeException);
66
    virtual css::uno::Reference< css::beans::XIntrospectionAccess > SAL_CALL getIntrospection(  ) throw (css::uno::RuntimeException);
64
    virtual css::uno::Any SAL_CALL invoke( const ::rtl::OUString& aFunctionName, const css::uno::Sequence< css::uno::Any >& aParams, css::uno::Sequence< ::sal_Int16 >& aOutParamIndex, css::uno::Sequence< css::uno::Any >& aOutParam ) throw (css::lang::IllegalArgumentException, css::script::CannotConvertException, css::reflection::InvocationTargetException, css::uno::RuntimeException);
67
    virtual css::uno::Any SAL_CALL invoke( const ::rtl::OUString& aFunctionName, const css::uno::Sequence< css::uno::Any >& aParams, css::uno::Sequence< ::sal_Int16 >& aOutParamIndex, css::uno::Sequence< css::uno::Any >& aOutParam ) throw (css::lang::IllegalArgumentException, css::script::CannotConvertException, css::reflection::InvocationTargetException, css::uno::RuntimeException);
(-)a/vcl/source/window/dialog.cxx (-1 / +1 lines)
Lines 553-559 Link Here
553
	//liuchen 2009-7-22, support Excel VBA UserForm_QueryClose event
553
	//liuchen 2009-7-22, support Excel VBA UserForm_QueryClose event
554
	mnCancelClose = 0;
554
	mnCancelClose = 0;
555
	ImplCallEventListeners( VCLEVENT_WINDOW_CLOSE );	
555
	ImplCallEventListeners( VCLEVENT_WINDOW_CLOSE );	
556
	if (mnCancelClose == 1)
556
	if ( mnCancelClose != 0 )
557
	{
557
	{
558
		return FALSE;
558
		return FALSE;
559
	}
559
	}

Return to issue 108895