[poppler] Indent in poppler/TextOutputDev.cc:2251-2292

mpsuzuki at hiroshima-u.ac.jp mpsuzuki at hiroshima-u.ac.jp
Sat Jul 24 01:39:12 PDT 2010


Hi,

I found there is a small part that the indent is
mismatched. I attached a patch to correct the indent.

Regards,
mpsuzuki

diff --git a/poppler/TextOutputDev.cc b/poppler/TextOutputDev.cc
index 87f6f08..c840aef 100644
--- a/poppler/TextOutputDev.cc
+++ b/poppler/TextOutputDev.cc
@@ -2251,25 +2251,25 @@ void TextPage::addChar(GfxState *state, double x, double y,
       beginWord(state, x, y);
     }
 
-  // page rotation and/or transform matrices can cause text to be
-  // drawn in reverse order -- in this case, swap the begin/end
-  // coordinates and break text into individual chars
-  if ((curWord->rot == 0 && w1 < 0) ||
-      (curWord->rot == 1 && h1 < 0) ||
-      (curWord->rot == 2 && w1 > 0) ||
-      (curWord->rot == 3 && h1 > 0)) {
-    endWord();
-    beginWord(state, x + dx, y + dy);
-    x1 += w1;
-    y1 += h1;
-    w1 = -w1;
-    h1 = -h1;
-  }
+    // page rotation and/or transform matrices can cause text to be
+    // drawn in reverse order -- in this case, swap the begin/end
+    // coordinates and break text into individual chars
+    if ((curWord->rot == 0 && w1 < 0) ||
+        (curWord->rot == 1 && h1 < 0) ||
+        (curWord->rot == 2 && w1 > 0) ||
+        (curWord->rot == 3 && h1 > 0)) {
+      endWord();
+      beginWord(state, x + dx, y + dy);
+      x1 += w1;
+      y1 += h1;
+      w1 = -w1;
+      h1 = -h1;
+    }
 
-  // add the characters to the current word
+    // add the characters to the current word
     w1 /= uLen;
     h1 /= uLen;
-  for (i = 0; i < uLen; ++i) {
+    for (i = 0; i < uLen; ++i) {
       if (u[i] >= 0xd800 && u[i] < 0xdc00) { /* surrogate pair */
 	if (i + 1 < uLen && u[i+1] >= 0xdc00 && u[i+1] < 0xe000) {
 	  /* next code is a low surrogate */
@@ -2288,7 +2288,7 @@ void TextPage::addChar(GfxState *state, double x, double y,
       } else {
 	curWord->addChar(state, x1 + i*w1, y1 + i*h1, w1, h1, c, u[i]);
       }
-  }
+    }
   }
   if (curWord) {
     curWord->charLen += nBytes;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: improve-indent_20100724-mps.diff
Type: text/x-diff
Size: 1845 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/poppler/attachments/20100724/551e84a4/attachment.diff>


More information about the poppler mailing list