emailuis/uicomponents/src/fstextviewervisualizerdata.cpp
branchRCL_3
changeset 11 0396474f30f5
parent 0 8466d47a6819
child 12 4ce476e64c59
equal deleted inserted replaced
10:f5907b1a1053 11:0396474f30f5
   707         {
   707         {
   708         return KErrNone;
   708         return KErrNone;
   709         }
   709         }
   710 
   710 
   711     CAlfVisual* visual = NULL;
   711     CAlfVisual* visual = NULL;
   712 
   712     CFsTexture *texture = NULL;
   713     if ( aVisual->iIsText )
   713     if ( aVisual->iIsText )
   714         {
   714         {
   715         visual = CAlfTextVisual::AddNewL( *iControl, aVisual->iLayout );
   715         visual = CAlfTextVisual::AddNewL( *iControl, aVisual->iLayout );
   716         HBufC* text;
   716         HBufC* text;
   717         text = iParser->GetTextL( 
   717         text = iParser->GetTextL( 
  1016 
  1016 
  1017     if ( iVisArray.Count() > 0 )
  1017     if ( iVisArray.Count() > 0 )
  1018         {
  1018         {
  1019         retVal = iVisArray[0];
  1019         retVal = iVisArray[0];
  1020         }
  1020         }
  1021 
  1021     
  1022     for ( TInt i = 0; i < iVisArray.Count(); ++i )
  1022     if(retVal) // Coverity error fix, retVal could be NULL and used
  1023         {
  1023         {
  1024         if ( iVisArray[i]->iRect.iTl.iY >= iScreenOffset )
  1024         for ( TInt i = 0; i < iVisArray.Count(); ++i )
  1025             {
  1025             {
  1026             if ( iVisArray[i]->iRect.iTl.iY < retVal->iRect.iTl.iY )
  1026             if ( iVisArray[i]->iRect.iTl.iY >= iScreenOffset )
  1027                 {
  1027                 {
  1028                 retVal = iVisArray[i];
  1028                 if ( iVisArray[i]->iRect.iTl.iY < retVal->iRect.iTl.iY )
  1029                 }
       
  1030             else if ( iVisArray[i]->iRect.iTl.iY 
       
  1031                     == retVal->iRect.iTl.iY )
       
  1032                 {
       
  1033                 if ( iVisArray[i]->iRect.iTl.iX < retVal->iRect.iTl.iX )
       
  1034                     {
  1029                     {
  1035                     retVal = iVisArray[i];
  1030                     retVal = iVisArray[i];
  1036                     }
  1031                     }
  1037                 }
  1032                 else if ( iVisArray[i]->iRect.iTl.iY 
  1038             else if ( retVal->iRect.iTl.iY < iScreenOffset )
  1033                         == retVal->iRect.iTl.iY )
  1039                 {
  1034                     {
  1040                 retVal = iVisArray[i];
  1035                     if ( iVisArray[i]->iRect.iTl.iX < retVal->iRect.iTl.iX )
  1041                 }
  1036                         {
  1042             }
  1037                         retVal = iVisArray[i];
  1043         }
  1038                         }
  1044     
  1039                     }
  1045     return retVal;
  1040                 else if ( retVal->iRect.iTl.iY < iScreenOffset )
  1046     }
       
  1047 
       
  1048 // ---------------------------------------------------------------------------
       
  1049 // GetLastVisible
       
  1050 // ---------------------------------------------------------------------------
       
  1051 TFsRangedVisual* CFsTextViewerVisualizerData::GetLastVisible()
       
  1052     {
       
  1053     FUNC_LOG;
       
  1054     TFsRangedVisual* retVal = NULL;
       
  1055 
       
  1056     if ( iVisArray.Count() > 0 )
       
  1057         {
       
  1058         retVal = iVisArray[0];
       
  1059         }
       
  1060 
       
  1061     for ( TInt i = 0; i < iVisArray.Count(); ++i )
       
  1062         {
       
  1063         if ( iVisArray[i]->iRect.iBr.iY <= iScreenOffset + iScreenHeight )
       
  1064             {
       
  1065             if ( iVisArray[i]->iRect.iBr.iY > retVal->iRect.iBr.iY )
       
  1066                 {
       
  1067                 retVal = iVisArray[i];
       
  1068                 }
       
  1069             else if ( iVisArray[i]->iRect.iBr.iY 
       
  1070                     == retVal->iRect.iBr.iY )
       
  1071                 {
       
  1072                 if ( iVisArray[i]->iRect.iBr.iX > retVal->iRect.iBr.iX )
       
  1073                     {
  1041                     {
  1074                     retVal = iVisArray[i];
  1042                     retVal = iVisArray[i];
  1075                     }
  1043                     }
  1076                 }
  1044                 }
  1077             else 
  1045             }
  1078                 {
  1046         }
  1079                 }
  1047     return retVal;
  1080             }
  1048     }
  1081         }
  1049 
  1082 
  1050 // ---------------------------------------------------------------------------
       
  1051 // GetLastVisible
       
  1052 // ---------------------------------------------------------------------------
       
  1053 TFsRangedVisual* CFsTextViewerVisualizerData::GetLastVisible()
       
  1054     {
       
  1055     FUNC_LOG;
       
  1056     TFsRangedVisual* retVal = NULL;
       
  1057 
       
  1058     if ( iVisArray.Count() > 0 )
       
  1059         {
       
  1060         retVal = iVisArray[0];
       
  1061         }
       
  1062     if(retVal) // Coverity error fix, retval could be null and used
       
  1063         {
       
  1064         for ( TInt i = 0; i < iVisArray.Count(); ++i )
       
  1065             {
       
  1066             if ( iVisArray[i]->iRect.iBr.iY <= iScreenOffset + iScreenHeight )
       
  1067                 {
       
  1068                 if ( iVisArray[i]->iRect.iBr.iY > retVal->iRect.iBr.iY )
       
  1069                     {
       
  1070                     retVal = iVisArray[i];
       
  1071                     }
       
  1072                 else if ( iVisArray[i]->iRect.iBr.iY 
       
  1073                         == retVal->iRect.iBr.iY )
       
  1074                     {
       
  1075                     if ( iVisArray[i]->iRect.iBr.iX > retVal->iRect.iBr.iX )
       
  1076                         {
       
  1077                         retVal = iVisArray[i];
       
  1078                         }
       
  1079                     }
       
  1080                 else 
       
  1081                     {
       
  1082                     }
       
  1083                 }
       
  1084             }
       
  1085         }
  1083     return retVal;
  1086     return retVal;
  1084     }
  1087     }
  1085 
  1088 
  1086 // ---------------------------------------------------------------------------
  1089 // ---------------------------------------------------------------------------
  1087 // GetRangedVisual
  1090 // GetRangedVisual