calendarui/controller/src/calentoolbarimpl.cpp
branchRCL_3
changeset 36 9c5b1510919f
parent 0 f979ecb2b13e
child 60 96907930389d
--- a/calendarui/controller/src/calentoolbarimpl.cpp	Tue May 25 12:41:10 2010 +0300
+++ b/calendarui/controller/src/calentoolbarimpl.cpp	Wed Jun 09 09:40:23 2010 +0300
@@ -390,7 +390,7 @@
     
     ResetToolbarExtensionCommandsL();
     // add toolbar items for native views
-    for(TInt index = viewPositionArray.Count()-1;index >= KPositionZero ;index--)
+    for(TInt index = KPositionZero ;index < viewPositionArray.Count()  ;index++)
         {
         viewPosition = viewInfoArray.Find( viewPositionArray[index],
                                 CCalenViewInfo::ViewInfoIdentifier );
@@ -449,12 +449,13 @@
     TInt currViewInfoPos = aViewInfoArray.Find( aCurrentViewUid , 
                                          CCalenViewInfo::ViewInfoIdentifier );
     
-    TInt index = currViewInfoPos + 1;
-    while( index!= currViewInfoPos )
+    TInt index = aViewInfoArray.Find( KUidCalenMonthView ,  CCalenViewInfo::ViewInfoIdentifier );
+    
+    while( index!= aViewInfoArray.Count() )
         {
-        if( index == aViewInfoArray.Count()) // If last item,
+        if( index == currViewInfoPos) // If last item,
             {
-            index = 0;
+            index ++;
             continue;
             }
         if(( aViewInfoArray[index]->CyclePosition() != CCalenView::ENoCyclePosition ) )