[jsword-svn] r1465 - in trunk/jsword/src/main/java/org/crosswire/jsword/book: . sword
dmsmith at www.crosswire.org
dmsmith at www.crosswire.org
Sun Jul 1 19:36:28 MST 2007
Author: dmsmith
Date: 2007-07-01 19:36:28 -0700 (Sun, 01 Jul 2007)
New Revision: 1465
Modified:
trunk/jsword/src/main/java/org/crosswire/jsword/book/BookMetaData.java
trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/ConfigEntryTable.java
trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/ConfigEntryType.java
trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/SwordBookMetaData.java
Log:
potential bug fix
Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/BookMetaData.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/BookMetaData.java 2007-07-02 02:34:40 UTC (rev 1464)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/BookMetaData.java 2007-07-02 02:36:28 UTC (rev 1465)
@@ -159,7 +159,7 @@
/**
* Return the orientation of the language of the Book. If a book contains more than one language,
* it refers to the dominate language of the book. This will be used to present
- * Arabic and Hebrew in their propper orientation.
+ * Arabic and Hebrew in their proper orientation.
* @return true if the orientation for the dominate language is LeftToRight.
*/
boolean isLeftToRight();
Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/ConfigEntryTable.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/ConfigEntryTable.java 2007-07-02 02:34:40 UTC (rev 1464)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/ConfigEntryTable.java 2007-07-02 02:36:28 UTC (rev 1465)
@@ -572,6 +572,10 @@
private void adjustDataPath()
{
String datapath = (String) getValue(ConfigEntryType.DATA_PATH);
+ if (datapath == null)
+ {
+ datapath = ""; //$NON-NLS-1$
+ }
if (datapath.startsWith("./")) //$NON-NLS-1$
{
add(ConfigEntryType.DATA_PATH, datapath.substring(2));
Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/ConfigEntryType.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/ConfigEntryType.java 2007-07-02 02:34:40 UTC (rev 1464)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/ConfigEntryType.java 2007-07-02 02:36:28 UTC (rev 1465)
@@ -493,7 +493,7 @@
public static final ConfigEntryType DESCRIPTION = new ConfigEntryType("Description"); //$NON-NLS-1$
/**
- * The layout direction of the text in the book. Hebrew and Arabic is RtoL. Most are 'LtoR'.
+ * The layout direction of the text in the book. Hebrew, Arabic and Farsi RtoL. Most are 'LtoR'.
* Some are 'bidi', bi-directional. E.g. hebrew-english glossary.
*/
public static final ConfigEntryType DIRECTION = new ConfigEntryType("Direction") //$NON-NLS-1$
Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/SwordBookMetaData.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/SwordBookMetaData.java 2007-07-02 02:34:40 UTC (rev 1464)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/SwordBookMetaData.java 2007-07-02 02:36:28 UTC (rev 1465)
@@ -59,9 +59,6 @@
{
/**
* Loads a sword config from a given File.
- * The returned BookMetaData object will not be associated with a Book so
- * setBook() should be called before getBook() is expected to return
- * anything other than null.
*
* @param file
* @param internal
@@ -71,15 +68,13 @@
{
cet = new ConfigEntryTable(internal);
cet.load(file);
+
setLibrary(bookRootPath);
buildProperties();
}
/**
* Loads a sword config from a buffer.
- * The returned BookMetaData object will not be associated with a Book so
- * setBook() should be called before getBook() is expected to return
- * anything other than null.
*
* @param buffer
* @param internal
@@ -192,6 +187,9 @@
*/
public void setLibrary(URI library)
{
+ cet.add(ConfigEntryType.LIBRARY_URL, library.toString());
+ super.setLibrary(library);
+
// Currently all DATA_PATH entries end in / to indicate dirs or not to indicate file prefixes
String datapath = getProperty(ConfigEntryType.DATA_PATH);
int lastSlash = datapath.lastIndexOf('/');
@@ -206,9 +204,6 @@
datapath = datapath.substring(0, lastSlash);
URI location = NetUtil.lengthenURI(library, datapath);
- cet.add(ConfigEntryType.LIBRARY_URL, library.toString());
- super.setLibrary(library);
-
cet.add(ConfigEntryType.LOCATION_URL, location.toString());
super.setLocation(location);
}
More information about the jsword-svn
mailing list