X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=automated-tests%2Fsrc%2Fdali-toolkit-internal%2Fdali-toolkit-test-utils%2Ftoolkit-text-utils.cpp;h=24ff3f7ef22dac8c31d40af75f123119d38ff5b2;hp=43fc5ac32bc17698dd209e5d506d5627a3e2648f;hb=ef26ad3f7e7de375b10d1f17052a78915eae2976;hpb=24d391fe222bd0fd5910e3b3481124fa23b796be diff --git a/automated-tests/src/dali-toolkit-internal/dali-toolkit-test-utils/toolkit-text-utils.cpp b/automated-tests/src/dali-toolkit-internal/dali-toolkit-test-utils/toolkit-text-utils.cpp old mode 100644 new mode 100755 index 43fc5ac..24ff3f7 --- a/automated-tests/src/dali-toolkit-internal/dali-toolkit-test-utils/toolkit-text-utils.cpp +++ b/automated-tests/src/dali-toolkit-internal/dali-toolkit-test-utils/toolkit-text-utils.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016 Samsung Electronics Co., Ltd. + * Copyright (c) 2018 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -109,7 +109,8 @@ void CreateTextModel( const std::string& text, Vector& utf32Characters = logicalModel->mText; utf32Characters.Resize( text.size() ); - const uint32_t numberOfCharacters = Utf8ToUtf32( reinterpret_cast( text.c_str() ), + const uint32_t numberOfCharacters = ( text.size() == 0) ? 0 : + Utf8ToUtf32( reinterpret_cast( text.c_str() ), text.size(), &utf32Characters[0u] ); utf32Characters.Resize( numberOfCharacters ); @@ -269,7 +270,7 @@ void CreateTextModel( const std::string& text, // Set the layout parameters. const Vector& charactersToGlyph = visualModel->mCharactersToGlyph; const Vector& glyphsPerCharacter = visualModel->mGlyphsPerCharacter; - + float outlineWidth = visualModel->GetOutlineWidth(); Layout::Parameters layoutParameters( textArea, utf32Characters.Begin(), lineBreakInfo.Begin(), @@ -281,8 +282,10 @@ void CreateTextModel( const std::string& text, charactersToGlyph.Begin(), glyphsPerCharacter.Begin(), numberOfGlyphs, - Layout::HORIZONTAL_ALIGN_BEGIN, - Layout::LineWrap::WORD ); + Text::HorizontalAlignment::BEGIN, + Text::LineWrap::WORD, + outlineWidth, + true ); Vector& lines = visualModel->mLines; @@ -339,7 +342,7 @@ void CreateTextModel( const std::string& text, layoutEngine.Align( textArea, 0u, numberOfCharacters, - Layout::HORIZONTAL_ALIGN_BEGIN, + Text::HorizontalAlignment::BEGIN, lines, alignmentOffset ); } @@ -356,8 +359,9 @@ void ConfigureTextLabel( ControllerPtr controller ) // Set cursor's width to zero. controller->GetLayoutEngine().SetCursorWidth( 0 ); + InputMethodContext inputMethodContext = InputMethodContext::New(); // Disables the text input. - controller->EnableTextInput( NULL ); + controller->EnableTextInput( NULL, inputMethodContext ); // Disables the vertical scrolling. controller->SetVerticalScrollEnabled( false ); @@ -381,8 +385,9 @@ void ConfigureTextField( ControllerPtr controller ) // Set the text layout as multi-line. controller->GetLayoutEngine().SetLayout( Layout::Engine::SINGLE_LINE_BOX ); + InputMethodContext inputMethodContext = InputMethodContext::New(); // Enables the text input. - controller->EnableTextInput( decorator ); + controller->EnableTextInput( decorator, inputMethodContext ); // Enables the vertical scrolling after the text input has been enabled. controller->SetVerticalScrollEnabled( false ); @@ -409,8 +414,9 @@ void ConfigureTextEditor( ControllerPtr controller ) // Set the text layout as multi-line. controller->GetLayoutEngine().SetLayout( Layout::Engine::MULTI_LINE_BOX ); + InputMethodContext inputMethodContext = InputMethodContext::New(); // Enables the text input. - controller->EnableTextInput( decorator ); + controller->EnableTextInput( decorator, inputMethodContext ); // Enables the vertical scrolling after the text input has been enabled. controller->SetVerticalScrollEnabled( true );