diff options
author | Mathias Bauer <mba@openoffice.org> | 2009-11-23 17:39:22 +0100 |
---|---|---|
committer | Mathias Bauer <mba@openoffice.org> | 2009-11-23 17:39:22 +0100 |
commit | 9edc763c5ec6d909a8080d30b5ab029c8d0779ba (patch) | |
tree | 07b94867f33b51218bc177a1de445254fe56152d /sfx2/source/dialog/passwd.cxx | |
parent | a4d4ea40f2e8b5a3b3ea469bfa36104d751b6d96 (diff) | |
parent | b4083630cb439a9f54340db6840e8bc6cfcc42c8 (diff) |
merge commit for m65
Diffstat (limited to 'sfx2/source/dialog/passwd.cxx')
-rw-r--r-- | sfx2/source/dialog/passwd.cxx | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/sfx2/source/dialog/passwd.cxx b/sfx2/source/dialog/passwd.cxx index cbe47d39b704..981657d476fa 100644 --- a/sfx2/source/dialog/passwd.cxx +++ b/sfx2/source/dialog/passwd.cxx @@ -43,10 +43,35 @@ #include "dialog.hrc" #include "passwd.hrc" +#include "vcl/sound.hxx" + // ----------------------------------------------------------------------- IMPL_LINK_INLINE_START( SfxPasswordDialog, EditModifyHdl, Edit *, EMPTYARG ) { + if( mbAsciiOnly ) + { + rtl::OUString aTest( maPasswordED.GetText() ); + const sal_Unicode* pTest = aTest.getStr(); + sal_Int32 nLen = aTest.getLength(); + rtl::OUStringBuffer aFilter( nLen ); + bool bReset = false; + for( sal_Int32 i = 0; i < nLen; i++ ) + { + if( *pTest > 0x007f ) + bReset = true; + else + aFilter.append( *pTest ); + pTest++; + } + if( bReset ) + { + Sound::Beep( SOUND_ERROR ); + maPasswordED.SetSelection( Selection( 0, nLen ) ); + maPasswordED.ReplaceSelected( aFilter.makeStringAndClear() ); + } + + } maOKBtn.Enable( maPasswordED.GetText().Len() >= mnMinLen ); return 0; } @@ -88,7 +113,8 @@ SfxPasswordDialog::SfxPasswordDialog( Window* pParent, const String* pGroupText maConfirmStr ( SfxResId( STR_PASSWD_CONFIRM ) ), mnMinLen ( 5 ), - mnExtras ( 0 ) + mnExtras ( 0 ), + mbAsciiOnly ( false ) { FreeResource(); |