[Tizen] Change for fribidi update 05/175605/4
authorminho.sun <minho.sun@samsung.com>
Wed, 11 Apr 2018 04:50:18 +0000 (13:50 +0900)
committerHeeyong Song <heeyong.song@samsung.com>
Thu, 12 Apr 2018 01:30:14 +0000 (01:30 +0000)
In new fribidi version, we should use return of some APIs.
If don't use return values, fribidi makes warning.

So fix to use return values.

Signed-off-by: minho.sun <minho.sun@samsung.com>
Please enter the commit message for your changes. Lines starting
with '#' will be ignored, and an empty message aborts the commit.
On branch devel/master

Change-Id: Iddff19439774090f92739c58c9093ce401c171fc

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 );