void wvGetFullTableInit (wvParseStruct * ps, U32 para_intervals, BTE * btePapx, U32 * posPapx) { PAPX_FKP para_fkp; U32 para_fcFirst, para_fcLim = 0xffffffffL; PAP apap; U32 i, j = 0; TAP *test = NULL; wvVersion ver = wvQuerySupported (&ps->fib, NULL); if (ps->intable) return; wvInitPAPX_FKP (¶_fkp); i = wvStream_tell (ps->mainfd); wvTrace (("TOP\n")); do { wvReleasePAPX_FKP (¶_fkp); wvGetSimpleParaBounds (ver, ¶_fkp, ¶_fcFirst, ¶_fcLim, i, btePapx, posPapx, para_intervals, ps->mainfd); wvAssembleSimplePAP (ver, &apap, para_fcLim, ¶_fkp, ps); wvTrace (("para from %x to %x\n", para_fcFirst, para_fcLim)); i = para_fcLim; /* ignore the row end markers */ /*if (apap.ptap.itcMac)*/ /* we ascertain the number of rows by counting the end of row markers. NB: a row marker can have a 0 itcMac*/ if (apap.fTtp) { test = (TAP *) realloc (test, sizeof (TAP) * (j + 1)); wvCopyTAP (&(test[j]), &apap.ptap); wvTrace (("Row %d\n", j)); j++; } } while (apap.fInTable); wvTrace (("BOTTOM\n")); wvReleasePAPX_FKP (¶_fkp); wvSetTableInfo (ps, test, j); ps->intable = 1; ps->norows = j; wvFree (test); }
void wvGetComplexRowTap (wvParseStruct * ps, PAP * dpap, U32 para_intervals, BTE * btePapx, U32 * posPapx, U32 piece) { PAPX_FKP para_fkp; U32 para_fcFirst, para_fcLim = 0xffffffffL; PAP apap; U32 i; S32 j = 0; wvVersion ver = wvQuerySupported (&ps->fib, NULL); wvCopyPAP (&apap, dpap); wvInitPAPX_FKP (¶_fkp); i = wvStream_tell (ps->mainfd); do { wvReleasePAPX_FKP (¶_fkp); wvTrace ( ("3: cp and fc are %x(%d) %x\n", i, i, wvConvertCPToFC (i, &ps->clx))); piece = wvGetComplexParaBounds (ver, ¶_fkp, ¶_fcFirst, ¶_fcLim, i, &ps->clx, btePapx, posPapx, para_intervals, piece, ps->mainfd); if (piece == 0xffffffffL) break; wvAssembleSimplePAP (ver, &apap, para_fcLim, ¶_fkp, ps); wvAssembleComplexPAP (ver, &apap, piece, ps); wvTrace ( ("para from %x to %x, table is %d\n", para_fcFirst, para_fcLim, apap.fInTable)); i = para_fcLim; } while (apap.fTtp == 0); wvReleasePAPX_FKP (¶_fkp); wvCopyTAP (&(dpap->ptap), &apap.ptap); for (j = 0; j < apap.ptap.itcMac + 1; j++) wvTrace (("This Row-->%d\n", apap.ptap.rgdxaCenter[j])); }
void wvInitTAP(TAP *item) { int i; static TAP cache; static int test = 0; if (!test) { cache.jc = 0; cache.dxaGapHalf = 0; cache.dyaRowHeight = 0; cache.fCantSplit = 0; cache.fTableHeader = 0; wvInitTLP(&cache.tlp); cache.lwHTMLProps = 0; cache.fCaFull = 0; cache.fFirstRow = 0; cache.fLastRow = 0; cache.fOutline = 0; cache.reserved = 0; cache.itcMac = 0; cache.dxaAdjust = 0; cache.dxaScale = 0; cache.dxsInch = 0; for (i = 0; i < itcMax + 1; i++) cache.rgdxaCenter[i] = 0; for (i = 0; i < itcMax + 1; i++) cache.rgdxaCenterPrint[i] = 0; for (i = 0; i < itcMax; i++) wvInitTC(&(cache.rgtc[i])); for (i = 0; i < itcMax; i++) wvInitSHD(&(cache.rgshd[i])); for (i = 0; i < 6; i++) wvInitBRC(&(cache.rgbrcTable[i])); test++; } wvCopyTAP(item, &cache); }
void wvGetRowTap (wvParseStruct * ps, PAP * dpap, U32 para_intervals, BTE * btePapx, U32 * posPapx) { PAPX_FKP para_fkp; U32 para_fcFirst, para_fcLim = 0xffffffffL; PAP apap; U32 i; S32 j = 0; wvVersion ver = wvQuerySupported (&ps->fib, NULL); wvCopyPAP (&apap, dpap); wvInitPAPX_FKP (¶_fkp); i = wvStream_tell (ps->mainfd); wvTrace (("RowTab begin\n")); do { wvReleasePAPX_FKP (¶_fkp); wvGetSimpleParaBounds (ver, ¶_fkp, ¶_fcFirst, ¶_fcLim, i, btePapx, posPapx, para_intervals, ps->mainfd); wvTrace (("2: para from %x to %x\n", para_fcFirst, para_fcLim)); wvAssembleSimplePAP (ver, &apap, para_fcLim, ¶_fkp, ps); i = para_fcLim; } while ((apap.fTtp == 0) && apap.fInTable); /* placing '&& apap.fInTable' here fixes #11433. I can't find any regressions */ wvTrace (("fTtp is %d\n", apap.fTtp)); wvReleasePAPX_FKP (¶_fkp); wvCopyTAP (&(dpap->ptap), &apap.ptap); for (j = 0; j < apap.ptap.itcMac + 1; j++) wvTrace (("This Row-->%d\n", apap.ptap.rgdxaCenter[j])); }
void wvGetComplexFullTableInit (wvParseStruct * ps, U32 para_intervals, BTE * btePapx, U32 * posPapx, U32 piece) { PAPX_FKP para_fkp; U32 para_fcFirst, para_fcLim = 0xffffffffL; PAP apap; U32 i, j = 0, k = 0; S32 l; TAP *test = NULL; wvVersion ver = wvQuerySupported (&ps->fib, NULL); if (ps->intable) return; #if 0 /* some testing code */ wvTrace (("before test\n")); TheTest (ps, piece, btePapx, posPapx, para_intervals); wvTrace (("after test\n")); #endif wvInitPAPX_FKP (¶_fkp); i = wvStream_tell (ps->mainfd); wvTrace (("TOP\n")); do { wvTrace (("cycle again\n")); wvReleasePAPX_FKP (¶_fkp); wvTrace ( ("2: cp and fc are %x(%d) %x\n", i, i, wvConvertCPToFC (i, &ps->clx))); piece = wvGetComplexParaBounds (ver, ¶_fkp, ¶_fcFirst, ¶_fcLim, i, &ps->clx, btePapx, posPapx, para_intervals, piece, ps->mainfd); if (piece == 0xffffffffL) break; wvAssembleSimplePAP (ver, &apap, para_fcLim, ¶_fkp, ps); wvTrace (("para from %x to %x\n", para_fcFirst, para_fcLim)); wvAssembleComplexPAP (ver, &apap, piece, ps); wvTrace (("para from %x to %x\n", para_fcFirst, para_fcLim)); i = para_fcLim; /* ignore the row end markers */ /* if ((apap.ptap.itcMac) (apap.fTtp))*/ /* we ascertain the number of rows by counting the end of row markers. NB: a row marker can have a 0 itcMac*/ if (apap.fTtp) { test = (TAP *) realloc (test, sizeof (TAP) * (j + 1)); wvCopyTAP (&(test[j]), &apap.ptap); for (l = 0; l < apap.ptap.itcMac + 1; l++) wvTrace (("In This Row-->%d\n", apap.ptap.rgdxaCenter[l])); j++; } if (apap.fTtp) k++; } while (apap.fInTable); wvTrace (("BOTTOM\n")); #ifdef DEBUG if (piece == 0xffffffffL) wvTrace (("broken on line %d\n", j)); #endif wvTrace (("no of lines is %d %d\n", j, k)); wvReleasePAPX_FKP (¶_fkp); wvSetTableInfo (ps, test, j); ps->intable = 1; ps->norows = j; wvFree (test); }