[sword-devel] SWORD Frontend developers

Troy A. Griffitts sword-devel@crosswire.org
Sun, 06 Jul 2003 18:42:01 -0700


This is a multi-part message in MIME format.
--------------040807050601060103060203
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Sorry for the late changes to the public interface.  They're fairly small:

For consistency: OptionsList has become StringList, which is the common 
typedef used for all list < SWBuf > container types.

All option filters now extend a common base class: SWOptionFilter, which 
shouldn't change anything in your UI.

I've updated the way OSIS Notes are handled in the filters and OSISRTF, 
to work correctly with the separation of footnotes from crossreferences. 
  I've included the diff of OSISRTF so you can just see what changed, so 
you might make similar changes in your render filter.

Thanks for all the work.

	-Troy

____________


--------------040807050601060103060203
Content-Type: text/plain;
 name="diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="diff"

Index: osisrtf.cpp
===================================================================
RCS file: /usr/local/cvsroot/sword/src/modules/filters/osisrtf.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- osisrtf.cpp	28 Jun 2003 21:31:20 -0000	1.11
+++ osisrtf.cpp	5 Jul 2003 01:16:46 -0000	1.12
@@ -128,11 +128,10 @@
 		// <note> tag
 		else if (!strcmp(tag.getName(), "note")) {
 			if (!tag.isEmpty() && !tag.isEndTag()) {
-				SWBuf footnoteNum = userData["fn"];
 				SWBuf type = tag.getAttribute("type");
 
 				if (type != "strongsMarkup") {	// leave strong's markup notes out, in the future we'll probably have different option filters to turn different note types on or off
-					int footnoteNumber = (footnoteNum.length()) ? atoi(footnoteNum.c_str()) : 1;
+					SWBuf footnoteNumber = tag.getAttribute("swordFootnote");
 					VerseKey *vkey;
 					// see if we have a VerseKey * or descendant
 					try {
@@ -140,10 +139,7 @@
 					}
 					catch ( ... ) {	}
 					if (vkey) {
-						buf.appendFormatted("{\\super <a href=\"\">*%c%i.%i</a>} ", ((tag.getAttribute("type") && ((!strcmp(tag.getAttribute("type"), "crossReference")) || (!strcmp(tag.getAttribute("type"), "x-cross-ref")))) ? 'x':'n'), vkey->Verse(), footnoteNumber);
-						SWBuf tmp;
-						tmp.appendFormatted("%i", ++footnoteNumber);
-						userData["fn"] = tmp.c_str();
+						buf.appendFormatted("{\\super <a href=\"\">*%c%i.%s</a>} ", ((tag.getAttribute("type") && ((!strcmp(tag.getAttribute("type"), "crossReference")) || (!strcmp(tag.getAttribute("type"), "x-cross-ref")))) ? 'x':'n'), vkey->Verse(), footnoteNumber.c_str());
 					}
 				}
 				userData["suspendTextPassThru"] = "true";
@@ -180,7 +176,7 @@
 		}
 
 		// <line> poetry, etc
-		else if (!strcmp(tag.getName(), "line")) {
+		else if ((!strcmp(tag.getName(), "line")) || ((!strcmp(tag.getName(), "milestone")) && (tag.getAttribute("type")) && (!strcmp(tag.getAttribute("type"), "line")))) {
 			if ((!tag.isEndTag()) && (!tag.isEmpty())) {
 				buf += "{";
 			}

--------------040807050601060103060203--