Merge "Send the empty string to IME when PlaceholderText shows" into devel/master
authorSeoyeon Kim <seoyeon2.kim@samsung.com>
Tue, 12 Dec 2017 10:21:28 +0000 (10:21 +0000)
committerGerrit Code Review <gerrit@review.ap-northeast-2.compute.internal>
Tue, 12 Dec 2017 10:21:28 +0000 (10:21 +0000)
automated-tests/src/dali-toolkit/utc-Dali-TextLabel.cpp
dali-toolkit/internal/text/multi-language-support-impl.cpp
dali-toolkit/internal/text/text-controller.cpp
dali-toolkit/public-api/controls/image-view/image-view.h
dali-toolkit/public-api/dali-toolkit-version.cpp
packaging/dali-toolkit.spec

index 45214f8..35e1ae7 100644 (file)
@@ -1163,18 +1163,15 @@ int UtcDaliToolkitTextlabelTextDirection(void)
   tet_infoline(" UtcDaliToolkitTextlabelTextDirection");
 
   TextLabel label = TextLabel::New();
+  DALI_TEST_EQUALS( label.GetProperty< int >( DevelTextLabel::Property::TEXT_DIRECTION ), static_cast< int >( Toolkit::DevelText::TextDirection::LEFT_TO_RIGHT ), TEST_LOCATION );
+
   label.SetProperty( TextLabel::Property::TEXT, "Hello world" );
   label.SetProperty( TextLabel::Property::POINT_SIZE, 20 );
   Stage::GetCurrent().Add( label );
 
-  application.SendNotification();
-  application.Render();
-
   DALI_TEST_EQUALS( label.GetProperty< int >( DevelTextLabel::Property::TEXT_DIRECTION ), static_cast< int >( Toolkit::DevelText::TextDirection::LEFT_TO_RIGHT ), TEST_LOCATION );
 
   label.SetProperty( TextLabel::Property::TEXT, "ﻡﺮﺤﺑﺍ ﺏﺎﻠﻋﺎﻠﻣ ﻡﺮﺤﺑﺍ" );
-  application.SendNotification();
-  application.Render();
   DALI_TEST_EQUALS( label.GetProperty< int >( DevelTextLabel::Property::TEXT_DIRECTION ), static_cast< int >( Toolkit::DevelText::TextDirection::RIGHT_TO_LEFT ), TEST_LOCATION );
 
   END_TEST;
index e88a286..990d0ce 100644 (file)
@@ -451,10 +451,6 @@ void MultilanguageSupport::ValidateFonts( const Vector<Character>& text,
   FontId previousFontId = 0u;
   bool isPreviousEmojiScript = false;
 
-  // Whether it's the first set of characters to be validated.
-  // Used in case the paragraph starts with characters common to all scripts.
-  bool isFirstSetToBeValidated = true;
-
   CharacterIndex lastCharacter = startIndex + numberOfCharacters;
   for( Length index = startIndex; index < lastCharacter; ++index )
   {
@@ -705,12 +701,6 @@ void MultilanguageSupport::ValidateFonts( const Vector<Character>& text,
     }
 #endif
 
-    if( isFirstSetToBeValidated && !isCommonScript )
-    {
-      currentFontRun.fontId = fontId;
-      isFirstSetToBeValidated = false;
-    }
-
     // The font is now validated.
     if( ( fontId != currentFontRun.fontId ) ||
         isNewParagraphCharacter )
@@ -728,11 +718,6 @@ void MultilanguageSupport::ValidateFonts( const Vector<Character>& text,
       currentFontRun.characterRun.characterIndex = currentFontRun.characterRun.characterIndex + currentFontRun.characterRun.numberOfCharacters;
       currentFontRun.characterRun.numberOfCharacters = 0u;
       currentFontRun.fontId = fontId;
-
-      if( isNewParagraphCharacter )
-      {
-        isFirstSetToBeValidated = true;
-      }
     }
 
     // Add one more character to the run.
index 27b982f..9fa42f1 100755 (executable)
@@ -2105,8 +2105,15 @@ void Controller::GetPlaceholderProperty( Property::Map& map )
 
 Toolkit::DevelText::TextDirection::Type Controller::GetTextDirection()
 {
-  const LineRun* const firstline = mImpl->mModel->mVisualModel->mLines.Begin();
-  if ( firstline && firstline->direction )
+  if( ( 0u == mImpl->mModel->mLogicalModel->mText.Count() ) )
+  {
+    return Toolkit::DevelText::TextDirection::LEFT_TO_RIGHT;
+  }
+
+  const Character character = mImpl->mModel->mLogicalModel->mText[0];
+  Script script = TextAbstraction::GetCharacterScript( character );
+
+  if( TextAbstraction::IsRightToLeftScript( script ) )
   {
     return Toolkit::DevelText::TextDirection::RIGHT_TO_LEFT;
   }
@@ -3707,7 +3714,7 @@ bool Controller::DeleteEvent( int keyCode )
                           1,
                           UPDATE_INPUT_STYLE );
   }
-  else if( ( mImpl->mEventData->mPrimaryCursorPosition >= 0 ) && ( keyCode == Dali::DevelKey::DALI_KEY_DELETE ) )
+  else if( keyCode == Dali::DevelKey::DALI_KEY_DELETE )
   {
     // Remove the character after the current cursor position
     removed = RemoveText( 0,
@@ -3846,6 +3853,7 @@ void Controller::ClearFontData()
   mImpl->mOperationsPending = static_cast<OperationsMask>( mImpl->mOperationsPending |
                                                            VALIDATE_FONTS            |
                                                            SHAPE_TEXT                |
+                                                           BIDI_INFO                 |
                                                            GET_GLYPH_METRICS         |
                                                            LAYOUT                    |
                                                            UPDATE_LAYOUT_SIZE        |
index ac2befa..7c99a5f 100644 (file)
@@ -48,7 +48,7 @@ class ImageView;
  * ResouceReadySignal is done after the resource is set then signal will be missed.
  *
  * To protect against this, IsResourceReady() can be checked before connecting to ResourceReadySignal,
- * or the signal connection can be done before setting the resource"
+ * or the signal connection can be done before setting the resource.
  *
  * @code
  *    auto myImageView = ImageView::New( resourceUrl );
index e1226ce..6ed8280 100644 (file)
@@ -31,7 +31,7 @@ namespace Toolkit
 
 const unsigned int TOOLKIT_MAJOR_VERSION = 1;
 const unsigned int TOOLKIT_MINOR_VERSION = 3;
-const unsigned int TOOLKIT_MICRO_VERSION = 2;
+const unsigned int TOOLKIT_MICRO_VERSION = 3;
 const char * const TOOLKIT_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifdef DEBUG_ENABLED
index 4cbdb9e..b1b4cef 100644 (file)
@@ -1,6 +1,6 @@
 Name:       dali-toolkit
 Summary:    Dali 3D engine Toolkit
-Version:    1.3.2
+Version:    1.3.3
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0 and BSD-3-Clause and MIT