[sword-svn] r3020 - trunk/utilities/diatheke

refdoc at crosswire.org refdoc at crosswire.org
Thu Jan 23 05:34:37 MST 2014


Author: refdoc
Date: 2014-01-23 05:34:37 -0700 (Thu, 23 Jan 2014)
New Revision: 3020

Modified:
   trunk/utilities/diatheke/corediatheke.cpp
Log:
further corrections to font/locale handling across various HTML formats and removal of "deprecate" warning for string copying


Modified: trunk/utilities/diatheke/corediatheke.cpp
===================================================================
--- trunk/utilities/diatheke/corediatheke.cpp	2014-01-23 09:50:23 UTC (rev 3019)
+++ trunk/utilities/diatheke/corediatheke.cpp	2014-01-23 12:34:37 UTC (rev 3020)
@@ -363,9 +363,11 @@
 			}
 			
 			*output << (char*)target->getKeyText();
-			if (font && (outputformat == FMT_HTML || outputformat == FMT_HTMLHREF || outputformat == FMT_XHTML || outputformat == FMT_THML || outputformat == FMT_CGI)) {
-				*output << ": <span style=\"font:\"" << font << ";\""
-				        << " lang=\"" << modlocale << "\">";
+			if (outputformat == FMT_HTML || outputformat == FMT_HTMLHREF || outputformat == FMT_XHTML || outputformat == FMT_THML || outputformat == FMT_CGI) {
+				*output << ": <span ";
+				if (font) { *output << "style=\"font:\"" << font << ";\""; }
+				if (strcmp(modlocale,locale) !=0 ) { *output << "lang=\"" << modlocale << "\"";}
+				*output << ">";
 			}
 			else if (outputformat == FMT_RTF) {
 				*output << ": {\\f1 ";
@@ -374,7 +376,7 @@
 				*output << ": ";
 			}
 			*output << text;
-			if (font && (outputformat == FMT_HTML || outputformat == FMT_HTMLHREF || outputformat == FMT_XHTML || outputformat == FMT_THML || outputformat == FMT_CGI)) {
+			if (outputformat == FMT_HTML || outputformat == FMT_HTMLHREF || outputformat == FMT_XHTML || outputformat == FMT_THML || outputformat == FMT_CGI) {
 				*output << "</span>";
 			}
 			else if (outputformat == FMT_RTF) {
@@ -436,7 +438,7 @@
 				modlanguage = "english";
 				}
 			if (!(font)) {	
-				font = "Gentium";
+				strcpy(font,"Gentium");
 				}
 							
 			if (!(modlanguage == syslanguage))	{		
@@ -466,7 +468,7 @@
 
 		else if (outputformat == FMT_HTML || outputformat == FMT_HTMLHREF || outputformat == FMT_XHTML) {
 			*output << "<meta http-equiv=\"content-type\" content=\"text/html\" charset=\"UTF-8\""
-				   " lang=\"" <<  locale << "\" xml:lang=\"" <<   locale << "\"/>";
+				   " lang=\"" <<  locale << "\" xml:lang=\"" <<   locale << "\"/>\n";
 		}
 
 		for (i = 0; i < listkey.getCount() && maxverses; i++) {
@@ -551,9 +553,12 @@
 					*output << (char*)target->getKeyText();
 					}
 
-				if (font && (outputformat == FMT_HTML || outputformat == FMT_HTMLHREF || outputformat == FMT_XHTML || outputformat == FMT_THML || outputformat == FMT_CGI)) {
-					*output << ": <font face=\"" << font << "\">";
-				}
+				if (outputformat == FMT_HTML || outputformat == FMT_HTMLHREF || outputformat == FMT_XHTML || outputformat == FMT_THML || outputformat == FMT_CGI) {
+						*output << ": <span ";
+						if (font) { *output << "style=\"font:\""  << font << ";\" " ;}
+						if (strcmp(modlocale,locale) !=0 ) { *output << "lang=\"" << modlocale << "\"";}
+						*output << ">";
+					}
 				else if (outputformat == FMT_RTF) {
 					*output << ": {\\f1 ";
 				}
@@ -564,8 +569,8 @@
 					*output << ": ";
 				}
 				*output << target->renderText();
-				if (font && (outputformat == FMT_HTML || outputformat == FMT_HTMLHREF || outputformat == FMT_XHTML || outputformat == FMT_THML || outputformat == FMT_CGI)) {
-					*output << "</font>";
+				if (outputformat == FMT_HTML || outputformat == FMT_HTMLHREF || outputformat == FMT_XHTML || outputformat == FMT_THML || outputformat == FMT_CGI) {
+					*output << "</span>";
 				}
 				else if (outputformat == FMT_RTF) {
 					*output << "}";




More information about the sword-cvs mailing list