[sword-svn] r3340 - in trunk: include src/modules/filters

refdoc at crosswire.org refdoc at crosswire.org
Fri Mar 13 13:48:51 MST 2015


Author: refdoc
Date: 2015-03-13 13:48:51 -0700 (Fri, 13 Mar 2015)
New Revision: 3340

Modified:
   trunk/include/osislatex.h
   trunk/src/modules/filters/osislatex.cpp
Log:
tables now supported on osis


Modified: trunk/include/osislatex.h
===================================================================
--- trunk/include/osislatex.h	2015-03-12 20:50:13 UTC (rev 3339)
+++ trunk/include/osislatex.h	2015-03-13 20:48:51 UTC (rev 3340)
@@ -47,6 +47,7 @@
 		bool inXRefNote;
 		bool BiblicalText;
 		int suspendLevel;
+		bool firstCell;
 		SWBuf wordsOfChristStart;
 		SWBuf wordsOfChristEnd;
 		TagStack *quoteStack;

Modified: trunk/src/modules/filters/osislatex.cpp
===================================================================
--- trunk/src/modules/filters/osislatex.cpp	2015-03-12 20:50:13 UTC (rev 3339)
+++ trunk/src/modules/filters/osislatex.cpp	2015-03-13 20:48:51 UTC (rev 3340)
@@ -153,6 +153,7 @@
 	wordsOfChristStart = "\\swordwoj{";
 	wordsOfChristEnd   = "}";
 	consecutiveNewlines = 0;
+	firstCell = false;
 }
 
 OSISLaTeX::MyUserData::~MyUserData() {
@@ -171,6 +172,7 @@
 bool OSISLaTeX::handleToken(SWBuf &buf, const char *token, BasicFilterUserData *userData) {
 	MyUserData *u = (MyUserData *)userData;
 	SWBuf scratch;
+	
 	bool sub = (u->suspendTextPassThru) ? substituteToken(scratch, token) : substituteToken(buf, token);
 	if (!sub) {
   // manually process if it wasn't a simple substitution
@@ -650,7 +652,7 @@
 				filepath += src;
 
 				// images become clickable, if the UI supports showImage.
-				outText("<a href=\"passagestudy.jsp?action=showImage&value=", buf, u);
+				outText("\\figure{", buf, u);
 				outText(URL::encode(filepath.c_str()).c_str(), buf, u);
 				outText("&module=", buf, u);
 				outText(URL::encode(u->version.c_str()).c_str(), buf, u);
@@ -687,10 +689,10 @@
 		}
 		else if (!strcmp(tag.getName(), "table")) {
 			if ((!tag.isEndTag()) && (!tag.isEmpty())) {
-				buf += "<table><tbody>\n";
+				buf += "\n\\begin{tabular}\n";
 			}
 			else if (tag.isEndTag()) {
-				buf += "</tbody></table>\n";
+				buf += "\n\\end{tabular}\n";
 				++u->consecutiveNewlines;
 				u->supressAdjacentWhitespace = true;
 			}
@@ -698,19 +700,26 @@
 		}
 		else if (!strcmp(tag.getName(), "row")) {
 			if ((!tag.isEndTag()) && (!tag.isEmpty())) {
-				buf += "\t<tr>";
+				buf += "";
+				u->firstCell = true;
 			}
 			else if (tag.isEndTag()) {
-				buf += "</tr>\n";
+				buf += "//\n";
+				u->firstCell = false;
 			}
 			
 		}
 		else if (!strcmp(tag.getName(), "cell")) {
 			if ((!tag.isEndTag()) && (!tag.isEmpty())) {
-				buf += "<td>";
+				if (u->firstCell == false) {
+					buf += " & ";
+				}
+				else {
+					u->firstCell = false;
+				}
 			}
 			else if (tag.isEndTag()) {
-				buf += "</td>";
+				buf += "";
 			}
 		}
 		else {




More information about the sword-cvs mailing list