phonebookui/Phonebook2/ccapplication/ccacommlauncherplugin/src/ccappcommlauncherlpadmodel.cpp
branchRCL_3
changeset 6 e8e3147d53eb
parent 5 81f8547efd4f
child 7 b3431bff8c19
--- a/phonebookui/Phonebook2/ccapplication/ccacommlauncherplugin/src/ccappcommlauncherlpadmodel.cpp	Fri Mar 12 15:41:25 2010 +0200
+++ b/phonebookui/Phonebook2/ccapplication/ccacommlauncherplugin/src/ccappcommlauncherlpadmodel.cpp	Mon Mar 15 12:39:26 2010 +0200
@@ -37,6 +37,7 @@
 #include <cbsbitmap.h>
 #include <AknIconUtils.h>
 
+#include <AknBidiTextUtils.h>
 
 namespace {
 
@@ -246,7 +247,17 @@
         {
         TPtr textPtr(iTextBuf->Des());
         textPtr.Zero();
-        textPtr.Copy(iButtonDataArray[ aIndex ].iPopupText);
+        TPtrC popupText;        
+        TRAPD( error, popupText.Set( const_cast <CCCAppCommLauncherLPadModel*>(this)->TextForPopUpL( aIndex ) ) );
+        if ( KErrNone == error )
+            {
+            textPtr.Copy( popupText );
+            }
+        else
+            {
+            textPtr.Copy( iButtonDataArray[ aIndex ].iPopupText );
+            }
+        
         if ( iButtonDataArray[ aIndex ].iClipFromBegining )
         	{
         	// Clip for second row text
@@ -1487,14 +1498,36 @@
 {
     CAknDoubleLargeStyleListBox* listbox =
         static_cast<CAknDoubleLargeStyleListBox*>(&iListBox);
-
-    return AknTextUtils::ClipToFit(
+    TBool result = EFalse;
+    if ( IfShowMultiIcon( aItemIndex ) )
+        {
+        TRect mainPane = iPlugin.ClientRect();
+        TAknLayoutRect listLayoutRect;
+        listLayoutRect.LayoutRect(
+            mainPane,
+            AknLayoutScalable_Apps::list_double_large_graphic_phob2_cc_pane_g3(0).LayoutLine() );
+        TInt multiIconWidth(listLayoutRect.Rect().Width());
+        const TInt KCalculationErrors = 1;
+        CFormattedCellListBoxData *data = listbox->ItemDrawer()->FormattedCellData();
+        const CFont *font = data->Font(listbox->ItemDrawer()->Properties(aItemIndex), aSubCellNumber);
+        TSize cellsize = data->SubCellSize(aSubCellNumber);
+        TMargins margin = data->SubCellMargins(aSubCellNumber);
+        TInt width = cellsize.iWidth - margin.iLeft - margin.iRight - 
+                        multiIconWidth - KAknBidiExtraSpacePerLine - KCalculationErrors;
+        TInt clipgap = data->SubCellTextClipGap(aSubCellNumber);
+        result = AknTextUtils::ClipToFit(
+            aBuffer, *font, width, AknTextUtils::EClipFromBeginning, width + clipgap);
+        }
+    else
+        {
+        result = AknTextUtils::ClipToFit(
         aBuffer,
         AknTextUtils::EClipFromBeginning,
         listbox,
         aItemIndex,
         aSubCellNumber);
 }
-
+    return result;
+    }
 
 // End of File