calendarui/views/src/calendaylistboxmodel.cpp
branchRCL_3
changeset 36 9c5b1510919f
parent 0 f979ecb2b13e
child 67 1539a383d7b6
--- a/calendarui/views/src/calendaylistboxmodel.cpp	Tue May 25 12:41:10 2010 +0300
+++ b/calendarui/views/src/calendaylistboxmodel.cpp	Wed Jun 09 09:40:23 2010 +0300
@@ -484,6 +484,11 @@
     HBufC* result = NULL;
     if ( doesFit )
         {
+        if ( aLineArray.Count() == 1 )
+            {
+            aLineArray.AppendL( TPtrC(KNullDesC) );
+            }
+            
         // If we could fit, we return visualText and caller has
         // to memory manage it. TPtrs in aLineArray points to this text
         // buffer.
@@ -515,6 +520,11 @@
             {
             aLineArray.AppendL( TPtrC(KNullDesC) );
             }
+            
+        if ( aLineArray.Count() == 1 )
+            {
+            aLineArray.AppendL( TPtrC(KNullDesC) );
+            }
 
         // We return original text, because
         // AknBidiTextUtils::ConvertToVisualAndWrapToArrayL
@@ -661,8 +671,14 @@
                 {
                 isEndDisplayed = EFalse;
                 }
-            for (TInt i(1); i < textLines->Count() || !isEndDisplayed; i++)
+            TInt textLinesCount = textLines->Count();
+            for (TInt i(1); i <= textLinesCount || !isEndDisplayed; i++)
                 {
+                if(i == textLinesCount)
+                    {
+                    itemInfo.iBottomLine = iItemTextArray->Count();
+                    break;
+                    }
                 if (itemInfo.iTopLine == KIndexError)
                     {
                     itemInfo.iTopLine = iItemTextArray->Count();