From f353d7552aa830b192410b8a48cdbbd45b455425 Mon Sep 17 00:00:00 2001 From: Manoj Das Date: Fri, 24 May 2013 11:40:47 +0530 Subject: [PATCH] N_SE-39060 Change-Id: I503322ebb3d903ed4cb413f410c60d0a19a3a6ad --- src/ClDayPanel.cpp | 9 +++++++-- src/ClEventDeleterForm.cpp | 2 +- src/ClEventDetailsForm.cpp | 8 +++++++- src/ClEventItem.cpp | 29 +++++++++++++++++++---------- src/ClEventPresentationModel.cpp | 4 ---- src/ClTaskDetailsForm.cpp | 11 ++++++----- 6 files changed, 40 insertions(+), 23 deletions(-) diff --git a/src/ClDayPanel.cpp b/src/ClDayPanel.cpp index e7babcb..c0c35cb 100644 --- a/src/ClDayPanel.cpp +++ b/src/ClDayPanel.cpp @@ -205,14 +205,19 @@ DayEventButton::Initialize(int x, int width, const CalEventInstance& event, cons { height = H_EVENT_MIN; } + String title = __pEvent->GetSubject(); + if(title.GetLength() == 0) + { + title = ResourceManager::GetString(IDS_CLD_BODY_NO_TITLE); + } if (__pEvent->GetLocation().IsEmpty()) { - Construct(Rectangle(x, startPosition, width, height), __pEvent->GetSubject()); + Construct(Rectangle(x, startPosition, width, height), title); } else { Construct(Rectangle(x, startPosition, width, height), - __pEvent->GetSubject() + ((endPosition - startPosition) >= H_1_LINE_EVENT_TEXT ? L"\n" : L", ") + __pEvent->GetLocation()); + title + ((endPosition - startPosition) >= H_1_LINE_EVENT_TEXT ? L"\n" : L", ") + __pEvent->GetLocation()); } SetColor(BUTTON_STATUS_NORMAL, calendarColor); diff --git a/src/ClEventDeleterForm.cpp b/src/ClEventDeleterForm.cpp index e72de6c..0c0c003 100755 --- a/src/ClEventDeleterForm.cpp +++ b/src/ClEventDeleterForm.cpp @@ -581,7 +581,7 @@ EventDeleterForm::OnGroupedListViewItemStateChanged(GroupedListView& listView, i int actualIndex = (__topBottomItemEnabled == true) ? groupIndex - TOP_BOTTOM_ITEM_COUNT : groupIndex; if (__pPm->GetCurrentDate() > __pPm->GetDateTimeFromGroupIndex(actualIndex)) { - __pSelectBeforeToday->SetSelected(false); + __pSelectBeforeToday->SetSelected(IsSelectedAllEventBeforeToday()); } Invalidate(true); } diff --git a/src/ClEventDetailsForm.cpp b/src/ClEventDetailsForm.cpp index 7c9019a..dd89f59 100644 --- a/src/ClEventDetailsForm.cpp +++ b/src/ClEventDetailsForm.cpp @@ -703,8 +703,14 @@ EventDetailsForm::CreateMainItemN(int itemWidth, const String& title, const Date } else { + String strTitle = title; + if (strTitle.IsEmpty() == true) + { + AppLog("Coming here"); + strTitle = ResourceManager::GetString(IDS_CLD_BODY_NO_TITLE); + } Label* pLabelSubject = new (std::nothrow) Label(); - pLabelSubject->Construct(Rectangle(0, y, itemWidth, H_MAIN_ITEM_SUBJECT), title); + pLabelSubject->Construct(Rectangle(0, y, itemWidth, H_MAIN_ITEM_SUBJECT), strTitle); pItem->AddControl(pLabelSubject); pLabelSubject->SetTextConfig(FONT_SIZE_DETAIL01, LABEL_TEXT_STYLE_NORMAL); pLabelSubject->SetTextColor(Color(COLOR_DETAIL01)); diff --git a/src/ClEventItem.cpp b/src/ClEventItem.cpp index 9a0e80a..a46734b 100644 --- a/src/ClEventItem.cpp +++ b/src/ClEventItem.cpp @@ -542,20 +542,29 @@ EventItem::UpdateElements(void) } } - if (__title.IsEmpty() == false) - { - delete __pTitleElement; - __pTitleElement = new (std::nothrow) EventTitleElement(__title, __searchText); + String* pTitle = new String(L""); - if (titleWidth < __width - X_ITEM_MAIN_CONTENT) - { - titleWidth -= W_ITEM_MAIN_CONTENT_MARGIN; - } + if (__title.IsEmpty() == true) + { + AppLog("Coming here"); + *pTitle = ResourceManager::GetString(IDS_CLD_BODY_NO_TITLE); + } + else + { + pTitle->Append(__title); + } + delete __pTitleElement; + __pTitleElement = new (std::nothrow) EventTitleElement(*pTitle, __searchText); - AddElement(Rectangle(X_ITEM_MAIN_CONTENT, Y_ITEM_MAIN_CONTENT, titleWidth - X_ITEM_MAIN_CONTENT, H_ITEM_MAIN_CONTENT), - ID_EVENT_ITEM_ELEMENT_TITLE, *__pTitleElement); + if (titleWidth < __width - X_ITEM_MAIN_CONTENT) + { + titleWidth -= W_ITEM_MAIN_CONTENT_MARGIN; } + AddElement(Rectangle(X_ITEM_MAIN_CONTENT, Y_ITEM_MAIN_CONTENT, titleWidth - X_ITEM_MAIN_CONTENT, H_ITEM_MAIN_CONTENT), + ID_EVENT_ITEM_ELEMENT_TITLE, *__pTitleElement); + + if (__location.IsEmpty() == true) { if (__range.IsEmpty() == false) diff --git a/src/ClEventPresentationModel.cpp b/src/ClEventPresentationModel.cpp index da7525a..6766f95 100644 --- a/src/ClEventPresentationModel.cpp +++ b/src/ClEventPresentationModel.cpp @@ -761,10 +761,6 @@ EventPresentationModel::Update(void) { AppLogDebug("Enter."); String subject = __pEvent->GetSubject(); - if (subject.IsEmpty()) - { - __pEvent->SetSubject(ResourceManager::GetString(IDS_CLD_BODY_NO_TITLE)); - } // Check duplicated reminder for (int i = 0; i < GetCountReminder() - 1; ++i) diff --git a/src/ClTaskDetailsForm.cpp b/src/ClTaskDetailsForm.cpp index 3b5fa89..8d55aff 100644 --- a/src/ClTaskDetailsForm.cpp +++ b/src/ClTaskDetailsForm.cpp @@ -542,8 +542,13 @@ TaskDetailsForm::CreateMainItemN(int itemWidth, const String& title, const Strin } else { + String strTitle = title; + if(strTitle.GetLength() == 0) + { + strTitle = ResourceManager::GetString(IDS_CLD_BODY_NO_TITLE); + } Label* pLabelSubject = new (std::nothrow) Label(); - pLabelSubject->Construct(Rectangle(0, y, itemWidth, H_MAIN_ITEM_SUBJECT), title); + pLabelSubject->Construct(Rectangle(0, y, itemWidth, H_MAIN_ITEM_SUBJECT), strTitle); pItem->AddControl(pLabelSubject); pLabelSubject->SetTextConfig(FONT_SIZE_DETAIL01, LABEL_TEXT_STYLE_NORMAL); pLabelSubject->SetTextColor(Color(COLOR_DETAIL01)); @@ -933,10 +938,6 @@ result TaskDetailsForm::SaveTask(RecordId calendarId) { String subject = __pTask->GetSubject(); - if (subject.IsEmpty() == true) - { - __pTask->SetSubject(ResourceManager::GetString(IDS_CLD_BODY_NO_TITLE)); - } Calendarbook calendarbook; calendarbook.Construct(); result r = E_SUCCESS; -- 2.7.4