X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Ftext-controls%2Ftext-editor-impl.cpp;h=c719798779d074d8002fe879005f1d60e8c9b9bb;hp=5cb7df1be10f1740b385491f2ac43e34041608f6;hb=eac074bfe3a3c144f55583135515d2c8d16eb479;hpb=f090b040537e2a5a60a6dc80009ade9b72d37d4b diff --git a/dali-toolkit/internal/controls/text-controls/text-editor-impl.cpp b/dali-toolkit/internal/controls/text-controls/text-editor-impl.cpp index 5cb7df1..c719798 100644 --- a/dali-toolkit/internal/controls/text-controls/text-editor-impl.cpp +++ b/dali-toolkit/internal/controls/text-controls/text-editor-impl.cpp @@ -32,11 +32,13 @@ // INTERNAL INCLUDES #include +#include #include #include #include #include #include +#include #include #include #include @@ -67,16 +69,6 @@ const float DEFAULT_SCROLL_SPEED = 1200.f; ///< The default scroll speed for the namespace { - -const Scripting::StringEnum HORIZONTAL_ALIGNMENT_STRING_TABLE[] = -{ - { "BEGIN", Toolkit::Text::Layout::HORIZONTAL_ALIGN_BEGIN }, - { "CENTER", Toolkit::Text::Layout::HORIZONTAL_ALIGN_CENTER }, - { "END", Toolkit::Text::Layout::HORIZONTAL_ALIGN_END }, -}; -const unsigned int HORIZONTAL_ALIGNMENT_STRING_TABLE_COUNT = sizeof( HORIZONTAL_ALIGNMENT_STRING_TABLE ) / sizeof( HORIZONTAL_ALIGNMENT_STRING_TABLE[0] ); - - const Scripting::StringEnum LINE_WRAP_MODE_STRING_TABLE[] = { { "WORD", Toolkit::Text::Layout::LineWrap::WORD }, @@ -262,11 +254,9 @@ void TextEditor::SetProperty( BaseObject* object, Property::Index index, const P const std::string& alignStr = value.Get< std::string >(); DALI_LOG_INFO( gLogFilter, Debug::General, "TextEditor %p HORIZONTAL_ALIGNMENT %s\n", impl.mController.Get(), alignStr.c_str() ); - Layout::HorizontalAlignment alignment( Layout::HORIZONTAL_ALIGN_BEGIN ); - if( Scripting::GetEnumeration< Layout::HorizontalAlignment >( alignStr.c_str(), - HORIZONTAL_ALIGNMENT_STRING_TABLE, - HORIZONTAL_ALIGNMENT_STRING_TABLE_COUNT, - alignment ) ) + Text::HorizontalAlignment::Type alignment( Text::HorizontalAlignment::BEGIN ); + + Text::GetHorizontalAlignmentEnum( value, alignment ); { impl.mController->SetHorizontalAlignment( alignment ); } @@ -801,9 +791,7 @@ Property::Value TextEditor::GetProperty( BaseObject* object, Property::Index ind { if( impl.mController ) { - const char* name = Scripting::GetEnumerationName< Toolkit::Text::Layout::HorizontalAlignment >( impl.mController->GetHorizontalAlignment(), - HORIZONTAL_ALIGNMENT_STRING_TABLE, - HORIZONTAL_ALIGNMENT_STRING_TABLE_COUNT ); + const char* name = GetHorizontalAlignmentString( impl.mController->GetHorizontalAlignment() ); if( name ) { value = std::string( name );