? patch ? usdecrypt.c ? oldtable.c ? broken ? test.bmp ? asdasd ? test.jpg ? test.xml ? tools ? oldpicf.c ? test.log ? test.aux ? arse.xml ? test.dvi ? old.sed ? test ? equation0.wmf ? equation20.wmf ? equation21.wmf ? tabs ? oldcodepage.c ? mergetest.doc ? examples/table95.doc ? examples/graphiclayout.doc ? examples/graphiclayout0.jpg ? examples/tabstops.doc ? expat/Makefile.in2 ? expat/xmktol ? expat/xmktok ? feature-examples/supported-table-features.doc ? feature-examples/supported-paragraph-features.ps ? gtk/score.srt ? iconv/ucs-2.c ? notes/feature-map ? notes/all-properties.html ? notes/browsers.html ? notes/symbol.txt ? notes/zdingbat.txt ? notes/wingding.gif ? notes/ms-escher.c ? notes/ms-escher.h ? notes/wingdings.txt ? notes/testypoo.txt ? notes/internationalization/WinCP.html ? notes/internationalization/localsupport.html ? notes/internationalization/russian0.wmf Index: CHANGELOG =================================================================== RCS file: /u2/cvsroot/wv/CHANGELOG,v retrieving revision 1.63 diff -u -w -r1.63 CHANGELOG --- CHANGELOG 1999/12/14 12:19:10 1.63 +++ CHANGELOG 1999/12/15 09:06:32 @@ -48,7 +48,16 @@ * added cellrelpagewidth to tokens which appears to work a charm with the latex conversion, cheers to David C Sterratt for pointing pointing me on the way. + * added dop to wvParseStruct so abi can get default tab + distance. + * remodeled the html entity lookup, and added the basics + of a latex entity lookup. + * removed the now unnecessary codepage 1252 html entity + lookup. + * I had left wvGetTC out of sync with the new WORD8 version + numbering ALL TODO + * dop needs to be checked for word 6/7 compatability * allow latex or html or raw text conversion options. Index: Makefile.in =================================================================== RCS file: /u2/cvsroot/wv/Makefile.in,v retrieving revision 1.35 diff -u -w -r1.35 Makefile.in --- Makefile.in 1999/12/14 12:19:10 1.35 +++ Makefile.in 1999/12/15 09:06:32 @@ -149,7 +149,6 @@ bte.$(OBJEXT) \ bx.$(OBJEXT) \ fkp.$(OBJEXT) \ - codepage-1252.$(OBJEXT) \ text.$(OBJEXT) \ decode_complex.$(OBJEXT) \ wvTextEngine.$(OBJEXT) \ Index: sprm.c =================================================================== RCS file: /u2/cvsroot/wv/sprm.c,v retrieving revision 1.40 diff -u -w -r1.40 sprm.c --- sprm.c 1999/12/14 12:19:10 1.40 +++ sprm.c 1999/12/15 09:06:32 @@ -2158,7 +2158,8 @@ void wvApplysprmTDefTable(TAP *tap,U8 *pointer,U16 *pos) { U16 len; - int i,t,oldpos,type; + int i,t,oldpos; + version type; len = dread_16ubit(NULL,&pointer); (*pos)+=2; wvTrace(("wvApplysprmTDefTable\n")); @@ -2166,7 +2167,7 @@ (*pos)++; oldpos = (*pos)-2; wvTrace(("oldpos is %x\n",oldpos)); - wvTrace(("C: there are %d cells\n",tap->itcMac)); + wvError(("C: there are %d cells\n",tap->itcMac)); for (i=0;iitcMac + 1;i++) { tap->rgdxaCenter[i] = (S16)dread_16ubit(NULL,&pointer); @@ -2174,7 +2175,7 @@ (*pos)+=2; } - wvTrace(("HERE-->pos is now %d, the len was %d, there is %d left\n",*pos,len,len-(*pos-oldpos))); + wvError(("HERE-->pos is now %d, the len was %d, there is %d left\n",*pos,len,len-(*pos-oldpos))); if ( (len-(*pos-oldpos)) < (cb6TC * tap->itcMac) ) { @@ -2184,9 +2185,9 @@ } if ( (len-(*pos-oldpos)) < (cbTC * tap->itcMac) ) - type = 1; + type = WORD6; else - type = 0; + type = WORD8; wvTrace(("type is %d\n",type)); @@ -2195,7 +2196,7 @@ for (i=0;iitcMac;i++) { t = wvGetTCFromBucket(type,&(tap->rgtc[i]),pointer); - wvTrace(("DefTable merge is %d\n",tap->rgtc[i].fVertMerge)); + wvError(("DefTable merge is %d\n",tap->rgtc[i].fVertMerge)); /* for christ sake !!, word 8 stores word 6 sized TC's in this sprm ! */ (*pos)+=t; pointer+=t; @@ -2233,7 +2234,7 @@ } for (i=0;iitcMac;i++) { - t=wvGetTCFromBucket(1,&(tap->rgtc[i]),pointer); + t=wvGetTCFromBucket(WORD6,&(tap->rgtc[i]),pointer); (*pos)+=t; pointer+=t; } @@ -2674,7 +2675,7 @@ void wvApplysprmTVertMerge(TAP *tap,U8 *pointer,U16 *pos) { U8 index,props,count; - wvTrace(("doing Vertical merge\n")); + wvError(("doing Vertical merge\n")); count = dgetc(NULL,&pointer); wvTrace(("count is %d\n",count)); /* check against word 8 please */ Index: table.c =================================================================== RCS file: /u2/cvsroot/wv/table.c,v retrieving revision 1.20 diff -u -w -r1.20 table.c --- table.c 1999/11/25 16:06:26 1.20 +++ table.c 1999/12/15 09:06:32 @@ -196,7 +196,7 @@ wvTrace(("end of out\n")); ps->vmerges = (S16 **)malloc(sizeof(S16 *) * no); - wvTrace(("no of rows is %d",no)); + wvError(("no of rows is %d",no)); for(i=0;ivmerges[i] = (S16 *)malloc(sizeof(S16) * ptap[i].itcMac); @@ -205,14 +205,14 @@ ps->vmerges[i][j]=1; } - for (i=no-1;i>0;i--) + for (i=no-1;i>=0;i--) { for (j=0;jfVertical = (temp16 & 0x0004) >> 2; tc->fBackward = (temp16 & 0x0008) >> 3; tc->fRotateFont = (temp16 & 0x0010) >> 4; @@ -55,7 +55,6 @@ tc->fVertRestart = (temp16 & 0x0040) >> 6; tc->vertAlign = (temp16 & 0x0180) >> 7; tc->fUnused = (temp16 & 0xFE00) >> 9; -#endif wvGetBRC10_internal(&brc10,infd,pointer); wvConvertBRC10ToBRC(&tc->brcTop,&brc10); Index: text.c =================================================================== RCS file: /u2/cvsroot/wv/text.c,v retrieving revision 1.34 diff -u -w -r1.34 text.c --- text.c 1999/12/14 12:19:10 1.34 +++ text.c 1999/12/15 09:06:33 @@ -11,6 +11,7 @@ int (*scharhandler)(wvParseStruct *ps,U16 eachchar,CHP *achp)=NULL; int (*elehandler)(wvParseStruct *ps,wvTag tag, void *props, int dirty)=NULL; int (*dochandler)(wvParseStruct *ps,wvTag tag)=NULL; +int (*wvConvertUnicodeToEntity)(U16 char16)=NULL; int wvOutputTextChar(U16 eachchar,U8 chartype,wvParseStruct *ps, CHP *achp) { @@ -246,7 +247,7 @@ ibuf = buffer; obuf = buffer2; - if (wvConvertUnicodeToHtml(eachchar)) + if ((wvConvertUnicodeToEntity != NULL) && wvConvertUnicodeToEntity(eachchar)) return; /* All reserved positions of from code (last 12 characters) and to code */ @@ -375,6 +376,9 @@ wvTrace(("This Para is in cell %d %d\n",data->whichrow,data->whichcell)); if (*data->vmerges) { + /* only ignore a vertically merged cell if the setting in the config file have been set that way */ + if ( data && data->sd && data->sd->elements[TT_TABLEOVERRIDES].str && data->sd->elements[TT_TABLEOVERRIDES].str[5] ) + { wvTrace(("%d\n",(*data->vmerges)[data->whichrow][data->whichcell])); if ((*data->vmerges)[data->whichrow][data->whichcell] == 0) { @@ -384,6 +388,7 @@ } } } + } return(0); } @@ -529,6 +534,79 @@ dochandler = proc; } +void wvSetEntityConverter(expand_data *data) + { + if ( (data->sd) && (data->sd->elements[TT_CHARENTITY].str) && (data->sd->elements[TT_CHARENTITY].str[0]) ) + { + wvExpand(data,data->sd->elements[TT_CHARENTITY].str[0], + strlen(data->sd->elements[TT_CHARENTITY].str[0])); + if (data->retstring) + { + if (!(strcasecmp(data->retstring,"HTML"))) + wvConvertUnicodeToEntity = wvConvertUnicodeToHtml; + else if (!(strcasecmp(data->retstring,"LaTeX"))) + wvConvertUnicodeToEntity = wvConvertUnicodeToLaTeX; + wvTrace((Using "%s entity conversion in conjunction with ordinary charset conversion\n",data->retstring)); + wvFree(data->retstring); + } + } + } + + +int wvConvertUnicodeToLaTeX(U16 char16) + { + switch(char16) + { + case 37: + printf("\\%"); + return(1); + case 11: + printf("newline\n"); + return(1); + case 30: + case 31: + case 45: + case 0x2013: + printf("-"); + return(1); + case 12: + case 13: + case 14: + case 7: + return(1); + case 34: + printf("\""); + return(1); + case 38: + printf("&"); + return(1); + case 60: + printf("<"); + return(1); + case 62: + printf(">"); + return(1); + case 0xdc: + printf("\\\"U"); + return(1); + case 0xfc: + printf("\\\"u"); + return(1); + case 0x2019: + printf("'"); + return(1); + case 0x2215: + printf("/"); + return(1); + case 0xF8E7: /* without this, things should work in theory, but not for me */ + printf("_"); + return(1); + case 0x2018: + printf("`"); + return(1); + } + return(0); + } int wvConvertUnicodeToHtml(U16 char16) { Index: wv.h =================================================================== RCS file: /u2/cvsroot/wv/wv.h,v retrieving revision 1.59 diff -u -w -r1.59 wv.h --- wv.h 1999/12/14 12:19:10 1.59 +++ wv.h 1999/12/15 09:06:33 @@ -2479,6 +2479,8 @@ TT_htmlgraphic, TT_no_rows, TT_no_cols, + TT_CHARENTITY, + TT_VertMergedCells, TokenTableSize /*must be last entry on pain of death*/ } TT; @@ -2830,9 +2832,8 @@ int wvOutputTextChar(U16 eachchar,U8 chartype,wvParseStruct *ps,CHP *achp); void wvOutputFromUnicode(U16 eachchar,char *outputtype); -int wvConvert1252ToHtml(U16 char8); - int wvConvertUnicodeToHtml(U16 char16); +int wvConvertUnicodeToLaTeX(U16 char16); U16 wvConvertSymbolToUnicode(U16 char16); U16 wvHandleCodePage(U16 eachchar,U16 lid); Index: wvConfig.c =================================================================== RCS file: /u2/cvsroot/wv/wvConfig.c,v retrieving revision 1.43 diff -u -w -r1.43 wvConfig.c --- wvConfig.c 1999/12/14 12:19:10 1.43 +++ wvConfig.c 1999/12/15 09:06:35 @@ -121,6 +121,7 @@ { "mmLineHeight", TT_mmLineHeight}, { "document", TT_DOCUMENT }, { "picture", TT_PICTURE }, + { "charentity", TT_CHARENTITY }, { "pixPicWidth", TT_pixPicWidth }, { "pixPicHeight", TT_pixPicHeight }, { "htmlAlignGuess", TT_htmlAlignGuess }, @@ -145,6 +146,7 @@ { "ParaLeft", TT_ParaLeft }, { "ParaRight", TT_ParaRight }, { "ParaLeft1", TT_ParaLeft1 }, + { "VertMergedCells", TT_VertMergedCells}, { "block", TT_BLOCK }, { "justification", TT_JUSTIFICATION }, { "just", TT_JUST }, @@ -2068,6 +2070,7 @@ mydata->currentele = &(mydata->elements[s_Tokens[tokenIndex].m_type]); break; case TT_PICTURE: + case TT_CHARENTITY: case TT_PMARGIN: case TT_PBORDER: mydata->elements[s_Tokens[tokenIndex].m_type].str = (char **)malloc(sizeof(char *)*1); @@ -2083,7 +2086,6 @@ mydata->currentele = &(mydata->elements[s_Tokens[tokenIndex].m_type]); break; break; - case TT_TABLEOVERRIDES: case TT_JUSTIFICATION: case TT_numbering: mydata->elements[s_Tokens[tokenIndex].m_type].str = (char **)malloc(sizeof(char *)*5); @@ -2092,6 +2094,13 @@ mydata->elements[s_Tokens[tokenIndex].m_type].str[i] = NULL; mydata->currentele = &(mydata->elements[s_Tokens[tokenIndex].m_type]); break; + case TT_TABLEOVERRIDES: + mydata->elements[s_Tokens[tokenIndex].m_type].str = (char **)malloc(sizeof(char *)*6); + mydata->elements[s_Tokens[tokenIndex].m_type].nostr=6; + for(i=0;i<6;i++) + mydata->elements[s_Tokens[tokenIndex].m_type].str[i] = NULL; + mydata->currentele = &(mydata->elements[s_Tokens[tokenIndex].m_type]); + break; case TT_COLOR: mydata->elements[s_Tokens[tokenIndex].m_type].str = (char **)malloc(sizeof(char *)*16); mydata->elements[s_Tokens[tokenIndex].m_type].nostr=16; @@ -2155,6 +2164,11 @@ wvAppendStr(mydata->current,""); mydata->currentlen = strlen(*(mydata->current)); break; + case TT_VertMergedCells: + mydata->current = &(mydata->currentele->str[5]); + wvAppendStr(mydata->current,""); + mydata->currentlen = strlen(*(mydata->current)); + break; case TT_HAIRLINED: case TT_DOTD: case TT_DASHLARGEGAPD: @@ -2919,6 +2933,7 @@ case TT_ParaAfter: case TT_ParaLeft: case TT_ParaLeft1: + case TT_VertMergedCells: case TT_LEFT: case TT_RIGHT: case TT_CENTER: Index: wvHtml.c =================================================================== RCS file: /u2/cvsroot/wv/wvHtml.c,v retrieving revision 1.38 diff -u -w -r1.38 wvHtml.c --- wvHtml.c 1999/12/14 12:19:10 1.38 +++ wvHtml.c 1999/12/15 09:06:35 @@ -104,6 +104,12 @@ } } + if (optind >= argc) + { + fprintf(stderr,"No file name given to open\n"); + return(-1); + } + input = fopen(argv[optind],"rb"); if (!input) { @@ -316,6 +322,7 @@ data->norows = &ps->norows; if (i==0) { + wvSetEntityConverter(data); data->filename = ps->filename; data->whichcell=0; data->whichrow=0; Index: wvHtml.xml =================================================================== RCS file: /u2/cvsroot/wv/wvHtml.xml,v retrieving revision 1.27 diff -u -w -r1.27 wvHtml.xml --- wvHtml.xml 1999/12/14 12:19:10 1.27 +++ wvHtml.xml 1999/12/15 09:06:35 @@ -1,4 +1,8 @@
+ +HTML + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> <html> @@ -99,6 +103,20 @@ + + + +0 +0 +0 +0 +0 +0 + + <table width="%" border="1" cols="" rows=""></table> @@ -305,17 +323,6 @@ border-bottom: thin --> - - -0 -0 -0 -0 -0 - margin: ; Index: wvLaTeX.xml =================================================================== RCS file: /u2/cvsroot/wv/wvLaTeX.xml,v retrieving revision 1.4 diff -u -w -r1.4 wvLaTeX.xml --- wvLaTeX.xml 1999/12/14 12:19:10 1.4 +++ wvLaTeX.xml 1999/12/15 09:06:35 @@ -1,4 +1,7 @@
+ +LaTeX + %Document generated by wvWare/ %wvWare written by Caolan.McNamara@ul.ie @@ -9,6 +12,7 @@ \usepackage[dvips]{graphics} \usepackage[T1]{fontenc} \usepackage[latin1]{inputenc} +\usepackage{multirow} \newcommand\suppress[1]{} \newcommand\revised[1]{\underline{#1}} \newlength\textpercent @@ -96,34 +100,49 @@ + + + + +
-\begin{tabular}{|*{}{p{\textpercent}|}|} + +\begin{tabular}{|*{}{p{\textpercent}|}} +\hline -\hline -\end{tabular} + +\hline +\end{tabular} + +
- -\hline - + - -\multicolumn{}{|p{\textpercent}|}{ -}& - +\multicolumn{}{|p{\textpercent}|}{\multirow{}{\textpercent}{ +}}& - -\multicolumn{}{|p{\textpercent}|}{ -}\\ - + +\\ @@ -289,29 +308,14 @@ border-bottom: thin --> - margin: ; - -\vspace{} - - -\vspace{} - + + Index: Documentation/XML_Tags =================================================================== RCS file: /u2/cvsroot/wv/Documentation/XML_Tags,v retrieving revision 1.1 diff -u -w -r1.1 XML_Tags --- Documentation/XML_Tags 1999/12/13 15:41:06 1.1 +++ Documentation/XML_Tags 1999/12/15 09:06:35 @@ -28,8 +28,7 @@ There are a number of tags which only exist with table, there are , this is the percentage width of the table in -terms of the total page width, the number printed here will contain % at -the end automatically +terms of the total page width. , this is the maximum number of columns that are in this table. , this is the maximum number of rows that are in this @@ -72,8 +71,9 @@ , this is the number of rows that this cell spans , this is the number of columns that this cell spans, , this is the percentage width of the cell in -terms on the total table width, the number printed here will contain % -at the end automatically +terms on the total table width, handy for html +, this is the percentage width of the cell in +terms on the total page width, handy for latex , this will print the color of the background of the cell (word can color each cell seperately), the color will be as speced in the color tags mentioned later