[sword-svn] r3394 - trunk/src/modules/filters

refdoc at crosswire.org refdoc at crosswire.org
Sat Dec 19 14:17:25 MST 2015


Author: refdoc
Date: 2015-12-19 14:17:25 -0700 (Sat, 19 Dec 2015)
New Revision: 3394

Modified:
   trunk/src/modules/filters/teirtf.cpp
Log:
added image support to TEI->RTF filter


Modified: trunk/src/modules/filters/teirtf.cpp
===================================================================
--- trunk/src/modules/filters/teirtf.cpp	2015-12-19 21:01:48 UTC (rev 3393)
+++ trunk/src/modules/filters/teirtf.cpp	2015-12-19 21:17:25 UTC (rev 3394)
@@ -205,7 +205,23 @@
 			}
 		}
 
+		else if (!strcmp(tag.getName(), "graphic")) {
+			const char *src = tag.getAttribute("url");
+			if (!src)		// assert we have a src attribute
+				return false;
 
+			char* filepath = new char[strlen(u->module->getConfigEntry("AbsoluteDataPath")) + strlen(token)];
+			*filepath = 0;
+			strcpy(filepath, userData->module->getConfigEntry("AbsoluteDataPath"));
+			strcat(filepath, src);
+
+// we do this because BibleCS looks for this EXACT format for an image tag
+			buf += "<img src=\"";
+			buf += filepath;
+			buf += "\" />";
+			delete [] filepath;
+		}
+
 		else {
 			return false;  // we still didn't handle token
 		}




More information about the sword-cvs mailing list