diff options
Diffstat (limited to 'accessibility')
-rw-r--r-- | accessibility/source/standard/vclxaccessibleedit.cxx | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/accessibility/source/standard/vclxaccessibleedit.cxx b/accessibility/source/standard/vclxaccessibleedit.cxx index 005ddac8e4d6..4a85ab8797f1 100644 --- a/accessibility/source/standard/vclxaccessibleedit.cxx +++ b/accessibility/source/standard/vclxaccessibleedit.cxx @@ -592,16 +592,18 @@ sal_Bool VCLXAccessibleEdit::setText( const OUString& sText ) { OExternalLockGuard aGuard( this ); - bool bSuccess = false; - try - { - bSuccess = replaceText( 0, implGetText().getLength(), sText ); - } - catch( const IndexOutOfBoundsException& ) + bool bReturn = false; + + VCLXEdit* pVCLXEdit = static_cast< VCLXEdit* >( GetVCLXWindow() ); + if ( pVCLXEdit && pVCLXEdit->isEditable() ) { - OSL_FAIL( "VCLXAccessibleText::setText: caught an exception!" ); + pVCLXEdit->setText( sText ); + sal_Int32 nSize = sText.getLength(); + pVCLXEdit->setSelection( awt::Selection( nSize, nSize ) ); + bReturn = true; } - return bSuccess; + + return bReturn; } |