calendarui/editors/src/calendbfield.cpp
branchRCL_3
changeset 18 d68a4b5d5885
parent 14 21239b3bcd78
child 28 96907930389d
--- a/calendarui/editors/src/calendbfield.cpp	Tue May 11 16:12:24 2010 +0300
+++ b/calendarui/editors/src/calendbfield.cpp	Tue May 25 12:41:10 2010 +0300
@@ -304,7 +304,16 @@
     RPointerArray<CCalCalendarInfo> calendarInfoList; 
     iServices->GetAllCalendarInfoL(calendarInfoList);
     CleanupClosePushL( calendarInfoList );
-    TInt pos = iDbNamesTextValues->CurrentValueIndex();
+    TInt pos;
+    if( calendarInfoList.Count() == 1 )
+        {
+         pos = 0;
+        }
+    else
+        {
+        pos = iDbNamesTextValues->CurrentValueIndex();
+        }
+    
     HBufC* calendarFileName = calendarInfoList[pos]->FileNameL().AllocLC();
     iCurrentColId = iServices->SessionL(*calendarFileName).CollectionIdL();
     CleanupStack::PopAndDestroy(calendarFileName);