Layout fixes
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / text / text-controller.cpp
index d86d4f5..1e9ee89 100644 (file)
@@ -58,6 +58,8 @@ struct ModifyEvent
   std::string text;
 };
 
+const std::string EMPTY_STRING("");
+
 } // namespace
 
 namespace Dali
@@ -648,8 +650,8 @@ struct Controller::TextInput
       FontId defaultFontId = 0u;
       if( NULL == mFontDefaults )
       {
-        defaultFontId = mFontClient.GetFontId( String::EMPTY,
-                                               String::EMPTY );
+        defaultFontId = mFontClient.GetFontId( EMPTY_STRING,
+                                               EMPTY_STRING );
       }
       else
       {
@@ -987,7 +989,6 @@ struct Controller::Impl
     mVisualModel->SetShadowOffset( Vector2::ZERO );
     mVisualModel->SetShadowColor( Vector4::ZERO );
     mVisualModel->SetUnderlineEnabled( false );
-    mVisualModel->SetUnderlineHeight( 0.0f );
   }
 
   ~Impl()
@@ -1097,7 +1098,7 @@ const std::string& Controller::GetDefaultFontFamily() const
     return mImpl->mFontDefaults->mDefaultFontFamily;
   }
 
-  return String::EMPTY;;
+  return EMPTY_STRING;
 }
 
 void Controller::SetDefaultFontStyle( const std::string& defaultFontStyle )
@@ -1133,7 +1134,7 @@ const std::string& Controller::GetDefaultFontStyle() const
     return mImpl->mFontDefaults->mDefaultFontStyle;
   }
 
-  return String::EMPTY;
+  return EMPTY_STRING;
 }
 
 void Controller::SetDefaultPointSize( float pointSize )
@@ -1211,11 +1212,6 @@ bool Controller::IsUnderlineEnabled() const
   return mImpl->mVisualModel->IsUnderlineEnabled();
 }
 
-float Controller::GetUnderlineHeight() const
-{
-  return mImpl->mVisualModel->GetUnderlineHeight();
-}
-
 void Controller::SetTextColor( const Vector4& textColor )
 {
   mImpl->mVisualModel->SetTextColor( textColor );
@@ -1241,11 +1237,6 @@ void Controller::SetUnderlineEnabled( bool enabled )
   mImpl->mVisualModel->SetUnderlineEnabled( enabled );
 }
 
-void Controller::SetUnderlineHeight( float height )
-{
-  mImpl->mVisualModel->SetUnderlineHeight( height );
-}
-
 void Controller::EnableTextInput( DecoratorPtr decorator )
 {
   if( !mImpl->mTextInput )
@@ -1813,6 +1804,7 @@ bool Controller::DoRelayout( const Size& size,
 
     Vector<LineBreakInfo>& lineBreakInfo = mImpl->mLogicalModel->mLineBreakInfo;
     Vector<WordBreakInfo>& wordBreakInfo = mImpl->mLogicalModel->mWordBreakInfo;
+    Vector<CharacterDirection>& characterDirection = mImpl->mLogicalModel->mCharacterDirections;
     Vector<GlyphInfo>& glyphs = mImpl->mVisualModel->mGlyphs;
     Vector<CharacterIndex>& glyphsToCharactersMap = mImpl->mVisualModel->mGlyphsToCharacters;
     Vector<Length>& charactersPerGlyph = mImpl->mVisualModel->mCharactersPerGlyph;
@@ -1822,6 +1814,7 @@ bool Controller::DoRelayout( const Size& size,
                                        mImpl->mLogicalModel->mText.Begin(),
                                        lineBreakInfo.Begin(),
                                        wordBreakInfo.Begin(),
+                                       ( 0u != characterDirection.Count() ) ? characterDirection.Begin() : NULL,
                                        numberOfGlyphs,
                                        glyphs.Begin(),
                                        glyphsToCharactersMap.Begin(),