[Tizen] Change for fribidi update 04/176004/1
authorSeungho, Baek <sbsh.baek@samsung.com>
Mon, 16 Apr 2018 05:59:09 +0000 (14:59 +0900)
committerSeungho, Baek <sbsh.baek@samsung.com>
Mon, 16 Apr 2018 05:59:15 +0000 (14:59 +0900)
This reverts commit 75b013287dcd68f291941c894be9247dab0a2ab8.

Change-Id: I8ab9b2e4849512d4cd6e8a34f86a365a3765dac1

dali/internal/text/text-abstraction/bidirectional-support-impl.cpp

index 4d38955..10ce56d 100644 (file)
@@ -24,6 +24,7 @@
 // EXTERNAL INCLUDES
 #include <memory.h>
 #include <fribidi/fribidi.h>
+#include <dali/integration-api/debug.h>
 
 namespace Dali
 {
@@ -152,7 +153,12 @@ struct BidirectionalSupport::Plugin
     bidirectionalInfo->paragraphDirection = fribidi_get_par_direction( bidirectionalInfo->characterTypes, numberOfCharacters );
 
     // Retrieve the embedding levels.
-    fribidi_get_par_embedding_levels( bidirectionalInfo->characterTypes, numberOfCharacters, &bidirectionalInfo->paragraphDirection, bidirectionalInfo->embeddedLevels );
+    if (fribidi_get_par_embedding_levels( bidirectionalInfo->characterTypes, numberOfCharacters, &bidirectionalInfo->paragraphDirection, bidirectionalInfo->embeddedLevels ) == 0)
+    {
+      free( bidirectionalInfo->characterTypes );
+      delete bidirectionalInfo;
+      return 0;
+    }
 
     // Store the bidirectional info and return the index.
     BidiInfoIndex index = 0u;
@@ -225,14 +231,17 @@ struct BidirectionalSupport::Plugin
       memcpy( embeddedLevels, bidirectionalInfo->embeddedLevels + firstCharacterIndex,  embeddedLevelsSize );
 
       // Reorder the line.
-      fribidi_reorder_line( flags,
-                            bidirectionalInfo->characterTypes + firstCharacterIndex,
-                            numberOfCharacters,
-                            0u,
-                            bidirectionalInfo->paragraphDirection,
-                            embeddedLevels,
-                            NULL,
-                            reinterpret_cast<FriBidiStrIndex*>( visualToLogicalMap ) );
+      if (fribidi_reorder_line( flags,
+                                bidirectionalInfo->characterTypes + firstCharacterIndex,
+                                numberOfCharacters,
+                                0u,
+                                bidirectionalInfo->paragraphDirection,
+                                embeddedLevels,
+                                NULL,
+                                reinterpret_cast<FriBidiStrIndex*>( visualToLogicalMap ) ) == 0)
+      {
+        DALI_LOG_ERROR("fribidi_reorder_line is failed\n");
+      }
 
       // Free resources.
       free( embeddedLevels );