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 /toolkit/source | |
parent | 27fa0410210f429e3347a4bcc9fb0fc4bc5d0a3d (diff) |
#96986# UnoEditControl must use XTextComponent::setText to update peer with text property, otherwise listeners are not called
Diffstat (limited to 'toolkit/source')
-rw-r--r-- | toolkit/source/controls/unocontrols.cxx | 26 |
1 files changed, 23 insertions, 3 deletions
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 ); } |