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

chrislit at crosswire.org chrislit at crosswire.org
Sun Mar 9 23:52:42 MST 2014


Author: chrislit
Date: 2014-03-09 23:52:42 -0700 (Sun, 09 Mar 2014)
New Revision: 3091

Modified:
   trunk/src/modules/filters/teihtmlhref.cpp
   trunk/src/modules/filters/teilatex.cpp
   trunk/src/modules/filters/teirtf.cpp
   trunk/src/modules/filters/teixhtml.cpp
Log:
transitioned to CSS standard vertical-align, font-weight, etc. property names


Modified: trunk/src/modules/filters/teihtmlhref.cpp
===================================================================
--- trunk/src/modules/filters/teihtmlhref.cpp	2014-03-10 06:17:00 UTC (rev 3090)
+++ trunk/src/modules/filters/teihtmlhref.cpp	2014-03-10 06:52:42 UTC (rev 3091)
@@ -87,30 +87,29 @@
 				SWBuf rend = tag.getAttribute("rend");
 				
 				u->lastHi = rend;
-				if (rend == "ital")
+				if (rend == "italic" || rend == "ital")
 					buf += "<i>";
-				else if (rend == "italic")
-					buf += "<i>";
 				else if (rend == "bold")
 					buf += "<b>";
-				else if (rend == "subscript")
-					buf += "<small><sub>";
-				else if (rend == "sup")
-					buf += "<small><sup>";
-
+				else if (rend == "super" || rend == "sup")
+					buf += "<sup>";
+				else if (rend == "sub")
+					buf += "<sub>";
+				else if (rend == "overline")
+					buf += "<span style=\"text-decoration:overline\">";
 			}
 			else if (tag.isEndTag()) {
 				SWBuf rend = u->lastHi;
-				if (rend == "ital")
+				if (rend == "italic" || rend == "ital")
 					buf += "</i>";
-				else if (rend == "italic")
-					buf += "</i>";
 				else if (rend == "bold")
 					buf += "</b>";
-				else if (rend == "subscript")
-					buf += "</small></sub>";
-				else if (rend == "sup")
-					buf += "</sup></small>";
+				else if (rend == "super" || rend == "sup")
+					buf += "</sup>";
+				else if (rend == "sub")
+					buf += "</sub>";
+				else if (rend == "overline")
+					buf += "</span>";
 			}
 		}
 

Modified: trunk/src/modules/filters/teilatex.cpp
===================================================================
--- trunk/src/modules/filters/teilatex.cpp	2014-03-10 06:17:00 UTC (rev 3090)
+++ trunk/src/modules/filters/teilatex.cpp	2014-03-10 06:52:42 UTC (rev 3091)
@@ -87,30 +87,30 @@
 				SWBuf rend = tag.getAttribute("rend");
 				
 				u->lastHi = rend;
-				if (rend == "ital")
-					buf += "<i>";
-				else if (rend == "italic")
-					buf += "<i>";
+				if (rend == "italic" || rend == "ital")
+					buf += "\\it{";
 				else if (rend == "bold")
-					buf += "<b>";
-				else if (rend == "sup")
-					buf += "<small><sup>";
+					buf += "\\bd{";
+				else if (rend == "super" || rend == "sup")
+					buf += "^{";
+				else if (rend == "sub")
+					buf += "_{";
 				else if (rend == "overline")
-					buf += "<span style=\"text-decoration:overline\">";
+					buf += "\\overline{";
 
 			}
 			else if (tag.isEndTag()) {
 				SWBuf rend = u->lastHi;
-				if (rend == "ital")
-					buf += "</i>";
-				else if (rend == "italic")
-					buf += "</i>";
+				if (rend == "italic" || rend == "ital")
+					buf += "}";
 				else if (rend == "bold")
-					buf += "</b>";
-				else if (rend == "sup")
-					buf += "</sup></small>";
+					buf += "}";
+				else if (rend == "super" || rend == "sup")
+					buf += "}";
+				else if (rend == "sub")
+					buf += "}";
 				else if (rend == "overline")
-					buf += "</span>";
+					buf += "}";
 			}
 		}
 

Modified: trunk/src/modules/filters/teirtf.cpp
===================================================================
--- trunk/src/modules/filters/teirtf.cpp	2014-03-10 06:17:00 UTC (rev 3090)
+++ trunk/src/modules/filters/teirtf.cpp	2014-03-10 06:52:42 UTC (rev 3091)
@@ -76,15 +76,14 @@
 		else if (!strcmp(tag.getName(), "hi") || !strcmp(tag.getName(), "emph")) {
 			SWBuf rend = tag.getAttribute("rend");
 			if ((!tag.isEndTag()) && (!tag.isEmpty())) {
-				if (rend == "ital" || rend == "italic")
+				if (rend == "italic" || rend == "ital")
 					buf += "{\\i1 ";
 				else if (rend == "bold")
 					buf += "{\\b1 ";
-				else if (rend == "subscript")
-					buf += "{\\sub ";
-				else if (rend == "sup")
+				else if (rend == "super" || rend == "sup")
 				        buf += "{\\super ";
-
+				else if (rend == "sub")
+					buf += "{\\sub ";
 			}
 			else if (tag.isEndTag()) {
 				buf += "}";

Modified: trunk/src/modules/filters/teixhtml.cpp
===================================================================
--- trunk/src/modules/filters/teixhtml.cpp	2014-03-10 06:17:00 UTC (rev 3090)
+++ trunk/src/modules/filters/teixhtml.cpp	2014-03-10 06:52:42 UTC (rev 3091)
@@ -87,32 +87,28 @@
 				SWBuf rend = tag.getAttribute("rend");
 				
 				u->lastHi = rend;
-				if (rend == "ital")
+				if (rend == "italic" || rend == "ital")
 					buf += "<i>";
-				else if (rend == "italic")
-					buf += "<i>";
 				else if (rend == "bold")
 					buf += "<b>";
-				else if (rend == "sup")
-					buf += "<small><sup>";
-				else if (rend == "subscript")
-					buf += "<small><sub>";
+				else if (rend == "super" || rend == "sup")
+					buf += "<sup>";
+				else if (rend == "sub")
+					buf += "<sub>";
 				else if (rend == "overline")
 					buf += "<span style=\"text-decoration:overline\">";
 
 			}
 			else if (tag.isEndTag()) {
 				SWBuf rend = u->lastHi;
-				if (rend == "ital")
+				if (rend == "italic" || rend == "ital")
 					buf += "</i>";
-				else if (rend == "italic")
-					buf += "</i>";
 				else if (rend == "bold")
 					buf += "</b>";
-				else if (rend == "sup")
-					buf += "</sup></small>";
-				else if (rend == "subscript")
-					buf += "</small></sub>";
+				else if (rend = "super" || rend == "sup")
+					buf += "</sup>";
+				else if (rend == "sub")
+					buf += "</sub>";
 				else if (rend == "overline")
 					buf += "</span>";
 			}




More information about the sword-cvs mailing list