From 0d4492318e034743e64db50fa62aa49e5abf4d59 Mon Sep 17 00:00:00 2001 From: SeungWon Lee Date: Thu, 4 Apr 2013 16:35:16 +0900 Subject: [PATCH] Fix prevent issue: 48307 Operands don't affect result , 48279 Unchecked return value. Change-Id: Iff0e0915892b99bc6869330f251218392793e4e0 Signed-off-by: SeungWon Lee --- src/core/FShell_NotificationManagerImpl.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/core/FShell_NotificationManagerImpl.cpp b/src/core/FShell_NotificationManagerImpl.cpp index 89c4fad..2f4e6d4 100644 --- a/src/core/FShell_NotificationManagerImpl.cpp +++ b/src/core/FShell_NotificationManagerImpl.cpp @@ -701,7 +701,6 @@ _NotificationManagerImpl::NotifyMessage(_NotifyType notifyType, bool isOngoing, for (int i = 0; i < itemCount; i++) { const String* pThumbnailPath = static_cast(pThumbnailList->GetAt(i)); - // TODO: check pThumbnailPath std::unique_ptr filePath(_StringConverter::CopyToCharArrayN(*pThumbnailPath)); r = ConvertNotificationResult(notification_set_image(notiHandle, thumbnailListEnum[i], filePath.get())); SysTryLog(NID_SHELL, !IsFailed(r), "[%s] Notification Set thumnail path failed.", GetErrorMessage(r)); @@ -710,7 +709,6 @@ _NotificationManagerImpl::NotifyMessage(_NotifyType notifyType, bool isOngoing, } else { - // TODO: Check the valid const IList* pMessageTextList = pRequestImpl->GetMessageTextList(); if (pMessageTextList && pMessageTextList->GetCount()) { @@ -749,7 +747,7 @@ _NotificationManagerImpl::NotifyMessage(_NotifyType notifyType, bool isOngoing, { int matchIndex; // 2.1: Multiple layout has single line text for 2nd information text. - if ((layout == NOTIFICATION_LY_NOTI_EVENT_MULTIPLE && E_SUCCESS) == (pText2->IndexOf(L'\t', 0, matchIndex))) + if ((layout == NOTIFICATION_LY_NOTI_EVENT_MULTIPLE) && (E_SUCCESS == (pText2->IndexOf(L'\t', 0, matchIndex)))) { // Make two token String subText; @@ -757,14 +755,14 @@ _NotificationManagerImpl::NotifyMessage(_NotifyType notifyType, bool isOngoing, std::unique_ptr leftText(_StringConverter::CopyToCharArrayN(subText)); r = ConvertNotificationResult(notification_set_text(notiHandle, NOTIFICATION_TEXT_TYPE_INFO_2, leftText.get(), NULL, NOTIFICATION_VARIABLE_TYPE_NONE)); - SysTryLog(NID_SHELL, !IsFailed(r), "[%s] Notification Set Info1 Text failed.", GetErrorMessage(r)); + SysTryLog(NID_SHELL, !IsFailed(r), "[%s] Notification Set Info2 Text failed.", GetErrorMessage(r)); subText.Clear(); if (E_SUCCESS == pText2->SubString(matchIndex+1, subText)) { std::unique_ptr rightText(_StringConverter::CopyToCharArrayN(subText)); r = ConvertNotificationResult(notification_set_text(notiHandle, NOTIFICATION_TEXT_TYPE_INFO_SUB_2, rightText.get(), NULL, NOTIFICATION_VARIABLE_TYPE_NONE)); - SysTryLog(NID_SHELL, !IsFailed(r), "[%s] Notification Set Info1 Sub Text failed.", GetErrorMessage(r)); + SysTryLog(NID_SHELL, !IsFailed(r), "[%s] Notification Set Info2 Sub Text failed.", GetErrorMessage(r)); } } else @@ -772,7 +770,7 @@ _NotificationManagerImpl::NotifyMessage(_NotifyType notifyType, bool isOngoing, std::unique_ptr leftText(_StringConverter::CopyToCharArrayN(*pText2)); r = ConvertNotificationResult(notification_set_text(notiHandle, NOTIFICATION_TEXT_TYPE_INFO_2, leftText.get(), NULL, NOTIFICATION_VARIABLE_TYPE_NONE)); - SysTryLog(NID_SHELL, !IsFailed(r), "[%s] Notification Set Info1 Text failed.", GetErrorMessage(r)); + SysTryLog(NID_SHELL, !IsFailed(r), "[%s] Notification Set Info2 Text failed.", GetErrorMessage(r)); } } } @@ -875,7 +873,8 @@ _NotificationManagerImpl::NotifyMessage(_NotifyType notifyType, bool isOngoing, layout = NOTIFICATION_LY_ONGOING_PROGRESS; } } - notification_set_layout(notiHandle, layout); + r = ConvertNotificationResult(notification_set_layout(notiHandle, layout)); + SysTryLog(NID_SHELL, !IsFailed(r), "[%s] notification_set_layout failure.", GetErrorMessage(r)); // For ongoing if (isOngoing) -- 2.7.4