summaryrefslogtreecommitdiff
path: root/vbahelper/source/msforms/vbatextbox.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'vbahelper/source/msforms/vbatextbox.cxx')
-rw-r--r--vbahelper/source/msforms/vbatextbox.cxx16
1 files changed, 12 insertions, 4 deletions
diff --git a/vbahelper/source/msforms/vbatextbox.cxx b/vbahelper/source/msforms/vbatextbox.cxx
index 730f24c961..be6e3489cb 100644
--- a/vbahelper/source/msforms/vbatextbox.cxx
+++ b/vbahelper/source/msforms/vbatextbox.cxx
@@ -67,13 +67,20 @@ ScVbaTextBox::getText() throw (css::uno::RuntimeException)
void SAL_CALL
ScVbaTextBox::setText( const rtl::OUString& _text ) throw (css::uno::RuntimeException)
{
+ rtl::OUString sOldText = getText();
+
if ( !mbDialog )
{
- uno::Reference< text::XTextRange > xTextRange( m_xProps, uno::UNO_QUERY_THROW );
- xTextRange->setString( _text );
-}
+ uno::Reference< text::XTextRange > xTextRange( m_xProps, uno::UNO_QUERY_THROW );
+ xTextRange->setString( _text );
+ }
else
m_xProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Text") ), uno::makeAny( _text ) );
+
+ if ( _text != sOldText )
+ {
+ fireChangeEvent();
+ }
}
sal_Int32 SAL_CALL
@@ -90,7 +97,8 @@ ScVbaTextBox::getMaxLength() throw (css::uno::RuntimeException)
void SAL_CALL
ScVbaTextBox::setMaxLength( sal_Int32 _maxlength ) throw (css::uno::RuntimeException)
{
- uno::Any aValue( _maxlength );
+ sal_Int16 _maxlength16 = static_cast<sal_Int16> (_maxlength); //liuchen 2009-7-24, resolve the problem that MaxLength cannot be set correctly
+ uno::Any aValue( _maxlength16 ); //liuchen 2009-7-24, resolve the problem that MaxLength cannot be set correctly
m_xProps->setPropertyValue
(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MaxTextLen" ) ), aValue);
}