uifw/AvKon/src/eikfrlbd.cpp
branchRCL_3
changeset 9 aabf2c525e0f
parent 0 2f259fa3e83a
child 10 9f56a4e1b8ab
equal deleted inserted replaced
4:8ca85d2f0db7 9:aabf2c525e0f
    13 *
    13 *
    14 * Description: 
    14 * Description: 
    15 *
    15 *
    16 */
    16 */
    17 
    17 
       
    18 #ifdef __ARMCC__
       
    19 #pragma push
       
    20 #pragma O3
       
    21 #pragma Otime
       
    22 #pragma arm
       
    23 #endif // __ARMCC__
    18 
    24 
    19 #include <eikfrlbd.h>
    25 #include <eikfrlbd.h>
    20 #include <aknlists.h>
    26 #include <aknlists.h>
    21 #include <AknMarqueeControl.h>
    27 #include <AknMarqueeControl.h>
    22 #include <AknPictographInterface.h>
    28 #include <AknPictographInterface.h>
  4024     CleanupStack::PopAndDestroy( fbsBitGc );
  4030     CleanupStack::PopAndDestroy( fbsBitGc );
  4025     _AKNTRACE_FUNC_EXIT;
  4031     _AKNTRACE_FUNC_EXIT;
  4026     }
  4032     }
  4027 
  4033 
  4028 
  4034 
       
  4035 struct TCellInfo
       
  4036     {
       
  4037     TBool iTextNull;
       
  4038     TPtrC iTextPtr;
       
  4039     };
       
  4040 
  4029 void 
  4041 void 
  4030 CFormattedCellListBoxData::DrawFormattedOld( TListItemProperties& aProperties,
  4042 CFormattedCellListBoxData::DrawFormattedOld( TListItemProperties& aProperties,
  4031                                              CWindowGc& aGc,
  4043                                              CWindowGc& aGc,
  4032                                              const TDesC* aText,
  4044                                              const TDesC* aText,
  4033                                              const TRect& aItemRect,
  4045                                              const TRect& aItemRect,
  4034                                              TBool aHighlight,
  4046                                              TBool aHighlight,
  4035                                              const TColors& aColors ) const
  4047                                              const TColors& aColors ) const
  4036     {
  4048     {
  4037     _AKNTRACE_FUNC_ENTER;
  4049     _AKNTRACE_FUNC_ENTER;
       
  4050     
  4038     TRect aRect(aItemRect);
  4051     TRect aRect(aItemRect);
  4039     const TColors *subcellColors = &aColors;
  4052     const TColors *subcellColors = &aColors;
  4040     
  4053     
  4041     TInt lastSubCell=LastSubCell();
  4054     TInt lastSubCell=LastSubCell();
  4042     if (lastSubCell==KErrNotFound)
  4055     if (lastSubCell==KErrNotFound)
  4050     if (font==NULL)
  4063     if (font==NULL)
  4051         {
  4064         {
  4052         font=CEikonEnv::Static()->NormalFont();
  4065         font=CEikonEnv::Static()->NormalFont();
  4053         }
  4066         }
  4054     
  4067     
  4055     TInt extraVerticalSpace=(aRect.Height()-font->HeightInPixels());
       
  4056     TInt baseLineOffset=extraVerticalSpace/2+font->AscentInPixels();
       
  4057     TRect textRect=aRect;
  4068     TRect textRect=aRect;
  4058     textRect.iBr.iX=aRect.iTl.iX;
  4069     textRect.iBr.iX=aRect.iTl.iX;
  4059     TInt subcell=0;
  4070     TInt subcell=0;
  4060     TInt subcell2=0;
  4071     TInt subcell2=0;
  4061     TPtrC text;
  4072 
  4062     TBool textNull[30];
  4073     TCellInfo textNull[30];
  4063     TRgb bmpBackColor, bmpForeColor;
       
  4064     TRect textShadowRect;           // For transparent list
  4074     TRect textShadowRect;           // For transparent list
  4065     TRgb textShadowColour = AKN_LAF_COLOR_STATIC(215);    // Black shadow for item text.
  4075     TRgb textShadowColour = AKN_LAF_COLOR_STATIC(215);    // Black shadow for item text.
  4066 
  4076 
  4067     MAknsControlContext *cc = AknsDrawUtils::ControlContext( Control() );
       
  4068     TBool layoutMirrored = AknLayoutUtils::LayoutMirrored();
  4077     TBool layoutMirrored = AknLayoutUtils::LayoutMirrored();
  4069     TBool skinEnabled = AknsUtils::AvkonSkinEnabled();
  4078     TBool skinEnabled = AknsUtils::AvkonSkinEnabled();
  4070     
  4079     
  4071     if (!cc)
       
  4072         {
       
  4073         cc = SkinBackgroundContext();
       
  4074         }
       
  4075 
       
  4076     Mem::FillZ( textNull, sizeof( textNull ) );
       
  4077 
  4080 
  4078     // cache the text states.
  4081     // cache the text states.
  4079     subcell = 0;
  4082     subcell = 0;
       
  4083     
       
  4084     SSubCell defaultCell;
       
  4085     TMargins tm = {0,0,0,0};
       
  4086     defaultCell.iPosition = TPoint(0,0);
       
  4087     defaultCell.iSize = TSize(0,0);
       
  4088     defaultCell.iRealSize = TSize(0,0);
       
  4089     defaultCell.iRealTextSize = TSize(0,0);
       
  4090     defaultCell.iMargin = tm;
       
  4091     defaultCell.iUseSubCellColors = EFalse;
       
  4092     defaultCell.iColors = defaultcolors;
       
  4093     defaultCell.iGraphics = EFalse;
       
  4094     defaultCell.iAlign = CGraphicsContext::ELeft;
       
  4095     defaultCell.iBaseline = 0;
       
  4096     defaultCell.iNumberCell = EFalse;
       
  4097     defaultCell.iTextClipGap = 0;
       
  4098     defaultCell.iNotAlwaysDrawn = EFalse;
       
  4099     defaultCell.iTransparent = EFalse;
       
  4100     defaultCell.iBaseFont = 0;
       
  4101     SSubCell* sc;
       
  4102     
       
  4103     
  4080     for(;;)
  4104     for(;;)
  4081         {
  4105         {
  4082         if (subcell>lastSubCell)
  4106         if (subcell>lastSubCell)
  4083             {
  4107             {
  4084             break;
  4108             break;
  4085             }
  4109             }
  4086         
  4110         
  4087         TextUtils::ColumnText(text,subcell, aText);
  4111         TInt subcellindex = 0;
  4088         if (text == KNullDesC && SubCellIsNotAlwaysDrawn(subcell))
  4112         TInt subcellfound = 0;
  4089             {
  4113         subcellfound = FindSubCellIndex(subcellindex,subcell);
  4090             textNull[subcell] = ETrue;
  4114         if (subcellfound != KErrNotFound)
       
  4115             {
       
  4116             sc = &(iSubCellArray->At(subcellindex));
       
  4117             }
       
  4118         else
       
  4119             {
       
  4120             sc = &defaultCell;
       
  4121             }
       
  4122         
       
  4123         TextUtils::ColumnText(textNull[subcell].iTextPtr,subcell, aText);
       
  4124         
       
  4125         if (textNull[subcell].iTextPtr == KNullDesC && sc->iNotAlwaysDrawn)
       
  4126             {
       
  4127             textNull[subcell].iTextNull = ETrue;
       
  4128             }
       
  4129         else
       
  4130             {
       
  4131             textNull[subcell].iTextNull = EFalse;
  4091             }
  4132             }
  4092 
  4133 
  4093         subcell++;
  4134         subcell++;
  4094         }
  4135         }
  4095     
  4136     
  4101         if (subcell>lastSubCell)
  4142         if (subcell>lastSubCell)
  4102             {
  4143             {
  4103             break;
  4144             break;
  4104             }
  4145             }
  4105         
  4146         
  4106         if (textNull[subcell])
  4147         if (textNull[subcell].iTextNull)
  4107             {
  4148             {
  4108             ++subcell;
  4149             ++subcell;
  4109             continue;
  4150             continue;
  4110             }
  4151             }
  4111         
  4152         
  4112         TRect bRect(SubCellPosition(subcell),SubCellSize(subcell));
  4153         TInt subcellindex = 0;
  4113         TMargins m(SubCellMargins(subcell));
  4154         TInt subcellfound = 0;
  4114         TRect cRect(bRect.iTl+TSize(m.iLeft,m.iTop),bRect.Size()-TSize(m.iRight+m.iLeft,m.iBottom+m.iTop));
  4155         subcellfound = FindSubCellIndex(subcellindex,subcell);
       
  4156         if (subcellfound != KErrNotFound)
       
  4157             {
       
  4158             sc = &(iSubCellArray->At(subcellindex));
       
  4159             }
       
  4160         else
       
  4161             {
       
  4162             sc = &defaultCell;
       
  4163             }
  4115         
  4164         
  4116         for (subcell2=subcell+1; subcell2<=lastSubCell; subcell2++) 
  4165         TRect bRect = TRect(sc->iPosition,sc->iSize);
  4117             {
  4166         TMargins m = sc->iMargin;
  4118             if (textNull[subcell2])
  4167         TRect cRect = TRect(bRect.iTl+TSize(m.iLeft,m.iTop),bRect.Size()-TSize(m.iRight+m.iLeft,m.iBottom+m.iTop));
       
  4168         const TBool istrans = sc->iTransparent;
       
  4169         if (!layoutMirrored)
       
  4170             {
       
  4171             for (subcell2=subcell+1; subcell2<=lastSubCell; subcell2++) 
  4119                 {
  4172                 {
  4120                 continue;
  4173                 if (textNull[subcell2].iTextNull)
  4121                 }
  4174                     {
  4122             
  4175                     continue;
  4123             // This is called O(N^2) times - Do not put anything extra to it, it'll slow down drawing!
  4176                     }
  4124             TRect bRect2 = TRect(SubCellPosition(subcell2),SubCellSize(subcell2));
  4177                 
  4125             if (cRect.Intersects(bRect2) && bRect.Intersects(bRect2) && !SubCellIsTransparent(subcell) && !SubCellIsTransparent(subcell2)) 
  4178                 // This is called O(N^2) times - Do not put anything extra to it, it'll slow down drawing!
  4126                 {
  4179                 TRect bRect2 = TRect(SubCellPosition(subcell2),SubCellSize(subcell2));
  4127                 if (!layoutMirrored)
  4180                 if (cRect.Intersects(bRect2) && bRect.Intersects(bRect2) && !istrans && !SubCellIsTransparent(subcell2)) 
  4128                     {
  4181                     {
  4129                     cRect.iBr.iX = bRect2.iTl.iX;
  4182                     cRect.iBr.iX = bRect2.iTl.iX;
  4130                     bRect.iBr.iX = bRect2.iTl.iX;
  4183                     bRect.iBr.iX = bRect2.iTl.iX;
  4131                     }
  4184                     }
  4132                 else
  4185                 }
       
  4186             }
       
  4187         else
       
  4188             {
       
  4189             for (subcell2=subcell+1; subcell2<=lastSubCell; subcell2++) 
       
  4190                 {
       
  4191                 if (textNull[subcell2].iTextNull)
       
  4192                     {
       
  4193                     continue;
       
  4194                     }
       
  4195                 
       
  4196                 // This is called O(N^2) times - Do not put anything extra to it, it'll slow down drawing!
       
  4197                 TRect bRect2 = TRect(SubCellPosition(subcell2),SubCellSize(subcell2));
       
  4198                 if (cRect.Intersects(bRect2) && bRect.Intersects(bRect2) && !istrans && !SubCellIsTransparent(subcell2)) 
  4133                     {
  4199                     {
  4134                     cRect.iTl.iX = bRect2.iBr.iX;
  4200                     cRect.iTl.iX = bRect2.iBr.iX;
  4135                     bRect.iTl.iX = bRect2.iBr.iX;
  4201                     bRect.iTl.iX = bRect2.iBr.iX;
  4136                     }
  4202                     }
  4137                 }
  4203                 }
  4138             }
  4204             }
  4139         SetSubCellRealTextSize(subcell, cRect.Size());
  4205         SetSubCellRealTextSize(subcell, cRect.Size());
  4140         SetSubCellRealSize(subcell, bRect.Size());
  4206         SetSubCellRealSize(subcell, bRect.Size());
       
  4207         sc->iRealTextSize = cRect.Size();
       
  4208         sc->iRealSize = bRect.Size();
  4141         subcell++;
  4209         subcell++;
  4142         }
  4210         }
  4143     
  4211     
  4144     // This loop does the drawing.    
  4212     // This loop does the drawing.    
  4145     aGc.SetPenStyle(CGraphicsContext::ENullPen);
  4213     aGc.SetPenStyle(CGraphicsContext::ENullPen);
  4149         if (subcell>lastSubCell)
  4217         if (subcell>lastSubCell)
  4150             {
  4218             {
  4151             break;
  4219             break;
  4152             }
  4220             }
  4153         
  4221         
  4154         if (textNull[subcell])
  4222         if (textNull[subcell].iTextNull)
  4155             {
  4223             {
  4156             ++ subcell;
  4224             ++ subcell;
  4157             continue;
  4225             continue;
  4158             }
  4226             }
  4159         
  4227         
       
  4228         
       
  4229         TInt subcellindex = 0;
       
  4230         TInt subcellfound = 0;
       
  4231         subcellfound = FindSubCellIndex(subcellindex,subcell);
       
  4232         if (subcellfound != KErrNotFound)
       
  4233             {
       
  4234             sc = &(iSubCellArray->At(subcellindex));
       
  4235             }
       
  4236         else
       
  4237             {
       
  4238             sc = &defaultCell;
       
  4239             }
       
  4240         
  4160         // SetPosition, SetSize and margins support
  4241         // SetPosition, SetSize and margins support
  4161         TRect bRect(SubCellPosition(subcell),SubCellRealSize(subcell));
  4242         TRect bRect = TRect(sc->iPosition,sc->iRealSize);
  4162         TMargins m(SubCellMargins(subcell));
  4243         TMargins m = sc->iMargin;
  4163         TRect cRect(bRect.iTl+TSize(m.iLeft,m.iTop),SubCellRealTextSize(subcell));
  4244         TRect cRect = TRect(bRect.iTl+TSize(m.iLeft,m.iTop),sc->iRealTextSize);
  4164         
  4245         
  4165         
  4246         
  4166         if (bRect.iBr.iX == 0)
  4247         if (bRect.iBr.iX == 0)
  4167             {
  4248             {
  4168             ++subcell;
  4249             ++subcell;
  4169             continue;
  4250             continue;
  4170             }
  4251             }
  4171         
  4252         
  4172         if ( layoutMirrored ) 
  4253         if ( layoutMirrored ) 
  4173             {
  4254             {
  4174             TRect bRect = TRect(SubCellPosition(subcell),SubCellSize(subcell));
  4255             TRect bRect = TRect(sc->iPosition,sc->iSize);
  4175             TRect cRect2 = TRect(bRect.iTl+TSize(m.iLeft,m.iTop),bRect.Size()-TSize(m.iRight+m.iLeft,m.iBottom+m.iTop));
  4256             TRect cRect2 = TRect(bRect.iTl+TSize(m.iLeft,m.iTop),bRect.Size()-TSize(m.iRight+m.iLeft,m.iBottom+m.iTop));
  4176             
  4257             
  4177             TInt shift = (cRect2.Size() - SubCellRealTextSize(subcell)).iWidth;
  4258             TInt shift = (cRect2.Size() - sc->iRealTextSize).iWidth;
  4178             cRect.iTl.iX += shift;
  4259             cRect.iTl.iX += shift;
  4179             cRect.iBr.iX += shift;
  4260             cRect.iBr.iX += shift;
  4180             }
  4261             }
  4181         
  4262         
  4182         textRect.SetRect(aItemRect.iTl+cRect.iTl,cRect.Size());
  4263         textRect=TRect(aItemRect.iTl+cRect.iTl,cRect.Size());
  4183         
  4264         
  4184         if (UseSubCellColors(subcell))
  4265         if (sc->iUseSubCellColors)
  4185             {
  4266             {
  4186             subcellColors = &SubCellColors(subcell);
  4267             subcellColors = &sc->iColors;
  4187             }
  4268             }
  4188         else
  4269         else
  4189             {
  4270             {
  4190             subcellColors = &aColors;
  4271             subcellColors = &aColors;
  4191             }
  4272             }
  4192 
  4273 
  4193         if (aHighlight)
  4274         if (aHighlight)
  4194             {
  4275             {
  4195             aGc.SetPenColor(subcellColors->iHighlightedText);
  4276             aGc.SetPenColor(subcellColors->iHighlightedText);
  4196             aGc.SetBrushColor(subcellColors->iHighlightedBack); 
  4277             aGc.SetBrushColor(subcellColors->iHighlightedBack); 
  4197             bmpBackColor = subcellColors->iHighlightedBack;
       
  4198             bmpForeColor = subcellColors->iHighlightedText;
       
  4199             if ( skinEnabled && iExtension )
  4278             if ( skinEnabled && iExtension )
  4200                 {
  4279                 {
  4201                 if ( iExtension->iHighlightedTextColor != NULL )
  4280                 if ( iExtension->iHighlightedTextColor != NULL )
  4202                     {
  4281                     {
  4203                     aGc.SetPenColor( iExtension->iHighlightedTextColor );
  4282                     aGc.SetPenColor( iExtension->iHighlightedTextColor );
  4204                     bmpForeColor = iExtension->iHighlightedTextColor;
       
  4205                     }
  4283                     }
  4206                 }
  4284                 }
  4207             }
  4285             }
  4208         else
  4286         else
  4209             {
  4287             {
  4210             aGc.SetPenColor(subcellColors->iText);
  4288             aGc.SetPenColor(subcellColors->iText);
  4211             aGc.SetBrushColor(subcellColors->iBack);
  4289             aGc.SetBrushColor(subcellColors->iBack);
  4212             bmpBackColor = subcellColors->iBack;
       
  4213             bmpForeColor = subcellColors->iText;
       
  4214             
  4290             
  4215             if ( skinEnabled && iExtension )
  4291             if ( skinEnabled && iExtension )
  4216                 {
  4292                 {
  4217                 if ( iExtension->iTextColor != NULL )
  4293                 if ( iExtension->iTextColor != NULL )
  4218                     {
  4294                     {
  4219                     aGc.SetPenColor( iExtension->iTextColor );
  4295                     aGc.SetPenColor( iExtension->iTextColor );
  4220                     bmpForeColor = iExtension->iTextColor;
       
  4221                     }
  4296                     }
  4222                 }
  4297                 }
  4223             }
  4298             }
  4224         
  4299         
  4225         aGc.SetBrushStyle(CGraphicsContext::ENullBrush);
  4300         aGc.SetBrushStyle(CGraphicsContext::ENullBrush);
  4226         
  4301         
  4227         // The following draws subcells to textRect
  4302         // The following draws subcells to textRect
  4228         if (textRect.iBr.iX!=textRect.iTl.iX)
  4303         if (textRect.iBr.iX!=textRect.iTl.iX)
  4229             {
  4304             {          
  4230             TextUtils::ColumnText(text,subcell,aText);
       
  4231             
       
  4232             // graphics or text column
  4305             // graphics or text column
  4233             CGraphicsContext::TTextAlign align=SubCellAlignment(subcell);
  4306             CGraphicsContext::TTextAlign align=sc->iAlign;
  4234             if (!SubCellIsGraphics(subcell))
  4307             if (!sc->iGraphics)
  4235                 {
  4308                 {
  4236                 const CFont* rowAndCellFont=RowAndSubCellFont(iExtension->iCurrentlyDrawnItemIndex,subcell);
  4309                 const CFont* rowAndCellFont=RowAndSubCellFont(iExtension->iCurrentlyDrawnItemIndex,subcell);
  4237                 const CFont* cellFont=Font(aProperties, subcell);
  4310                 const CFont* cellFont=sc->iBaseFont;
  4238                 const CFont* tempFont=(cellFont) ? cellFont : font;
  4311                 const CFont* tempFont=(cellFont) ? cellFont : font;
  4239                 const CFont* usedFont=(rowAndCellFont) ? rowAndCellFont : tempFont;
  4312                 const CFont* usedFont=(rowAndCellFont) ? rowAndCellFont : tempFont;
  4240                 aGc.UseFont(usedFont);
  4313                 aGc.UseFont(usedFont);
  4241                 SetUnderlineStyle( aProperties, aGc, subcell );
  4314                 SetUnderlineStyle( aProperties, aGc, subcell );
  4242                 
  4315                 
  4243                 // baseline calc needed for each cell.
  4316                 // baseline calc needed for each cell.
  4244                 baseLineOffset = SubCellBaselinePos(subcell);
  4317                 TInt baseLineOffset = sc->iBaseline;
  4245                 baseLineOffset -= cRect.iTl.iY;
  4318                 baseLineOffset -= cRect.iTl.iY;
  4246                 if (!baseLineOffset)
  4319                 if (!baseLineOffset)
  4247                     {
  4320                     {
  4248                     baseLineOffset = (cRect.Size().iHeight-usedFont->HeightInPixels())/2 + usedFont->AscentInPixels();
  4321                     baseLineOffset = (cRect.Size().iHeight-usedFont->HeightInPixels())/2 + usedFont->AscentInPixels();
  4249                     }
  4322                     }
  4250                 
  4323                 
  4251                 TBuf<KMaxColumnDataLength + KAknBidiExtraSpacePerLine> clipbuf = 
  4324                 TBuf<KMaxColumnDataLength + KAknBidiExtraSpacePerLine> clipbuf;// = sc->iColumnText.Left(KMaxColumnDataLength);
  4252                     text.Left(KMaxColumnDataLength);
       
  4253                 
  4325                 
  4254                 // Note that this potentially modifies the text so its lenght in pixels
  4326                 // Note that this potentially modifies the text so its lenght in pixels
  4255                 // might increase. Therefore, this should always be done before
  4327                 // might increase. Therefore, this should always be done before
  4256                 // wrapping/clipping text. In some cases, WordWrapListItem is called
  4328                 // wrapping/clipping text. In some cases, WordWrapListItem is called
  4257                 // before coming here. Is it certain that it is not done for number subcells?
  4329                 // before coming here. Is it certain that it is not done for number subcells?
  4258                 if (SubCellIsNumberCell(subcell))
  4330                 TBool bufset = EFalse;
       
  4331                 if (sc->iNumberCell)
  4259                     {
  4332                     {
       
  4333                     clipbuf = textNull[subcell].iTextPtr.Left(KMaxColumnDataLength);
  4260                     AknTextUtils::LanguageSpecificNumberConversion(clipbuf);
  4334                     AknTextUtils::LanguageSpecificNumberConversion(clipbuf);
       
  4335                     bufset = ETrue;
  4261                     }
  4336                     }
  4262                 
  4337                 
  4263                 TBool clipped( EFalse );
  4338                 TBool clipped( EFalse );
  4264                 TInt clipgap = SubCellTextClipGap( subcell );
  4339                 TInt clipgap = sc->iTextClipGap;
  4265                 
  4340                 
  4266                 if ( iExtension->iUseLogicalToVisualConversion &&
  4341                 if ( iExtension->iUseLogicalToVisualConversion &&
  4267                      subcell != iExtension->iFirstWordWrappedSubcellIndex &&
  4342                      subcell != iExtension->iFirstWordWrappedSubcellIndex &&
  4268                      subcell != iExtension->iSecondWordWrappedSubcellIndex )
  4343                      subcell != iExtension->iSecondWordWrappedSubcellIndex )
  4269                     {
  4344                     {
  4270                     TInt maxClipWidth = textRect.Size().iWidth + clipgap;
  4345                     TInt maxClipWidth = textRect.Size().iWidth + clipgap;
  4271                     
  4346                 
  4272                     clipped = AknBidiTextUtils::ConvertToVisualAndClip(
  4347                     clipped = AknBidiTextUtils::ConvertToVisualAndClip(
  4273                         text.Left(KMaxColumnDataLength), 
  4348                         textNull[subcell].iTextPtr.Left(KMaxColumnDataLength), 
  4274                         clipbuf,
  4349                         clipbuf,
  4275                         *usedFont,
  4350                         *usedFont,
  4276                         textRect.Size().iWidth, 
  4351                         textRect.Width(), 
  4277                         maxClipWidth );
  4352                         maxClipWidth );
       
  4353                     }
       
  4354                 else if (!bufset)
       
  4355                     {
       
  4356                     clipbuf = textNull[subcell].iTextPtr.Left(KMaxColumnDataLength);
  4278                     }
  4357                     }
  4279                 
  4358                 
  4280                 if (clipped) 
  4359                 if (clipped) 
  4281                     {
  4360                     {
  4282                     if (!layoutMirrored)
  4361                     if (!layoutMirrored)
  4317                 if ( aHighlight && iExtension->IsMarqueeOn() && clipped && !marqueeDisabled )
  4396                 if ( aHighlight && iExtension->IsMarqueeOn() && clipped && !marqueeDisabled )
  4318                     {                    
  4397                     {                    
  4319                     // Let marquee know if it needs to do bidi conversion.
  4398                     // Let marquee know if it needs to do bidi conversion.
  4320                     marquee->UseLogicalToVisualConversion( clipped );
  4399                     marquee->UseLogicalToVisualConversion( clipped );
  4321                     
  4400                     
  4322                     if ( marquee->DrawText( aGc, textRect, text, baseLineOffset, align, *usedFont ) )
  4401                     if ( marquee->DrawText( aGc, textRect, textNull[subcell].iTextPtr, baseLineOffset, align, *usedFont ) )
  4323                         {
  4402                         {
  4324                         // All the loops have been executed -> the text needs to be truncated.
  4403                         // All the loops have been executed -> the text needs to be truncated.
  4325                         aGc.DrawText( clipbuf, textRect, baseLineOffset, align, 0 );
  4404                         aGc.DrawText( clipbuf, textRect, baseLineOffset, align, 0 );
  4326                         }
  4405                         }
  4327                     }
  4406                     }
  4364                 aGc.SetUnderlineStyle(EUnderlineOff);
  4443                 aGc.SetUnderlineStyle(EUnderlineOff);
  4365                 aGc.DiscardFont(); // Release the font cache
  4444                 aGc.DiscardFont(); // Release the font cache
  4366                 }
  4445                 }
  4367             else // Graphics subcell
  4446             else // Graphics subcell
  4368                 {
  4447                 {
  4369                 TLex lex(text);
  4448                 TLex lex(textNull[subcell].iTextPtr);
  4370                 TInt index;
  4449                 TInt index;
  4371                 __ASSERT_ALWAYS(lex.Val(index)==KErrNone,Panic(EAknPanicFormattedCellListInvalidBitmapIndex));
  4450                 __ASSERT_ALWAYS(lex.Val(index)==KErrNone,Panic(EAknPanicFormattedCellListInvalidBitmapIndex));
  4372                 __ASSERT_DEBUG(iIconArray, Panic(EAknPanicOutOfRange));
  4451                 __ASSERT_DEBUG(iIconArray, Panic(EAknPanicOutOfRange));
  4373                 if ( index == KColorIconFlag ) index = KColorIconIdx;
  4452                 if ( index == KColorIconFlag ) index = KColorIconIdx;
  4374                 __ASSERT_DEBUG((index>=0 && index<iIconArray->Count()),Panic(EAknPanicFormattedCellListInvalidBitmapIndex));
  4453                 __ASSERT_DEBUG((index>=0 && index<iIconArray->Count()),Panic(EAknPanicFormattedCellListInvalidBitmapIndex));
  4403                             }
  4482                             }
  4404                         }
  4483                         }
  4405                     
  4484                     
  4406                     TSize size=bitmap->SizeInPixels();
  4485                     TSize size=bitmap->SizeInPixels();
  4407                     
  4486                     
  4408                     if (size.iWidth>textRect.Size().iWidth)
  4487                     if (size.iWidth>textRect.Width())
  4409                         {
  4488                         {
  4410                         size.iWidth = textRect.Size().iWidth;
  4489                         size.iWidth = textRect.Width();
  4411                         }
  4490                         }
  4412                     
  4491                     
  4413                     if (size.iHeight>textRect.Size().iHeight)
  4492                     if (size.iHeight>textRect.Height())
  4414                         {
  4493                         {
  4415                         size.iHeight = textRect.Size().iHeight;
  4494                         size.iHeight = textRect.Height();
  4416                         }
  4495                         }
  4417                     
  4496                     
  4418                     TPoint bmpPos=textRect.iTl;
  4497                     TPoint bmpPos=textRect.iTl;
  4419                     bmpPos.iY+=(textRect.Height()-size.iHeight)>>1;
  4498                     bmpPos.iY+=(textRect.Height()-size.iHeight)>>1;
  4420                     switch (align)
  4499                     switch (align)
  4496         {
  4575         {
  4497         return static_cast<CEikListBox*>( iExtension->iControl );
  4576         return static_cast<CEikListBox*>( iExtension->iControl );
  4498         }
  4577         }
  4499     return NULL;
  4578     return NULL;
  4500     }
  4579     }
  4501     
  4580 
       
  4581 #ifdef __ARMCC__
       
  4582 #pragma pop
       
  4583 #endif // __ARMCC__
  4502     
  4584     
  4503 // End of File
  4585 // End of File