[jsword-svn] r2019 - trunk/jsword/src/main/java/org/crosswire/jsword/book

dmsmith at crosswire.org dmsmith at crosswire.org
Wed Nov 24 16:13:51 MST 2010


Author: dmsmith
Date: 2010-11-24 16:13:51 -0700 (Wed, 24 Nov 2010)
New Revision: 2019

Modified:
   trunk/jsword/src/main/java/org/crosswire/jsword/book/OSISUtil.java
Log:
BD-163: Changed OSISUtil line 666 to be executed only when text.length() > 0.

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/OSISUtil.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/OSISUtil.java	2010-11-23 01:45:42 UTC (rev 2018)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/OSISUtil.java	2010-11-24 23:13:51 UTC (rev 2019)
@@ -663,10 +663,13 @@
                 // containing entities.
                 int lastIndex = buffer.length() - 1;
                 String text = ((Text) data).getText();
-                if (lastIndex >= 0 && !Character.isWhitespace(buffer.charAt(lastIndex)) && !Character.isWhitespace(text.charAt(0))) {
-                    buffer.append(' ');
+                // Ignore empty text nodes.
+                if (text.length() != 0) {
+                    if (lastIndex >= 0 && !Character.isWhitespace(buffer.charAt(lastIndex)) && !Character.isWhitespace(text.charAt(0))) {
+                        buffer.append(' ');
+                    }
+                    buffer.append(text);
                 }
-                buffer.append(text);
             }
         }
 




More information about the jsword-svn mailing list