diff -r a1caeb42b3a3 -r fcdfafb36fe7 uifw/AvKon/src/AknPhoneNumberEditor.cpp --- a/uifw/AvKon/src/AknPhoneNumberEditor.cpp Thu Jul 15 18:56:19 2010 +0300 +++ b/uifw/AvKon/src/AknPhoneNumberEditor.cpp Thu Aug 19 10:11:06 2010 +0300 @@ -375,7 +375,7 @@ } if ( cousorChanged ) { - ReportAknEdStateEventL( MAknEdStateObserver::EAknCursorPositionChanged ); + ReportAknEdStateEvent( MAknEdStateObserver::EAknCursorPositionChanged ); } // see if we want to remember the old cursor X position if ( targetPosUsed ) @@ -421,7 +421,7 @@ } if ( ! IsFocused() ) { - TRAP_IGNORE( ReportAknEdStateEventL( MAknEdStateObserver::EAknSyncEdwinState ) ); + ReportAknEdStateEvent( MAknEdStateObserver::EAknSyncEdwinState ); } if ( aDrawNow ) DrawNow(); @@ -500,7 +500,7 @@ { iModel->SetRealCursorPosition(aCursorPos); iModel->SetAnchorPosition( aAnchorPos ); - ReportAknEdStateEventL( + ReportAknEdStateEvent( MAknEdStateObserver::EAknCursorPositionChanged ); } @@ -510,7 +510,7 @@ iModel->SetRealCursorPosition( aCursorPos ); if ( aSelect ) iModel->SetAnchorPosition( anchor ); - ReportAknEdStateEventL( + ReportAknEdStateEvent( MAknEdStateObserver::EAknCursorPositionChanged ); } @@ -644,7 +644,7 @@ iModel->SetRealCursorPosition( iModel->Uncompensate( aCursorSelection.iCursorPos ) ); iModel->SetAnchorPosition( iModel->Uncompensate( aCursorSelection.iAnchorPos ) ); - ReportAknEdStateEventL( + ReportAknEdStateEvent( MAknEdStateObserver::EAknCursorPositionChanged ); DrawNow(); } @@ -1126,6 +1126,19 @@ // EXPORT_C void CAknPhoneNumberEditor::CcpuPasteL() { + // When we paste the buffer to phone number editor, we must get the buffer from clipboard first + // and then insert buffer to phone number editor. As the main job of CcpuCanPaste() is getting and + // checking the buffer in clipboard, so we must call CcpuCanPaste() first. + // If iExtension->iPasteText is not NULL, it means CcpuCanPaste() has been called before and the + // buffer in clipboard is valid. No need to call it once again. + if ( !iExtension->iPasteText ) + { + // If the return value of CcpuCanPaste is EFalse, iExtension->iPasteText must be NULL, + // else if the return value of CcpuCanPaste is ETure, iExtension->iPasteText must not be NULL. + // So we don't need to check if the return value is ETure or EFalse, + // we will check iExtension->iPasteText instead of that. + CcpuCanPaste(); + } if ( iExtension->iPasteText ) { iModel->Paste( iExtension->iPasteText->Des() ); @@ -1253,8 +1266,8 @@ TUint cap = iExtension->iExtendedInputCapabilities->Capabilities(); cap &= ~CAknExtendedInputCapabilities::EInputEditorDisableVKB; iExtension->iExtendedInputCapabilities->SetCapabilities( cap ); - TRAP_IGNORE( ReportAknEdStateEventL( - MAknEdStateObserver::EAknActivatePenInputRequest ) ); + ReportAknEdStateEvent( + MAknEdStateObserver::EAknActivatePenInputRequest ); } // -------------------------------------------------------------------------- @@ -1266,14 +1279,14 @@ TUint cap = iExtension->iExtendedInputCapabilities->Capabilities(); cap |= CAknExtendedInputCapabilities::EInputEditorDisableVKB; iExtension->iExtendedInputCapabilities->SetCapabilities( cap ); - ReportAknEdStateEventL( MAknEdStateObserver::EAknClosePenInputRequest ); + ReportAknEdStateEvent( MAknEdStateObserver::EAknClosePenInputRequest ); } // -------------------------------------------------------------------------- // CAknPhoneNumberEditor::ReportAknEdStateEventL // -------------------------------------------------------------------------- // -void CAknPhoneNumberEditor::ReportAknEdStateEventL( +void CAknPhoneNumberEditor::ReportAknEdStateEvent( MAknEdStateObserver::EAknEdwinStateEvent aStateEvent ) { CAknEdwinState* edwinState = STATIC_CAST( CAknEdwinState*,State(KNullUid) );