[poppler] poppler/UnicodeTypeTable.cc

Albert Astals Cid aacid at kemper.freedesktop.org
Fri May 27 09:06:26 UTC 2016


 poppler/UnicodeTypeTable.cc |   21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

New commits:
commit 46039c2ef5b666d5ee85e7f6fc6a74a5a9e69526
Author: Albert Astals Cid <aacid at kde.org>
Date:   Fri May 27 11:06:01 2016 +0200

    Add braces to make it more clear to which if the else applies

diff --git a/poppler/UnicodeTypeTable.cc b/poppler/UnicodeTypeTable.cc
index c9f8e2a..cd423c9 100644
--- a/poppler/UnicodeTypeTable.cc
+++ b/poppler/UnicodeTypeTable.cc
@@ -15,7 +15,7 @@
 //
 // Copyright (C) 2006, 2007 Ed Catmur <ed at catmur.co.uk>
 // Copyright (C) 2007 Jeff Muizelaar <jeff at infidigm.net>
-// Copyright (C) 2008 Albert Astals Cid <aacid at kde.org>
+// Copyright (C) 2008, 2016 Albert Astals Cid <aacid at kde.org>
 // Copyright (C) 2012 Adrian Johnson <ajohnson at redneon.com>
 // Copyright (C) 2016 Khaled Hosny <khaledhosny at eglug.org>
 //
@@ -1028,16 +1028,19 @@ static int decomp_compat(Unicode u, Unicode *buf, GBool reverseRTL = false) {
       int midpoint = (start + end) / 2;
       if (u == decomp_table[midpoint].character) {
 	int offset = decomp_table[midpoint].offset;
-	if (offset == -1)
+	if (offset == -1) {
 	  break;
-	else {
+	} else {
 	  int length = decomp_table[midpoint].length, i;
-	  if (buf)
-	    for (i = 0; i < length; ++i)
-		if (unicodeTypeR(u) && reverseRTL)
-		  buf[i] = decomp_expansion[offset + length - i - 1];
-		else
-		  buf[i] = decomp_expansion[offset + i];
+	  if (buf) {
+	    for (i = 0; i < length; ++i) {
+	      if (unicodeTypeR(u) && reverseRTL) {
+		buf[i] = decomp_expansion[offset + length - i - 1];
+	      } else {
+		buf[i] = decomp_expansion[offset + i];
+	      }
+	    }
+	  }
 	  return length;
 	}
       } else if (midpoint == start)


More information about the poppler mailing list