[jsword-svn] r1767 - in trunk: bibledesktop/src/main/resources/xsl/cswing common jsword/src/main/java/org/crosswire/jsword/book jsword/src/main/java/org/crosswire/jsword/book/basic

dmsmith at www.crosswire.org dmsmith at www.crosswire.org
Sun Feb 17 07:25:50 MST 2008


Author: dmsmith
Date: 2008-02-17 07:25:49 -0700 (Sun, 17 Feb 2008)
New Revision: 1767

Modified:
   trunk/bibledesktop/src/main/resources/xsl/cswing/simple.xsl
   trunk/common/JSwordDictionary.txt
   trunk/jsword/src/main/java/org/crosswire/jsword/book/OSISUtil.java
   trunk/jsword/src/main/java/org/crosswire/jsword/book/basic/AbstractPassageBook.java
Log:
Fix whitespace bug in viewing passage with preverse titles.
Fix a heading bug, where headings don't always show up.

Modified: trunk/bibledesktop/src/main/resources/xsl/cswing/simple.xsl
===================================================================
--- trunk/bibledesktop/src/main/resources/xsl/cswing/simple.xsl	2008-02-17 03:07:45 UTC (rev 1766)
+++ trunk/bibledesktop/src/main/resources/xsl/cswing/simple.xsl	2008-02-17 14:25:49 UTC (rev 1767)
@@ -289,12 +289,6 @@
   <!--=======================================================================-->
   <!-- Handle verses as containers and as a start verse.                     -->
   <xsl:template match="verse[not(@eID)]">
-    <!-- If the verse doesn't start on its own line and -->
-    <!-- the verse is not the first verse of a set of siblings, -->
-    <!-- output an extra space. -->
-    <xsl:if test="$VLine = 'false' and preceding-sibling::*[local-name() = 'verse']">
-      <xsl:text>&#160;</xsl:text>
-    </xsl:if>
     <!-- output each preverse element in turn -->
     <xsl:for-each select=".//*[@subType = 'x-preverse' or @subtype = 'x-preverse']">
       <xsl:choose>
@@ -311,6 +305,12 @@
     </xsl:for-each>
     <!-- Handle the KJV paragraph marker. -->
     <xsl:if test="milestone[@type = 'x-p']"><br/><br/></xsl:if>
+    <!-- If the verse doesn't start on its own line and -->
+    <!-- the verse is not the first verse of a set of siblings, -->
+    <!-- output an extra space. -->
+    <xsl:if test="$VLine = 'false' and preceding-sibling::*[local-name() = 'verse']">
+      <xsl:text>&#160;</xsl:text>
+    </xsl:if>
     <!-- Always output the verse -->
     <xsl:choose>
  	  <xsl:when test="$VLine = 'true'">

Modified: trunk/common/JSwordDictionary.txt
===================================================================
--- trunk/common/JSwordDictionary.txt	2008-02-17 03:07:45 UTC (rev 1766)
+++ trunk/common/JSwordDictionary.txt	2008-02-17 14:25:49 UTC (rev 1767)
@@ -36,3 +36,6 @@
 externalize
 tooltip
 awt
+toolbar
+ctrl
+alt

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/OSISUtil.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/OSISUtil.java	2008-02-17 03:07:45 UTC (rev 1766)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/OSISUtil.java	2008-02-17 14:25:49 UTC (rev 1767)
@@ -181,6 +181,11 @@
     public static final String VARIANT_CLASS = "x-class"; //$NON-NLS-1$
 
     /**
+     * Constant for JSword generated content. Used for type or subType.
+     */
+    public static final String GENERATED_CONTENT = "x-gen"; //$NON-NLS-1$
+
+    /**
      * Constant for the pos (part of speech) type.
      */
     public static final String POS_TYPE = "x-pos"; //$NON-NLS-1$

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/basic/AbstractPassageBook.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/basic/AbstractPassageBook.java	2008-02-17 03:07:45 UTC (rev 1766)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/basic/AbstractPassageBook.java	2008-02-17 14:25:49 UTC (rev 1767)
@@ -62,6 +62,7 @@
      */
     public Iterator getOsisIterator(Key key, boolean allowEmpty) throws BookException
     {
+        // Note: allowEmpty indicates parallel view
         // TODO(DMS): make the iterator be demand driven
         try
         {
@@ -69,17 +70,17 @@
 
             // For all the ranges in this Passage
             Passage ref = KeyUtil.getPassage(key);
-            boolean hasRanges = ref.hasRanges(RestrictionType.CHAPTER);
+            boolean showTitles = ref.hasRanges(RestrictionType.CHAPTER) || !allowEmpty;
             Iterator rit = ref.rangeIterator(RestrictionType.CHAPTER);
 
             while (rit.hasNext())
             {
                 VerseRange range = (VerseRange) rit.next();
 
-                // Only add the title if there are multiple ranges
-                if (hasRanges)
+                if (showTitles)
                 {
                     Element title = OSISUtil.factory().createTitle();
+                    title.setAttribute(OSISUtil.OSIS_ATTR_TYPE, OSISUtil.GENERATED_CONTENT);
                     title.addContent(range.getName());
                     content.add(title);
                 }




More information about the jsword-svn mailing list