TextView - Remove groups of words.
[platform/core/uifw/dali-toolkit.git] / base / dali-toolkit / internal / controls / text-view / text-processor.cpp
index ecb2c74..1eeac3a 100644 (file)
@@ -1,26 +1,26 @@
-//
-// Copyright (c) 2014 Samsung Electronics Co., Ltd.
-//
-// Licensed under the Flora License, Version 1.0 (the License);
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://floralicense.org/license/
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an AS IS BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
+/*
+ * Copyright (c) 2014 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// FILE HEADER
+#include <dali-toolkit/internal/controls/text-view/text-processor.h>
 
 // EXTERNAL INCLUDES
 #include <fribidi/fribidi.h>
 
-// INTERNAL INCLUDES
-
-#include <dali-toolkit/public-api/markup-processor/markup-processor.h>
-
 namespace Dali
 {
 
@@ -182,7 +182,7 @@ bool ContainsRightToLeftCharacter( const Dali::Text& text )
 }
 
 void ConvertBidirectionalText( const MarkupProcessor::StyledTextArray& line,
-                               std::vector<MarkupProcessor::StyledTextArray>& convertedText,
+                               MarkupProcessor::StyledTextArray& convertedText,
                                std::vector<int>& logicalToVisualMap,
                                std::vector<int>& visualToLogicalMap )
 {
@@ -247,44 +247,18 @@ void ConvertBidirectionalText( const MarkupProcessor::StyledTextArray& line,
     // To assign the original style is needed to use the characterLogicalToVisualMap table.
     Text text( &bidiTextConverted[0] );
 
-    // Split the line in groups of words.
-    // Words are grouped if they can be displayed left to right or right to left.
+    // Split the line in words.
     // Add the correct styles for the characters after they are reordered.
 
-    MarkupProcessor::StyledTextArray groupOfWords;
-
-    Character::CharacterDirection previousDirection = ( BeginsRightToLeftCharacter( line ) ? Character::RightToLeft : Character::LeftToRight );
     for( size_t i = 0; i < length; ++i )
     {
       const Character character( text[i] );
 
-      Character::CharacterDirection currentDirection = character.GetCharacterDirection();
-      if( Character::Neutral == currentDirection )
-      {
-        currentDirection = previousDirection;
-      }
-
       MarkupProcessor::StyledText styledText;
       styledText.mText.Append( character );
       styledText.mStyle = line[visualToLogicalMap[i]].mStyle;
 
-      if( currentDirection != previousDirection )
-      {
-        if( !groupOfWords.empty() )
-        {
-          convertedText.push_back( groupOfWords );
-          groupOfWords.clear();
-        }
-      }
-
-      groupOfWords.push_back( styledText );
-
-      previousDirection = currentDirection;
-    }
-
-    if( !groupOfWords.empty() )
-    {
-      convertedText.push_back( groupOfWords );
+      convertedText.push_back( styledText );
     }
   }
 }