browserutilities/browserdialogsprovider/Src/BrowserDialogsProvider.cpp
branchRCL_3
changeset 36 c711bdda59f4
parent 35 1f3c3f2f5b0a
child 41 4bd5176e1bc8
--- a/browserutilities/browserdialogsprovider/Src/BrowserDialogsProvider.cpp	Mon Mar 15 12:44:50 2010 +0200
+++ b/browserutilities/browserdialogsprovider/Src/BrowserDialogsProvider.cpp	Wed Mar 31 23:16:40 2010 +0300
@@ -690,11 +690,14 @@
 												HBufC*& aReturnedInput )
 	{
     TBool retVal;
-
-	// defInput is not modified by the dialog.
-    TPtr defInput( (TUint16*) aDefaultInput.Ptr(), aDefaultInput.Length(), 
-													    KMaxAltTextLength );
-
+    TInt length = aDefaultInput.Length();
+    if ( aDefaultInput.Length() > KMaxAltTextLength )
+        {
+        length = KMaxAltTextLength;
+        }
+    // defInput is not modified by the dialog.Truncate if length is greater than KMaxAltTextLength 
+    TPtr defInput( (TUint16*) aDefaultInput.Ptr(), length, KMaxAltTextLength );
+    
     CBrowserScriptPromptDialog* dialog = 
 		new (ELeave) CBrowserScriptPromptDialog( defInput, aReturnedInput );