diff options
-rw-r--r-- | svtools/source/dialogs/PlaceEditDialog.cxx | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/svtools/source/dialogs/PlaceEditDialog.cxx b/svtools/source/dialogs/PlaceEditDialog.cxx index cb90be7412d3..125a8173add1 100644 --- a/svtools/source/dialogs/PlaceEditDialog.cxx +++ b/svtools/source/dialogs/PlaceEditDialog.cxx @@ -198,7 +198,13 @@ void PlaceEditDialog::UpdateLabel( ) if( !m_pEDUsername->GetText().isEmpty( ) ) { OUString sLabel = SvtResId( STR_SVT_DEFAULT_SERVICE_LABEL ); - sLabel = sLabel.replaceFirst( "$user$", m_pEDUsername->GetText() ); + OUString sUser = m_pEDUsername->GetText(); + + int nLength = sUser.indexOf( '@' ); + if( nLength < 0 ) + nLength = sUser.getLength(); + + sLabel = sLabel.replaceFirst( "$user$", sUser.copy( 0, nLength ) ); sLabel = sLabel.replaceFirst( "$service$", m_pLBServerType->GetSelectEntry() ); m_pEDServerName->SetText( sLabel ); |