Change for fribidi update 00/175600/3
authorminho.sun <minho.sun@samsung.com>
Wed, 11 Apr 2018 04:50:18 +0000 (13:50 +0900)
committerHeeyong Song <heeyong.song@samsung.com>
Thu, 19 Apr 2018 05:45:02 +0000 (05:45 +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 4d389550d5a4df82f27660559a649921cfd38829..10ce56d13c7f8a030536ff7b06ccf38f8067b131 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 );