textinput/peninputarc/src/peninputlayoutcontrol/peninputlayoutmultilineicfeditor.cpp
branchRCL_3
changeset 5 a47de9135b21
parent 3 f5a1e66df979
child 7 6defe5d1bd39
--- a/textinput/peninputarc/src/peninputlayoutcontrol/peninputlayoutmultilineicfeditor.cpp	Fri Feb 19 23:09:27 2010 +0200
+++ b/textinput/peninputarc/src/peninputlayoutcontrol/peninputlayoutmultilineicfeditor.cpp	Fri Mar 12 15:44:07 2010 +0200
@@ -967,26 +967,35 @@
         }
     TPtrC icftext = editArea->iRichText->Read(editArea->iPromptTextLen, 
                                               editArea->iRichText->DocumentLength());
-    TInt startPos = icftext.LocateReverse(KStar) + 1 + editArea->iPromptTextLen;
-
-    TBuf<1> buf;
-    buf.Append(KStar);
-
-    TInt textlen = editArea->iRichText->DocumentLength();
-
-    if (startPos < textlen)
+    
+    for (TInt i = 0; i < icftext.Length(); i++)
         {
-        editArea->iRichText->DeleteL(startPos, 1);
-        editArea->iTextView->HandleInsertDeleteL(TCursorSelection(startPos, startPos), 1);
-        editArea->iRichText->InsertL(startPos, buf);
-        editArea->iTextView->HandleInsertDeleteL(TCursorSelection(startPos, startPos+buf.Length()),
-                                                 0);
+        if (icftext[i] != KStar)//find only one none-star char
+            {
+            TInt startPos = i + editArea->iPromptTextLen;
+            TBuf<1> buf;
+            buf.Append(KStar);
+
+            TInt textlen = editArea->iRichText->DocumentLength();
 
-        if (startPos == textlen - 1)
-            {
-            editArea->iSecretTextTimer->Cancel();
+            if (startPos < textlen)
+                {
+                editArea->iRichText->DeleteL(startPos, 1);
+                editArea->iTextView->HandleInsertDeleteL(TCursorSelection(
+                        startPos, startPos), 1);
+                editArea->iRichText->InsertL(startPos, buf);
+                editArea->iTextView->HandleInsertDeleteL(TCursorSelection(
+                        startPos, startPos + buf.Length()), 0);
+
+                if (startPos == textlen - 1)
+                    {
+                    editArea->iSecretTextTimer->Cancel();
+                    }
+                }
+            break;
             }
         }
+    
     editArea->UpdateArea(editArea->Rect(),EFalse);
     return KErrNone;
     }
@@ -2654,11 +2663,9 @@
 void CFepLayoutMultiLineIcfEditor::ShowByteWarningBubble(const TDesC& aInfo)
     {
     TSize size = iInfoBubble->Rect().Size();
-    CFont::TMeasureTextInput*  input = new (ELeave) CFont::TMeasureTextInput;
-    CleanupStack::PushL(input);
-    input->iMaxBounds = iRect.Width();
-    TInt width = iFont->MeasureText(aInfo, input, NULL);
-    CleanupStack::PopAndDestroy();
+    CFont::TMeasureTextInput input;// = new (ELeave) CFont::TMeasureTextInput;
+    input.iMaxBounds = iRect.Width();
+    TInt width = iFont->MeasureText(aInfo, &input, NULL);
     size.SetSize(width, size.iHeight);
     SetInfoBubbleCtrlSize(size);
     TRAP_IGNORE(iInfoBubble->SetTextL(aInfo));
@@ -2973,7 +2980,6 @@
             CPeninputSmileyImage* smiley = iSmileyManager->SmileyImage( code );
             if ( smiley )
                 {
-                gc.SetBrushColor( TRgb(255,0,0) );
                 gc.SetBrushStyle( CGraphicsContext::ENullBrush );
                 
                 smiley->SetImageSize( rect.Size() );