diff -r e30d4a1b8bad -r c26cc2a7c548 phoneuis/dialer/src/cdialernumberentry.cpp --- a/phoneuis/dialer/src/cdialernumberentry.cpp Wed Sep 15 12:12:21 2010 +0300 +++ b/phoneuis/dialer/src/cdialernumberentry.cpp Wed Oct 13 14:31:22 2010 +0300 @@ -25,16 +25,15 @@ #include #include // CEikImage #include // TResourceReader -#include #include #include #include #include #include #include -#include +#include #include -#include +#include #include #include #include @@ -51,8 +50,6 @@ const TInt KNumberEntryControlCount = 2; // = number entry, label _LIT( KPhoneValidChars, "0123456789*#+pwPW" ); -_LIT( KPhoneVanityValidChars, "0123456789*#+pwABCDEFGHIJKLMNOPQRSTUVWXYZ" ); - const TInt KKeyCtrlA( 1 ); const TInt KKeyCtrlC( 3 ); const TInt KKeyCtrlV( 22 ); @@ -192,10 +189,9 @@ { DoSetFocus( aFocus, aDrawNow ); } - DIALER_PRINT("numberentry::SetFocus>"); } - + // --------------------------------------------------------------------------- // CDialerNumberEntry::SetLateFocus // --------------------------------------------------------------------------- @@ -231,7 +227,7 @@ iEditor->SetFocus( aFocus ); } - // Don't allow usage of late focuser until next layout change or Dialer launch + // Don't allow usage of late focuser until next layout change iLateFocuserCanBeUsed = EFalse; DIALER_PRINT("numberentry::DoSetFocus>"); @@ -581,7 +577,7 @@ HandleEditorFormatting(); iEditor->DrawDeferred(); - + // Allow usage of late focuser iLateFocuserCanBeUsed = ETrue; } @@ -958,40 +954,22 @@ // ----------------------------------------------------------------------------- // CDialerNumberEntry::Validate +// +// Copied from cphonekeys. // ----------------------------------------------------------------------------- // TBool CDialerNumberEntry::Validate( const TDesC& aString ) { DIALER_PRINT("numberentry::Validate"); - - if ( aString.Length() == 0 ) + TLex input( aString ); + TPtrC valid( KPhoneValidChars ); + + while ( valid.Locate( input.Peek() ) != KErrNotFound ) { - return EFalse; - } - - // check first character - TPtrC valid( KPhoneValidChars ); - if ( valid.Locate( aString[0] ) == KErrNotFound ) - { - return EFalse; + input.Inc(); } - // if vanitydialing feature is enabled, also capital A-Z are accepted after first character - if ( FeatureManager::FeatureSupported( KFeatureIdFfHomeScreenVanityDialing ) ) - { - valid.Set( KPhoneVanityValidChars ); - } - - // check rest of the string - for ( TInt i = 1; i < aString.Length(); i++ ) - { - if ( valid.Locate( aString[i] ) == KErrNotFound ) - { - return EFalse; - } - } - - return ETrue; + return !input.Remainder().Length(); } // End of File