[sword-cvs] sword/src/modules/filters osisrtf.cpp,1.20,1.21 thmlrtf.cpp,1.34,1.35
sword@www.crosswire.org
sword@www.crosswire.org
Wed, 6 Aug 2003 03:34:39 -0700
- Previous message: [sword-cvs] sword/include swbuf.h,1.22,1.23
- Next message: [sword-cvs] sword/apps/windoze/CBuilder5/BibleCS AboutBoxfrm.dfm,1.54,1.55 RxRichEditX.cpp,1.48,1.49 RxRichEditX.h,1.18,1.19 SplashPage.dfm,1.4,1.5 paraldisp.cpp,1.5,1.6 sword.bpr,1.122,1.123 sword.res,1.109,1.110
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /usr/local/cvsroot/sword/src/modules/filters
In directory www:/tmp/cvs-serv11696/src/modules/filters
Modified Files:
osisrtf.cpp thmlrtf.cpp
Log Message:
added figure support
Index: osisrtf.cpp
===================================================================
RCS file: /usr/local/cvsroot/sword/src/modules/filters/osisrtf.cpp,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- osisrtf.cpp 5 Aug 2003 09:06:30 -0000 1.20
+++ osisrtf.cpp 6 Aug 2003 10:34:36 -0000 1.21
@@ -270,6 +270,44 @@
}
}
+ else if (!strcmp(tag.getName(), "figure")) {
+ const char *src = tag.getAttribute("src");
+ 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+="<figure src=\"";
+ buf+=filepath;
+ buf+="\" />";
+/*
+ char imgc;
+ for (c = filepath + strlen(filepath); c > filepath && *c != '.'; c--);
+ c++;
+ FILE* imgfile;
+ if (stricmp(c, "jpg") || stricmp(c, "jpeg")) {
+ imgfile = fopen(filepath, "r");
+ if (imgfile != NULL) {
+ buf += "{\\nonshppict {\\pict\\jpegblip ";
+ while (feof(imgfile) != EOF) {
+ buf.appendFormatted("%2x", fgetc(imgfile));
+ }
+ fclose(imgfile);
+ buf += "}}";
+ }
+ }
+ else if (stricmp(c, "png")) {
+ buf += "{\\*\\shppict {\\pict\\pngblip ";
+
+ buf += "}}";
+ }
+*/
+ delete [] filepath;
+ }
else {
return false; // we still didn't handle token
}
Index: thmlrtf.cpp
===================================================================
RCS file: /usr/local/cvsroot/sword/src/modules/filters/thmlrtf.cpp,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -d -r1.34 -r1.35
--- thmlrtf.cpp 30 Jul 2003 00:51:34 -0000 1.34
+++ thmlrtf.cpp 6 Aug 2003 10:34:36 -0000 1.35
@@ -162,7 +162,7 @@
}
text += " ";
}
- else {
+ else {
text += *from;
}
}
@@ -240,41 +240,45 @@
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"));
- unsigned long i = strlen(filepath);
- const char *c;
+ char* filepath = new char[strlen(u->module->getConfigEntry("AbsoluteDataPath")) + strlen(token)];
+ *filepath = 0;
+ strcpy(filepath, userData->module->getConfigEntry("AbsoluteDataPath"));
+ unsigned long i = strlen(filepath);
+ const char *c;
for (c = (src + 5); *c != '"'; c++) {
filepath[i] = *c;
- i++;
+ i++;
}
- filepath[i] = 0;
-
- for (c = filepath + strlen(filepath); c > filepath && *c != '.'; c--);
- c++;
+ filepath[i] = 0;
- char imgc;
- FILE* imgfile;
+ buf+="<figure src=\"";
+ buf+=filepath;
+ buf+="\" />";
/*
- if (stricmp(c, "jpg") || stricmp(c, "jpeg")) {
- imgfile = fopen(filepath, "r");
- if (imgfile != NULL) {
- buf += "{\\nonshppict {\\pict\\jpegblip ";
- while (feof(imgfile) != EOF) {
- buf.appendFormatted("%2x", fgetc(imgfile));
- }
- fclose(imgfile);
- buf += "}}";
- }
- }
- else if (stricmp(c, "png")) {
- buf += "{\\*\\shppict {\\pict\\pngblip ";
+ char imgc;
+ FILE* imgfile;
+ for (c = filepath + strlen(filepath); c > filepath && *c != '.'; c--);
+ c++;
- buf += "}}";
- }
+
+ if (stricmp(c, "jpg") || stricmp(c, "jpeg")) {
+ imgfile = fopen(filepath, "r");
+ if (imgfile != NULL) {
+ buf += "{\\nonshppict {\\pict\\jpegblip ";
+ while (feof(imgfile) != EOF) {
+ buf.appendFormatted("%2x", fgetc(imgfile));
+ }
+ fclose(imgfile);
+ buf += "}}";
+ }
+ }
+ else if (stricmp(c, "png")) {
+ buf += "{\\*\\shppict {\\pict\\pngblip ";
+
+ buf += "}}";
+ }
*/
- delete [] filepath;
+ delete [] filepath;
}
else {
return false; // we still didn't handle token
- Previous message: [sword-cvs] sword/include swbuf.h,1.22,1.23
- Next message: [sword-cvs] sword/apps/windoze/CBuilder5/BibleCS AboutBoxfrm.dfm,1.54,1.55 RxRichEditX.cpp,1.48,1.49 RxRichEditX.h,1.18,1.19 SplashPage.dfm,1.4,1.5 paraldisp.cpp,1.5,1.6 sword.bpr,1.122,1.123 sword.res,1.109,1.110
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]