Troy,

When you get a moment will see if these patches are ok. If so I will
commit them.

Thanks

Terry
Index: thmlhtmlhref.cpp
===================================================================
--- thmlhtmlhref.cpp	(revision 2025)
+++ thmlhtmlhref.cpp	(working copy)
@@ -13,7 +13,6 @@
  *   (at your option) any later version.                                   *
  *                                                                         *
  ***************************************************************************/
-
 #include <stdlib.h>
 #include <thmlhtmlhref.h>
 #include <swmodule.h>
@@ -29,6 +28,7 @@
 	if (module) {
 		version = module->Name();
 		BiblicalText = (!strcmp(module->Type(), "Biblical Texts"));
+		Commentary = (!strcmp(module->Type(), "Commentaries"));
 		SecHead = false;
 	}	
 }
@@ -199,20 +199,31 @@
 				if (!tag.isEmpty()) {
 					SWBuf type = tag.getAttribute("type");
 					SWBuf footnoteNumber = tag.getAttribute("swordFootnote");
-					VerseKey *vkey = NULL;
-					// see if we have a VerseKey * or descendant
-					SWTRY {
-						vkey = SWDYNAMIC_CAST(VerseKey, u->key);
+					if(u->BiblicalText && u->Commentary) {
+						VerseKey *vkey = NULL;
+						// see if we have a VerseKey * or descendant
+						SWTRY {
+							vkey = SWDYNAMIC_CAST(VerseKey, u->key);
+						}
+						SWCATCH ( ... ) {	}
+						if (vkey) {
+							// leave this special osis type in for crossReference notes types?  Might thml use this some day? Doesn't hurt.
+							char ch = ((tag.getAttribute("type") && ((!strcmp(tag.getAttribute("type"), "crossReference")) || (!strcmp(tag.getAttribute("type"), "x-cross-ref")))) ? 'x':'n');
+							buf.appendFormatted("<a href=\"passagestudy.jsp?action=showNote&type=%c&value=%s&module=%s&passage=%s\"><small><sup>*%c</sup></small></a> ", 
+								ch, 
+								URL::encode(footnoteNumber.c_str()).c_str(), 
+								URL::encode(u->version.c_str()).c_str(), 
+								URL::encode(vkey->getText()).c_str(), 
+								ch);
+						}
 					}
-					SWCATCH ( ... ) {	}
-					if (vkey) {
-						// leave this special osis type in for crossReference notes types?  Might thml use this some day? Doesn't hurt.
+					else {
 						char ch = ((tag.getAttribute("type") && ((!strcmp(tag.getAttribute("type"), "crossReference")) || (!strcmp(tag.getAttribute("type"), "x-cross-ref")))) ? 'x':'n');
 						buf.appendFormatted("<a href=\"passagestudy.jsp?action=showNote&type=%c&value=%s&module=%s&passage=%s\"><small><sup>*%c</sup></small></a> ", 
 							ch, 
 							URL::encode(footnoteNumber.c_str()).c_str(), 
 							URL::encode(u->version.c_str()).c_str(), 
-							URL::encode(vkey->getText()).c_str(), 
+							URL::encode(u->key->getText()).c_str(),  
 							ch);
 					}
 					u->suspendTextPassThru = true;
Index: thmlhtmlhref.h
===================================================================
--- thmlhtmlhref.h	(revision 2025)
+++ thmlhtmlhref.h	(working copy)
@@ -37,6 +37,7 @@
 		SWBuf inscriptRef;
 		bool SecHead;
 		bool BiblicalText;
+		bool Commentary;
 		SWBuf version;
 		XMLTag startTag;
 	};
_______________________________________________
sword-devel mailing list: sword-devel@crosswire.org
http://www.crosswire.org/mailman/listinfo/sword-devel
Instructions to unsubscribe/change your settings at above page

Reply via email to