diff options
author | Szymon Kłos <eszkadev@gmail.com> | 2015-07-21 12:35:19 +0200 |
---|---|---|
committer | Szymon Kłos <eszkadev@gmail.com> | 2015-07-24 12:28:55 +0200 |
commit | 52ead2fbca3e6f6274fe34d1c0b13e46c4e5b8e1 (patch) | |
tree | 8f84539635669e78551d477c26309eaa5c7b620e /svtools | |
parent | 9051f255080a2f04af30bdaef39ee7d684e6b8d9 (diff) |
don't take full email address as a username
Change-Id: Ibc8f951dc3281b0b1d0f4b6783af0dbe2fb75da0
Diffstat (limited to 'svtools')
-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 ); |