Added patches that were uploaded to Chicago patch area.
This commit is contained in:
parent
358e24c07b
commit
4f2cdde40b
48
cole/cole.c
48
cole/cole.c
@ -1,3 +1,5 @@
|
||||
|
||||
|
||||
/*
|
||||
cole - A free C OLE library.
|
||||
Copyright 1998, 1999 Roberto Arturo Tena Sanchez
|
||||
@ -20,8 +22,12 @@
|
||||
Arturo Tena <arturo@directmail.org>
|
||||
*/
|
||||
|
||||
#if !(defined( __BORLANDC__ ) || defined( __WIN32__ ))
|
||||
#include "config.h"
|
||||
#include "cole.h"
|
||||
#else
|
||||
#include "cole.h.in"
|
||||
#endif
|
||||
|
||||
#include "internal.h"
|
||||
#include <stdlib.h>
|
||||
@ -189,7 +195,7 @@ cole_umount (COLEFS *colefilesystem, COLERRNO *colerrno)
|
||||
if (colerrno != NULL) *colerrno = COLE_ECLOSEFILE;
|
||||
ret = 1;
|
||||
}
|
||||
#if defined(WIN32)
|
||||
#if defined(__WIN32__) || (__BORLANDC__)
|
||||
if (remove (colefilesystem->sbfilename) && !ret) {
|
||||
if (colerrno != NULL) *colerrno = COLE_EREMOVE;
|
||||
ret = 1;
|
||||
@ -243,9 +249,6 @@ __cole_print_tree_indir(COLEDIR *cd, void *info, COLERRNO *colerrno)
|
||||
* Modify colerrno comment in the functions that call it,
|
||||
* ie. cole_print_tree().
|
||||
*/
|
||||
(void) cd; /*UNUSED*/
|
||||
(void) colerrno; /*UNUSED*/
|
||||
|
||||
(*((long*)info))++;
|
||||
return 0;
|
||||
}
|
||||
@ -258,9 +261,6 @@ __cole_print_tree_outdir(COLEDIR *cd, void *info, COLERRNO *colerrno)
|
||||
* Modify colerrno comment in the functions that call it,
|
||||
* ie. cole_print_tree().
|
||||
*/
|
||||
(void) cd; /*UNUSED*/
|
||||
(void) colerrno; /*UNUSED*/
|
||||
|
||||
(*((long*)info))--;
|
||||
return 0;
|
||||
}
|
||||
@ -275,9 +275,6 @@ __cole_print_tree_inroot(COLEDIR *cd, void *info, COLERRNO *colerrno)
|
||||
*/
|
||||
char *entry_name;
|
||||
|
||||
(void) info; /*UNUSED*/
|
||||
(void) colerrno; /*UNUSED*/
|
||||
|
||||
printf ("DIR ");
|
||||
printf (" %7zu", cole_dir_getsize (cd));
|
||||
printf (" %08lx-%08lx %08lx-%08lx",
|
||||
@ -306,8 +303,6 @@ __cole_print_tree_indirentry(COLEDIRENT *cde, void *info, COLERRNO *colerrno)
|
||||
long level;
|
||||
long i;
|
||||
|
||||
(void) colerrno; /*UNUSED*/
|
||||
|
||||
level = *((long*)info);
|
||||
for (i = 0; i < level; i++) {
|
||||
if (i == level - 1)
|
||||
@ -412,8 +407,6 @@ cole_opendir_direntry (COLEDIRENT *coledirentry, COLERRNO *colerrno)
|
||||
int
|
||||
cole_closedir (COLEDIR *coledir, COLERRNO *colerrno)
|
||||
{
|
||||
(void) colerrno; /*UNUSED*/
|
||||
|
||||
free (coledir);
|
||||
|
||||
return 0;
|
||||
@ -601,7 +594,7 @@ cole_fopen (COLEFS *colefilesystem, char *filename, COLERRNO *colerrno)
|
||||
_cole_fopen_action, colerrno)) {
|
||||
/* couldn't locate the filename */
|
||||
/* colerrno is set */
|
||||
return NULL;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (info.succ)
|
||||
@ -624,13 +617,15 @@ _cole_fopen_action (COLEDIRENT *cde, void *_info)
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
info->file = cole_fopen_direntry (cde, &info->colerrno);
|
||||
|
||||
if (info->file == NULL) {
|
||||
/* colerrno is set */
|
||||
info->succ = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
info->succ = 1;
|
||||
}
|
||||
|
||||
@ -838,39 +833,46 @@ cole_fseek (COLEFILE *colefile, size_t delta, COLE_SEEK_FLAG direction,
|
||||
case COLE_SEEK_SET:
|
||||
if (delta <= colefile->filesize) {
|
||||
colefile->pos = delta;
|
||||
return 0;
|
||||
|
||||
} else {
|
||||
if (colerrno != NULL) *colerrno = COLE_EFSEEKDELTA;
|
||||
return 1;
|
||||
}
|
||||
break;
|
||||
case COLE_SEEK_END:
|
||||
if (delta <= colefile->filesize) {
|
||||
colefile->pos = colefile->filesize - delta;
|
||||
return 0;
|
||||
|
||||
} else {
|
||||
if (colerrno != NULL) *colerrno = COLE_EFSEEKDELTA;
|
||||
return 1;
|
||||
}
|
||||
break;
|
||||
case COLE_SEEK_BACKWARD:
|
||||
if (delta <= colefile->pos) {
|
||||
colefile->pos = colefile->pos - delta;
|
||||
return 0;
|
||||
|
||||
} else {
|
||||
if (colerrno != NULL) *colerrno = COLE_EFSEEKDELTA;
|
||||
return 1;
|
||||
}
|
||||
break;
|
||||
case COLE_SEEK_FORWARD:
|
||||
if (delta <= colefile->filesize - colefile->pos) {
|
||||
colefile->pos = colefile->pos + delta;
|
||||
return 0;
|
||||
|
||||
} else {
|
||||
if (colerrno != NULL) *colerrno = COLE_EFSEEKDELTA;
|
||||
return 1;
|
||||
}
|
||||
|
||||
break;
|
||||
default:
|
||||
if (colerrno != NULL) *colerrno = COLE_EFSEEKFLAG;
|
||||
return 1;
|
||||
}
|
||||
|
||||
fseek(colefile->file,colefile->pos,SEEK_SET);
|
||||
}
|
||||
|
||||
|
||||
@ -1117,8 +1119,8 @@ cole_locate_filename (COLEFS *colefilesystem, char *filename,
|
||||
|
||||
/* FIXME allow no absolute paths */
|
||||
if (filename[0] != '/') {
|
||||
if (colerrno != NULL) *colerrno = COLE_EBROKENFILENAME;
|
||||
return 1;
|
||||
if (colerrno != NULL) *colerrno = COLE_EBROKENFILENAME;
|
||||
return 1;
|
||||
}
|
||||
|
||||
_info.action = action;
|
||||
@ -1145,8 +1147,6 @@ cole_locate_filename (COLEFS *colefilesystem, char *filename,
|
||||
static int
|
||||
__cole_locate_filename_visitdir (COLEDIR *cd, void *info)
|
||||
{
|
||||
(void) cd; /*UNUSED*/
|
||||
|
||||
return ((struct __cole_locate_filenameinfo *)info)->visitdir;
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* config.h.in. Generated automatically from configure.in by autoheader. */
|
||||
/* config.h.in. Generated automatically from configure.in by autoheader 2.13. */
|
||||
|
||||
/* Define to empty if the keyword does not work. */
|
||||
#undef const
|
||||
|
@ -7,7 +7,7 @@ INCLUDES = -I../cole
|
||||
noinst_PROGRAMS = pptdump
|
||||
man_MANS = ppthtml.1
|
||||
bin_SCRIPTS = nspptview
|
||||
bin_PROGRAMS = ppthtml
|
||||
bin_PROGRAMS = ppthtml
|
||||
LDADD = ../cole/libcole.a
|
||||
ppthtml_SOURCES = ppthtml.c
|
||||
ppthtml_SOURCES = ppthtml.c vector.c
|
||||
#AM_CFLAGS = -Wall -Wshadow -Wcast-align -Wpointer-arith
|
||||
|
@ -81,9 +81,9 @@ INCLUDES = -I../cole
|
||||
noinst_PROGRAMS = pptdump
|
||||
man_MANS = ppthtml.1
|
||||
bin_SCRIPTS = nspptview
|
||||
bin_PROGRAMS = ppthtml
|
||||
bin_PROGRAMS = ppthtml
|
||||
LDADD = ../cole/libcole.a
|
||||
ppthtml_SOURCES = ppthtml.c
|
||||
ppthtml_SOURCES = ppthtml.c vector.c
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
CONFIG_HEADER = ../config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
@ -94,7 +94,7 @@ DEFS = @DEFS@ -I. -I$(srcdir) -I..
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBS = @LIBS@
|
||||
ppthtml_OBJECTS = ppthtml.o
|
||||
ppthtml_OBJECTS = ppthtml.o vector.o
|
||||
ppthtml_LDADD = $(LDADD)
|
||||
ppthtml_DEPENDENCIES = ../cole/libcole.a
|
||||
ppthtml_LDFLAGS =
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -83,6 +83,27 @@ void OutputTableHTML(void)
|
||||
do_cr();
|
||||
printf("<TABLE BORDER=\"1\" CELLSPACING=\"2\">");
|
||||
do_cr();
|
||||
if (TableHeaders)
|
||||
{
|
||||
printf("<TR><TH></TH>");
|
||||
for (k=ws_array[i]->first_col; k<=ws_array[i]->biggest_col; k++)
|
||||
{
|
||||
char col_hdr[3];
|
||||
if (k < 26)
|
||||
{
|
||||
col_hdr[0]='A' + (k % 26);
|
||||
col_hdr[1]='\0';
|
||||
}
|
||||
else
|
||||
{
|
||||
col_hdr[0]='A' - 1 + (k / 26);
|
||||
col_hdr[1]='A' + (k % 26);
|
||||
col_hdr[2]='\0';
|
||||
}
|
||||
printf("<TH>%s%s",col_hdr,(aggressive ? "" : "</TH>"));
|
||||
}
|
||||
printf("</TR>\n");
|
||||
}
|
||||
for (j=ws_array[i]->first_row; j<=ws_array[i]->biggest_row; j++)
|
||||
{
|
||||
update_default_alignment(i, j);
|
||||
@ -98,6 +119,8 @@ void OutputTableHTML(void)
|
||||
else
|
||||
printf(">");
|
||||
}
|
||||
if (TableHeaders)
|
||||
printf("<TH>%d%s",j+1,(aggressive ? "" : "</TH>"));
|
||||
for (k=ws_array[i]->first_col; k<=ws_array[i]->biggest_col; k++)
|
||||
{
|
||||
output_cell(ws_array[i]->c_array[(j*ws_array[i]->max_cols)+k],0); /* This stuff happens for each cell... */
|
||||
|
@ -89,6 +89,20 @@ S32 getLong(U8 *ptr)
|
||||
}
|
||||
|
||||
#ifndef WORDS_BIGENDIAN /* Defined in <config.h> */
|
||||
#ifdef __arm__
|
||||
/* cross-endian doubles in little endian ARM */
|
||||
void getDouble(U8 *ptr, F64 *d)
|
||||
{
|
||||
size_t i;
|
||||
F64 dd;
|
||||
U8 *t = (U8 *)ⅆ
|
||||
|
||||
for (i=0; i<sizeof(F64); i++)
|
||||
*(t+i) = *(ptr+(i^4));
|
||||
|
||||
*d = (F64)dd;
|
||||
}
|
||||
#else
|
||||
/*! Little Endian - 0x86 family */
|
||||
void getDouble(U8 *ptr, F64 *d)
|
||||
{
|
||||
@ -101,6 +115,7 @@ void getDouble(U8 *ptr, F64 *d)
|
||||
|
||||
*d = (F64)dd;
|
||||
}
|
||||
#endif
|
||||
#else
|
||||
/*! Big Endian version - UltraSparc's, etc. */
|
||||
void getDouble (U8 *ptr, F64 *d)
|
||||
@ -210,12 +225,21 @@ typedef S32 swords[2];
|
||||
(((union{swords sw; F64 dub;} *)(ptr))->sw)
|
||||
|
||||
#ifndef WORDS_BIGENDIAN /*! Defined in <config.h> */
|
||||
#ifdef __arm__
|
||||
/* cross-endian doubles in little endian ARM */
|
||||
void RKtoDouble(S32 n, F64 *d)
|
||||
{
|
||||
noaliasdub(swords,d)[0] = n << 2;
|
||||
noaliasdub(swords,d)[1] = 0;
|
||||
}
|
||||
#else
|
||||
/*! Little Endian - 0x86 family */
|
||||
void RKtoDouble(S32 n, F64 *d)
|
||||
{
|
||||
noaliasdub(swords,d)[0] = 0;
|
||||
noaliasdub(swords,d)[1] = n << 2;
|
||||
}
|
||||
#endif
|
||||
#else
|
||||
/*! Big Endian version - UltraSparc's, etc. */
|
||||
void RKtoDouble(S32 n, F64 *d)
|
||||
|
@ -211,6 +211,7 @@ int DumpPage = 0; /*!< Dump page count & max cols & rows */
|
||||
int Xtract = 0; /*!< Extract a range on a page. */
|
||||
int MultiByte = 0; /*!< Output as multibyte */
|
||||
int NoHeaders = 0; /*!< Don't output html header */
|
||||
int TableHeaders = 0; /*!< Output row/column headers */
|
||||
|
||||
|
||||
/* Some Global Flags */
|
||||
@ -299,6 +300,8 @@ int main (int argc, char **argv)
|
||||
print_version();
|
||||
else if(strcmp(argv[i], "-nh") == 0 )
|
||||
NoHeaders = 1;
|
||||
else if(strcmp(argv[i], "-th") == 0 )
|
||||
TableHeaders = 1;
|
||||
else if (strncmp(argv[i], "-xc:", 4) == 0)
|
||||
{
|
||||
int d1, d2;
|
||||
|
@ -152,6 +152,7 @@ extern char *default_image;
|
||||
extern int aggressive;
|
||||
extern int center_tables;
|
||||
extern int NoHeaders;
|
||||
extern int TableHeaders;
|
||||
extern int formula_warnings;
|
||||
extern int Csv;
|
||||
extern xf_attr **xf_array;
|
||||
|
Loading…
Reference in New Issue
Block a user