diff options
author | Malte Timmermann <mt@openoffice.org> | 2002-09-05 07:54:42 +0000 |
---|---|---|
committer | Malte Timmermann <mt@openoffice.org> | 2002-09-05 07:54:42 +0000 |
commit | 339eda00addce58dfc3d935772900c3a8c86072a (patch) | |
tree | d0966901d08108632ea4191430b2cc844ca73a12 | |
parent | 27fa0410210f429e3347a4bcc9fb0fc4bc5d0a3d (diff) |
#96986# UnoEditControl must use XTextComponent::setText to update peer with text property, otherwise listeners are not called
-rw-r--r-- | toolkit/inc/toolkit/controls/unocontrols.hxx | 6 | ||||
-rw-r--r-- | toolkit/source/controls/unocontrols.cxx | 26 |
2 files changed, 27 insertions, 5 deletions
diff --git a/toolkit/inc/toolkit/controls/unocontrols.hxx b/toolkit/inc/toolkit/controls/unocontrols.hxx index 5f3ed99c5d67..68786a30e9eb 100644 --- a/toolkit/inc/toolkit/controls/unocontrols.hxx +++ b/toolkit/inc/toolkit/controls/unocontrols.hxx @@ -2,9 +2,9 @@ * * $RCSfile: unocontrols.hxx,v $ * - * $Revision: 1.26 $ + * $Revision: 1.27 $ * - * last change: $Author: mt $ $Date: 2002-09-05 07:37:05 $ + * last change: $Author: mt $ $Date: 2002-09-05 08:51:42 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -359,6 +359,8 @@ public: ::rtl::OUString GetComponentServiceName(); TextListenerMultiplexer& GetTextListeners() { return maTextListeners; } + void ImplSetPeerProperty( const ::rtl::OUString& rPropName, const ::com::sun::star::uno::Any& rVal ); + ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return UnoControlBase::queryInterface(rType); } ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); void SAL_CALL acquire() throw() { OWeakAggObject::acquire(); } diff --git a/toolkit/source/controls/unocontrols.cxx b/toolkit/source/controls/unocontrols.cxx index 1fcd5244955b..ee73d4e6469f 100644 --- a/toolkit/source/controls/unocontrols.cxx +++ b/toolkit/source/controls/unocontrols.cxx @@ -2,9 +2,9 @@ * * $RCSfile: unocontrols.cxx,v $ * - * $Revision: 1.56 $ + * $Revision: 1.57 $ * - * last change: $Author: mt $ $Date: 2002-09-05 07:53:00 $ + * last change: $Author: mt $ $Date: 2002-09-05 08:54:42 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1032,6 +1032,26 @@ UnoEditControl::UnoEditControl() return aName; } +void UnoEditControl::ImplSetPeerProperty( const ::rtl::OUString& rPropName, const uno::Any& rVal ) +{ + sal_Bool bDone = sal_False; + if ( mxPeer.is() && ( GetPropertyId( rPropName ) == BASEPROPERTY_TEXT ) ) + { + // #96986# use setText(), or text listener will not be called. + uno::Reference < awt::XTextComponent > xTextComponent( mxPeer, uno::UNO_QUERY ); + if ( xTextComponent.is() ) + { + ::rtl::OUString aText; + rVal >>= aText; + xTextComponent->setText( aText ); + bDone = sal_True; + } + } + + if ( !bDone ) + UnoControlBase::ImplSetPeerProperty( rPropName, rVal ); +} + // uno::XInterface uno::Any UnoEditControl::queryAggregation( const uno::Type & rType ) throw(uno::RuntimeException) { @@ -4244,7 +4264,7 @@ void UnoPatternFieldControl::ImplSetPeerProperty( const ::rtl::OUString& rPropNa } } else - UnoControl::ImplSetPeerProperty( rPropName, rVal ); + UnoSpinFieldControl::ImplSetPeerProperty( rPropName, rVal ); } |