diff --git a/xlhtml/ChangeLog b/xlhtml/ChangeLog
index cdef68f..c48e783 100644
--- a/xlhtml/ChangeLog
+++ b/xlhtml/ChangeLog
@@ -19,6 +19,7 @@ HEAD
* More code modularization
* Fixed handling of fonts (fixes some segfaults, closes bug 529044)
* Fixed "String Table Error" occurences in some (not all) empty cells
+ * Fixed non-functioning -xc: option when -xr: was not also specified
* Added some Alpha portability fixes.
0.5 04/13/02
diff --git a/xlhtml/TODO b/xlhtml/TODO
index 0759a32..65486be 100644
--- a/xlhtml/TODO
+++ b/xlhtml/TODO
@@ -7,6 +7,7 @@
- Modularize code. Separate XLS reading into a library, make a frontend with
various output formats: XML, HTML, CSV...
- Make main_line_processor()'s working buffer grow dynamically
+- Improve error reporting and optional debug output
- Notes from Steve Grubb:
- Support String formulas
- Reduce memory footprint
diff --git a/xlhtml/xlhtml.c b/xlhtml/xlhtml.c
index 175c9f0..4f7c8c9 100644
--- a/xlhtml/xlhtml.c
+++ b/xlhtml/xlhtml.c
@@ -633,31 +633,6 @@ void SetupExtraction(void)
{
ws_array[xp]->first_row = xr1;
ws_array[xp]->biggest_row = xr2;
-
- if (xc1 < 0)
- {
- xc1 = ws_array[xp]->first_col;
- xc2 = ws_array[xp]->biggest_col;
- }
- else if((xc1 >= ws_array[xp]->first_col)&&(xc1 <= ws_array[xp]->biggest_col)
- &&(xc2 >= ws_array[xp]->first_col)&&(xc2 <= ws_array[xp]->biggest_col))
- {
- ws_array[xp]->first_col = xc1;
- ws_array[xp]->biggest_col = xc2;
- }
- else
- {
- if (Ascii)
- fprintf(stderr, "Error - Col not in range during extraction"
- " (%d or %d not in [%d..%d])\n", xc1, xc2, ws_array[xp]->first_col, ws_array[xp]->biggest_col);
- else
- {
- printf("Error - Col not in range during extraction.\n");
-
- output_footer();
- }
- return;
- }
}
else
{
@@ -671,6 +646,30 @@ void SetupExtraction(void)
}
return;
}
+
+ if (xc1 < 0)
+ {
+ xc1 = ws_array[xp]->first_col;
+ xc2 = ws_array[xp]->biggest_col;
+ }
+ else if((xc1 >= ws_array[xp]->first_col)&&(xc1 <= ws_array[xp]->biggest_col)
+ &&(xc2 >= ws_array[xp]->first_col)&&(xc2 <= ws_array[xp]->biggest_col))
+ {
+ ws_array[xp]->first_col = xc1;
+ ws_array[xp]->biggest_col = xc2;
+ }
+ else
+ {
+ if (Ascii)
+ fprintf(stderr, "Error - Col not in range during extraction"
+ " (%d or %d not in [%d..%d])\n", xc1, xc2, ws_array[xp]->first_col, ws_array[xp]->biggest_col);
+ else
+ {
+ printf("Error - Col not in range during extraction.\n");
+ output_footer();
+ }
+ return;
+ }
}
else
{