Some simple bug fixes

This commit is contained in:
slidedraw 2002-10-25 20:12:32 +00:00
parent 117379f7a6
commit f0279e67f1
4 changed files with 21 additions and 5 deletions

View File

@ -9,7 +9,7 @@ man_MANS = xlhtml.1
bin_SCRIPTS = nsopen nsxlview
bin_PROGRAMS = xlhtml
LDADD = ../cole/libcole.a -lm
xlhtml_SOURCES = support.c xlhtml.c html.c ascii.c xml.c setupExtraction.c engine.c
xlhtml_SOURCES = support.c xlhtml.c html.c ascii.c xml.c setupExtraction.c
xldump_SOURCES = xldump.c
xlcdump_SOURCES = xlcdump.c
AM_CFLAGS = -Wall -Wshadow -Wcast-align -Wpointer-arith

View File

@ -83,7 +83,7 @@ man_MANS = xlhtml.1
bin_SCRIPTS = nsopen nsxlview
bin_PROGRAMS = xlhtml
LDADD = ../cole/libcole.a -lm
xlhtml_SOURCES = support.c xlhtml.c html.c ascii.c xml.c setupExtraction.c engine.c
xlhtml_SOURCES = support.c xlhtml.c html.c ascii.c xml.c setupExtraction.c
xldump_SOURCES = xldump.c
xlcdump_SOURCES = xlcdump.c
AM_CFLAGS = -Wall -Wshadow -Wcast-align -Wpointer-arith
@ -98,7 +98,7 @@ CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
xlhtml_OBJECTS = support.o xlhtml.o html.o ascii.o xml.o \
setupExtraction.o engine.o
setupExtraction.o
xlhtml_LDADD = $(LDADD)
xlhtml_DEPENDENCIES = ../cole/libcole.a
xlhtml_LDFLAGS =

View File

@ -43,10 +43,11 @@ display_usage (void)
{
fprintf (stderr, "\nxlhtml converts excel files (.xls) to Html.\n"
"Copyright (c) 1999-2001, Charles Wyble. Released under GPL.\n"
"Usage: xlhtml [-xp:# -xc:#-# -xr:#-# -bc###### -bi???????? -tc######] <FILE>\n"
"Usage: xlhtml [-xp:# -xc:#-# -xr:#-# -bc###### -bi???????? -tc###### -sc:?] <FILE>\n"
"\t-a: aggressive html optimization\n"
"\t-asc ascii output for -dp & -x? options\n"
"\t-csv comma separated value output for -dp & -x? options\n"
"\t-sc: separator character to use for -csv option (default is ',')\n"
"\t-xml XML output\n"
"\t-bc: Set default background color - default white\n"
"\t-bi: Set background image path\n"

View File

@ -5,6 +5,7 @@
spreadsheets.
*/
/*
Copyright 2002 Charles N Wyble <jackshck@thewybles.com>
@ -142,6 +143,7 @@ char *default_text_color = "000000";
char *default_background_color = "FFFFFF";
char *default_image = NULL; /*!< Point to background image */
int Csv = 0; /*!< Whether or not to out csv instaed of html */
char CsvCellSeparator = ',' ;
int OutputXML = 0; /*!< Output as xml */
int DumpPage = 0; /*!< Dump page count & max cols & rows */
int Xtract = 0; /*!< Extract a range on a page. */
@ -202,8 +204,21 @@ main (int argc, char **argv)
{
Ascii = 1;
Csv = 1;
}
else if (strncmp(argv[i], "-sc:",4) == 0)
{
char separator_character;
if(sscanf(argv[i] + 4, "%c", &separator_character) != 1)
{
fprintf(stderr, "separator character invalid, expected -xc:? where ? is the character\n");
display_usage();
CsvCellSeparator = separator_character;
}
}
else if (strcmp (argv[i], "-a") == 0)
aggressive = 1;
else if (strcmp (argv[i], "-fw") == 0)