psiconv issues


Subject: psiconv issues
From: Tamas Decsi (tamas@pressflex.com)
Date: Wed Mar 28 2001 - 01:43:59 CST


Hi Abi-dev,

 attached is a patch against psiconv abipeer. It fixes some typo bugs and
enlargens the number of psion word documents that can be read.
I had sent the patches to Frodo first, and he had committed it into the
psiconv cvs, along with much more improvements irrelevant for abiword.
I know that Frodo is very busy at the moment, so I presume he will not
synchronize the abipeer with the main psiconv cvs before the next release,
therefore I decided to digest the most important changes and send it here.
Please apply the patch.

Also here, I should mention that the latest (0.7.13) windows build is
unable to open psion word files, though the linux build works. So, windows
maintainers, please check the psion word import with the sample files.

Thanks,
Tamas

       The goal of Computer Science is to build something that will last
                  at least until we've finished building it.

diff -Naur abi/psiconv/psiconv/checkuid.c psiconv/lib/psiconv/checkuid.c
--- abi/psiconv/psiconv/checkuid.c Fri Jan 19 06:17:26 2001
+++ psiconv/lib/psiconv/checkuid.c Mon Mar 12 15:53:11 2001
@@ -60,7 +60,7 @@
                            /* bit 1 */ 0x0000ED68,
                            /* bit 2 */ 0x0000CAF1,
                            /* bit 3 */ 0x000085C3,
- /* bit 4 */ 0x000018A7,
+ /* bit 4 */ 0x00001BA7,
                            /* bit 5 */ 0x0000374E,
                            /* bit 6 */ 0x00006E9C,
                            /* bit 7 */ 0x0000DD38,
@@ -68,7 +68,7 @@
                            /* bit 9 */ 0xED680000,
                            /* bit 10 */ 0xCAF10000,
                            /* bit 11 */ 0x85C30000,
- /* bit 12 */ 0x18A70000,
+ /* bit 12 */ 0x1BA70000,
                            /* bit 13 */ 0x374E0000,
                            /* bit 14 */ 0x6E9C0000,
                            /* bit 15 */ 0xDD380000,
diff -Naur abi/psiconv/psiconv/parse_layout.c psiconv/lib/psiconv/parse_layout.c
--- abi/psiconv/psiconv/parse_layout.c Fri Jan 19 06:17:32 2001
+++ psiconv/lib/psiconv/parse_layout.c Mon Mar 5 15:22:01 2001
@@ -451,6 +451,7 @@
         }
         psiconv_debug(lev+3,off+len,"Justify: %02x",temp);
         len ++;
+ break;
       case 0x07:
         psiconv_progress(lev+3,off+len,"Going to read linespacing distance");
         result->linespacing = psiconv_read_size(buf,lev+3,off+len,&leng,&res);
diff -Naur abi/psiconv/psiconv/parse_page.c psiconv/lib/psiconv/parse_page.c
--- abi/psiconv/psiconv/parse_page.c Fri Jan 19 06:17:32 2001
+++ psiconv/lib/psiconv/parse_page.c Fri Mar 9 10:56:07 2001
@@ -31,7 +31,7 @@
 {
   int res = 0;
   int len = 0;
- int i,leng;
+ int i,leng,has_content;
   psiconv_u32 temp;
 
   psiconv_progress(lev+1,off,"Going to read a page header (or footer)");
@@ -39,15 +39,21 @@
     goto ERROR1;
 
   psiconv_progress(lev+2,off+len,
- "Going to read the first byte (0x01 expected)");
+ "Going to read the has_content flag");
   temp = psiconv_read_u8(buf,lev+2,off+len,&res);
   if (res)
     goto ERROR2;
- if (temp != 0x01) {
- psiconv_warn(lev+2,off+len,"Page header first byte mismatch");
- psiconv_debug(lev+2,off+len,"First byte: read %02x, expected %02x",
- temp,0x01);
+ if (temp == 0x00)
+ has_content = 0;
+ else if (temp == 0x01)
+ has_content = 1;
+ else {
+ psiconv_warn(lev+2,off+len,
+ "Page header has_content flag unknown value (assumed default)");
+ psiconv_debug(lev+2,off+len,"Flag: %02x",temp);
+ has_content = 1;
   }
+ psiconv_debug(lev+2,off+len,"Has_content flag: %02x",has_content);
   len += 1;
 
   psiconv_progress(lev+2,off+len,"Going to read displayed-on-first-page flag");
@@ -72,27 +78,34 @@
   psiconv_progress(lev+2,off+len,"Going to read base paragraph layout");
   if (!((*result)->base_paragraph_layout = psiconv_basic_paragraph_layout()))
     goto ERROR2;
- if ((res = psiconv_parse_paragraph_layout_list(buf,lev+2,off+len,&leng,
- (*result)->base_paragraph_layout)))
- goto ERROR3;
- len += leng;
+
+ if (has_content) {
+ if ((res = psiconv_parse_paragraph_layout_list(buf,lev+2,off+len,&leng,
+ (*result)->base_paragraph_layout)))
+ goto ERROR3;
+ len += leng;
+ }
 
   psiconv_progress(lev+2,off+len,"Going to read base character layout");
   if (!((*result)->base_character_layout = psiconv_basic_character_layout()))
     goto ERROR3;
- if ((res = psiconv_parse_character_layout_list(buf,lev+2,off+len,&leng,
- (*result)->base_character_layout)))
- goto ERROR4;
+ if (has_content) {
+ if ((res = psiconv_parse_character_layout_list(buf,lev+2,off+len,&leng,
+ (*result)->base_character_layout)))
+ goto ERROR4;
+ }
   len += leng;
 
  
   psiconv_progress(lev+2,off+len,"Going to read the TextEd section");
- if ((res = psiconv_parse_texted_section(buf,lev+2,off+len,&leng,
- &(*result)->text,
- (*result)->base_character_layout,
- (*result)->base_paragraph_layout)))
- goto ERROR4;
- len += leng;
+ if (has_content) {
+ if ((res = psiconv_parse_texted_section(buf,lev+2,off+len,&leng,
+ &(*result)->text,
+ (*result)->base_character_layout,
+ (*result)->base_paragraph_layout)))
+ goto ERROR4;
+ len += leng;
+ }
 
   if (length)
     *length = len;



This archive was generated by hypermail 2b25 : Wed Mar 28 2001 - 01:44:10 CST