diff -r 968773a0b6ef -r c8382f7b54ef emailuis/emailui/src/FreestyleEmailUiUtilities.cpp --- a/emailuis/emailui/src/FreestyleEmailUiUtilities.cpp Tue Sep 14 20:48:24 2010 +0300 +++ b/emailuis/emailui/src/FreestyleEmailUiUtilities.cpp Wed Sep 15 11:52:37 2010 +0300 @@ -799,19 +799,29 @@ { FUNC_LOG; CFreestyleEmailUiAppUi* appUi = (CFreestyleEmailUiAppUi*)CCoeEnv::Static()->AppUi(); - CFSMailMessage* mailMessage = appUi->GetMailClient()->GetMessageByUidL( + CFSMailMessage* message = appUi->GetMailClient()->GetMessageByUidL( aAttachmentPart.iMailBoxId, aAttachmentPart.iFolderId, aAttachmentPart.iMessageId, EFSMsgDataStructure ); - CleanupStack::PushL( mailMessage ); - CFSMailMessagePart* messagePart = mailMessage->ChildPartL( - aAttachmentPart.iMessagePartId ); + CleanupStack::PushL( message ); + CFSMailMessagePart* messagePart = NULL; + if ( message ) + { + messagePart = message->ChildPartL( aAttachmentPart.iMessagePartId ); + } CleanupStack::PushL( messagePart ); - OpenAttachmentL( *messagePart ); + if ( messagePart ) + { + OpenAttachmentL( *messagePart ); + } + else + { + User::Leave( KErrNotFound ); + } CleanupStack::PopAndDestroy( messagePart ); - CleanupStack::PopAndDestroy( mailMessage ); + CleanupStack::PopAndDestroy( message ); } // ----------------------------------------------------------------------------- @@ -822,8 +832,8 @@ { FUNC_LOG; const TDesC& attName = aAttachmentPart.AttachmentNameL(); - const TDesC* mimeType16 = &aAttachmentPart.GetContentType(); - TFileType fileType = GetFileType( attName, *mimeType16 ); + const TDesC& mimeType16 = aAttachmentPart.GetContentType(); + TFileType fileType = GetFileType( attName, mimeType16 ); // Check if attachment is actually an embedded message object. In that case we try to // open it using mail viewer. @@ -3115,6 +3125,63 @@ return isChineseSearchStr; } +// --------------------------------------------------------- +// Find if text is including Korean word +// --------------------------------------------------------- +// +TBool TFsEmailUiUtility::IsKoreanWord( const TDesC& aWord ) + { + TBool isKoreanSearchStr = EFalse; + const TInt len = aWord.Length(); + + const TUint KKoreanUnicodeHangulJamoBegin = 0x1100; + const TUint KKoreanUnicodeHangulJamoEnd = 0x11FF; + + for ( TInt ii = 0; ii < len; ii++ ) + { + if ( (TInt) aWord[ii] >= KKoreanUnicodeHangulJamoBegin + && (TInt) aWord[ii] <= KKoreanUnicodeHangulJamoEnd ) + { + isKoreanSearchStr = ETrue; + break; + } + } + + const TUint KKoreanUnicodeHangulCompatibilityJamoBegin = 0x3130; + const TUint KKoreanUnicodeHangulCompatibilityJamoEnd = 0x322F; + + if ( !isKoreanSearchStr ) + { + for ( TInt ii = 0; ii < len; ii++ ) + { + if ( (TInt) aWord[ii] >= KKoreanUnicodeHangulCompatibilityJamoBegin + && (TInt) aWord[ii] <= KKoreanUnicodeHangulCompatibilityJamoEnd ) + { + isKoreanSearchStr = ETrue; + break; + } + } + } + + const TUint KKoreanUnicodeSpanBegin = 0xAC00; + const TUint KKoreanUnicodeSpanEnd = 0xD7A3; + + if ( !isKoreanSearchStr ) + { + for ( TInt ii = 0; ii < len; ii++ ) + { + if ( (TInt) aWord[ii] >= KKoreanUnicodeSpanBegin + && (TInt) aWord[ii] <= KKoreanUnicodeSpanEnd ) + { + isKoreanSearchStr = ETrue; + break; + } + } + } + + return isKoreanSearchStr; + } + // ----------------------------------------------------------------------------- // TFsEmailUiUtility::GetFullIconFileNameL