diff options
-rw-r--r-- | svtools/source/inc/unoiface.hxx | 8 | ||||
-rw-r--r-- | svtools/source/uno/unoiface.cxx | 54 |
2 files changed, 30 insertions, 32 deletions
diff --git a/svtools/source/inc/unoiface.hxx b/svtools/source/inc/unoiface.hxx index c3096038a392..b2b13dbc4c80 100644 --- a/svtools/source/inc/unoiface.hxx +++ b/svtools/source/inc/unoiface.hxx @@ -2,9 +2,9 @@ * * $RCSfile: unoiface.hxx,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: sb $ $Date: 2002-07-23 12:51:24 $ + * last change: $Author: mt $ $Date: 2002-11-15 11:41:24 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -94,14 +94,12 @@ private: TextListenerMultiplexer maTextListeners; protected: - DECL_LINK( ModifyHdl, MultiLineEdit* ); + void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ); public: VCLXMultiLineEdit(); ~VCLXMultiLineEdit(); - void SetWindow( Window* pWindow ); - // ::com::sun::star::uno::XInterface ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); void SAL_CALL acquire() throw() { VCLXWindow::acquire(); } diff --git a/svtools/source/uno/unoiface.cxx b/svtools/source/uno/unoiface.cxx index fb8838e6c20c..8e87648c25de 100644 --- a/svtools/source/uno/unoiface.cxx +++ b/svtools/source/uno/unoiface.cxx @@ -2,9 +2,9 @@ * * $RCSfile: unoiface.cxx,v $ * - * $Revision: 1.8 $ + * $Revision: 1.9 $ * - * last change: $Author: fs $ $Date: 2001-06-19 12:07:42 $ + * last change: $Author: mt $ $Date: 2002-11-15 11:41:47 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -201,9 +201,6 @@ VCLXMultiLineEdit::VCLXMultiLineEdit() : maTextListeners( *this ) VCLXMultiLineEdit::~VCLXMultiLineEdit() { - MultiLineEdit* pEdit = (MultiLineEdit*) GetWindow(); - if ( pEdit ) - pEdit->SetModifyHdl( Link() ); } ::com::sun::star::uno::Any VCLXMultiLineEdit::queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) @@ -224,21 +221,6 @@ IMPL_XTYPEPROVIDER_START( VCLXMultiLineEdit ) VCLXWindow::getTypes() IMPL_XTYPEPROVIDER_END -void VCLXMultiLineEdit::SetWindow( Window* pWindow ) -{ - ::vos::OGuard aGuard( GetMutex() ); - - MultiLineEdit* pPrevMultiLineEdit = (MultiLineEdit*) GetWindow(); - if ( pPrevMultiLineEdit ) - pPrevMultiLineEdit->SetModifyHdl( Link() ); - - MultiLineEdit* pNewMultiLineEdit = (MultiLineEdit*) pWindow; - if ( pNewMultiLineEdit ) - pNewMultiLineEdit->SetModifyHdl( LINK( this, VCLXMultiLineEdit, ModifyHdl ) ); - - VCLXWindow::SetWindow( pWindow ); -} - void VCLXMultiLineEdit::addTextListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTextListener > & l ) throw(::com::sun::star::uno::RuntimeException) { maTextListeners.addInterface( l ); @@ -260,7 +242,12 @@ void VCLXMultiLineEdit::setText( const ::rtl::OUString& aText ) throw(::com::sun // In JAVA wird auch ein textChanged ausgeloest, in VCL nicht. // ::com::sun::star::awt::Toolkit soll JAVA-komform sein... - ModifyHdl( NULL ); + if ( maTextListeners.getLength() ) + { + ::com::sun::star::awt::TextEvent aEvent; + aEvent.Source = (::cppu::OWeakObject*)this; + maTextListeners.textChanged( aEvent ); + } } } @@ -422,13 +409,26 @@ void VCLXMultiLineEdit::getColumnsAndLines( sal_Int16& nCols, sal_Int16& nLines } } -IMPL_LINK( VCLXMultiLineEdit, ModifyHdl, MultiLineEdit*, EMPTYARG ) +void VCLXMultiLineEdit::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) { - ::com::sun::star::awt::TextEvent aEvent; - aEvent.Source = (::cppu::OWeakObject*)this; - maTextListeners.textChanged( aEvent ); - - return 1; + switch ( rVclWindowEvent.GetId() ) + { + case VCLEVENT_EDIT_MODIFY: + { + if ( maTextListeners.getLength() ) + { + ::com::sun::star::awt::TextEvent aEvent; + aEvent.Source = (::cppu::OWeakObject*)this; + maTextListeners.textChanged( aEvent ); + } + } + break; + default: + { + VCLXWindow::ProcessWindowEvent( rVclWindowEvent ); + } + break; + } } void VCLXMultiLineEdit::setProperty( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Any& Value) throw(::com::sun::star::uno::RuntimeException) |