diff -r 1367103c24e2 -r 696bfeff199e mobilemessaging/smsui/viewersrc/MsgSmsViewerAppUi.cpp --- a/mobilemessaging/smsui/viewersrc/MsgSmsViewerAppUi.cpp Mon Jun 21 15:36:19 2010 +0300 +++ b/mobilemessaging/smsui/viewersrc/MsgSmsViewerAppUi.cpp Thu Jul 15 18:34:37 2010 +0300 @@ -36,6 +36,7 @@ #include // CMsgBioControl #include // CGmsWrapper #include +#include // messaging #include // CSmsHeader #include // CSmsClientMtm @@ -979,7 +980,8 @@ CMsgAddressControl* address = static_cast( iView->ControlById( EMsgComponentIdFrom ) ); - if ( address && address->Editor().SelectionLength() ) + if ( address && address->Editor().SelectionLength() + == address->Editor().TextLength() ) { senderHighlighted = ETrue; } @@ -1105,7 +1107,8 @@ CMsgAddressControl* address = static_cast( iView->ControlById( EMsgComponentIdFrom ) ); - if ( address && address->Editor().SelectionLength() ) + if ( address && address->Editor().SelectionLength() + == address->Editor().TextLength() ) { senderHighlighted = ETrue; } @@ -1614,39 +1617,40 @@ } case EKeyDevice3: case EKeyEnter: - { - if( iView->FocusedControl()->ControlType() == EMsgAddressControl ) + { + CMsgExpandableControl* ctrl = NULL; + TBool checkHighlight = EFalse; + + if( iView->FocusedControl() ) { - CMsgAddressControl* address = static_cast( - iView->FocusedControl() ); - if ( address && !address->Editor().SelectionLength() ) + ctrl = static_cast( iView->FocusedControl() ); + if ( ctrl->ControlType() == EMsgAddressControl + && !ctrl->Editor().SelectionLength() ) { - // restore highlight to address field - return address->Editor().OfferKeyEventL( aKeyEvent, aType ); - } - } - else if ( iView->FocusedControl()->ControlType() == EMsgBodyControl ) - { - CItemFinder* itemFinder = iView->ItemFinder(); - if ( FocusedControlId() == EMsgComponentIdBody - && itemFinder ) - { - if ( !itemFinder->CurrentSelection().Length() ) - { - CMsgBodyControl* body = static_cast( - iView->FocusedControl() ); - if ( body ) - { - // restore highlight to current itemfinder item - return body->Editor().OfferKeyEventL( aKeyEvent, aType ); - } + checkHighlight = ETrue; + } + else if ( ctrl->ControlType() == EMsgBodyControl ) + { + CItemFinder* itemFinder = iView->ItemFinder(); + if ( FocusedControlId() == EMsgComponentIdBody && itemFinder + && !itemFinder->CurrentSelection().Length() ) + { + checkHighlight = ETrue; } } } - // fall through - } - case EMsgFindItemKeyEvent: - { + if ( ctrl && checkHighlight ) + { + // Check if highlight needs to be restored to editor, + // address/body editor offerkeyevent will handle it + if ( ctrl->Editor().OfferKeyEventL( aKeyEvent, aType ) + == EKeyWasConsumed ) + { + // Highlight was restored, just return, no cs menu needed + return EKeyWasConsumed; + } + } + // Selection-key checking (Context sensitive menu) // (with Class 0 just show the menu) if ( !iClass0CBA )