[sword-svn] r84 - trunk/src/gui

bdrake at www.crosswire.org bdrake at www.crosswire.org
Fri Jan 4 06:12:36 MST 2008


Author: bdrake
Date: 2008-01-04 06:12:36 -0700 (Fri, 04 Jan 2008)
New Revision: 84

Modified:
   trunk/src/gui/SimpleNavigator.cpp
Log:
Footnote handling in SimpleNavigator.cpp altered to use RenderText.  Now shows Greek characters properly, but also shows tags such as italics that MessageBox can't handle.  On balance, possibly better like this than using StripText???

Modified: trunk/src/gui/SimpleNavigator.cpp
===================================================================
--- trunk/src/gui/SimpleNavigator.cpp	2008-01-02 18:14:32 UTC (rev 83)
+++ trunk/src/gui/SimpleNavigator.cpp	2008-01-04 13:12:36 UTC (rev 84)
@@ -242,6 +242,25 @@
 	}
 }
 
+
+/*
+//new code
+wchar_t *SWBuftowstr(const char *str) {
+  static wchar_t *c, *buffer = 0;
+  if (buffer)
+    delete [] buffer;
+  buffer = c = new wchar_t[ sizeof(str) + 1 ];
+  while (*str) {
+    *c++ = (WCHAR)*str++;
+	//*c++ = (WCHAR)*str++;
+	MessageBox(0, str, L"converting", MB_OK);
+  }
+  *c = 0;
+  return buffer;
+}
+//end new code
+*/
+
 void SimpleNavigator::urlClicked(const WCHAR *target) {
 	const char * t = wstrtostr(target);
 	// MessageBox(0, strtowstr(t), L"This is 't'", MB_OK);
@@ -262,10 +281,9 @@
 		// force a parse of the entry
 		mod->RenderText(); 
 		SWBuf body = mod->getEntryAttributes()["Footnote"][footnoteNumber]["body"];
-		// strip out html if present
-		body = mod->StripText(body.c_str());
+		const char *Body = mod->RenderText(body.c_str()); // RenderText not StripText used
 		// not sure if MessageBox can display html - if it can, re-think this some day
-		MessageBox(0, strtowstr(body), L"Footnote", MB_OK);
+		MessageBox(0, (const unsigned short *)Body, L"Footnote", MB_OK); //
 		}
 	// Strongs number MessageBox
 	else if (strstr(t, "showStrongs")) {




More information about the sword-cvs mailing list