TextInput - Disable markup processor
authorVictor Cebollada <v.cebollada@samsung.com>
Wed, 14 May 2014 14:12:05 +0000 (15:12 +0100)
committerAdeel Kazmi <adeel.kazmi@samsung.com>
Tue, 27 May 2014 14:35:21 +0000 (15:35 +0100)
[problem] Strings like <html> are interpreted and not shown.
[cause] markup processor is enabled.
[solution] disable markup processor.

Change-Id: Ibe0e6ab5e9b5cbd600eb34120a1bbf10ab072899
Signed-off-by: Victor Cebollada <v.cebollada@samsung.com>
base/dali-toolkit/internal/controls/text-input/text-input-impl.cpp
base/dali-toolkit/public-api/markup-processor/markup-processor.cpp

index 88bd454..5ce0daf 100644 (file)
@@ -327,7 +327,7 @@ TextInput::TextInput()
  mUnderlinedPriorToPreEdit ( false ),
  mCommitByKeyInput( false ),
  mPlaceHolderSet( false ),
  mUnderlinedPriorToPreEdit ( false ),
  mCommitByKeyInput( false ),
  mPlaceHolderSet( false ),
- mMarkUpEnabled( true )
+ mMarkUpEnabled( false )
 {
   // Updates the line height accordingly with the input style.
   UpdateLineHeight();
 {
   // Updates the line height accordingly with the input style.
   UpdateLineHeight();
index 995253a..f26a04b 100644 (file)
@@ -548,7 +548,18 @@ void GetStyledTextArray( const std::string& markupString, StyledTextArray& style
 
   if ( !scanForMarkup )
   {
 
   if ( !scanForMarkup )
   {
-    styledTextArray.push_back( StyledText( Text( markupString ), TextStyle() ) );
+    const Text text( markupString );
+    const std::size_t size = text.GetLength();
+
+    styledTextArray.resize( size, StyledText( Text(), TextStyle() ) );
+
+    std::size_t index = 0;
+    for( StyledTextArray::iterator it = styledTextArray.begin(), endIt = styledTextArray.end(); it != endIt; ++it, ++index )
+    {
+      StyledText& styledText( *it );
+
+      styledText.mText.Append( text[index] );
+    }
     return;
   }
 
     return;
   }