After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 70327 - Failure to import Applixware sheet: "Unknown font modifier"
Failure to import Applixware sheet: "Unknown font modifier"
Status: VERIFIED INCOMPLETE
Product: Gnumeric
Classification: Applications
Component: import/export Text
1.0.x
Other other
: Normal normal
: ---
Assigned To: Jody Goldberg
Jody Goldberg
Depends on:
Blocks:
 
 
Reported: 2002-02-01 23:16 UTC by Greg Ward
Modified: 2009-08-15 18:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Applix spreadsheet that Gnumeric fails to import (16.76 KB, application/applixware)
2002-02-01 23:19 UTC, Greg Ward
Details
Slight variation on test1.as which Gnumeric can import (16.74 KB, application/applixware)
2002-02-01 23:19 UTC, Greg Ward
Details
requested Applix spreadsheet: 5 cells, 5 fonts (4.30 KB, application/applixware)
2002-02-10 17:25 UTC, Greg Ward
Details

Description Greg Ward 2002-02-01 23:16:46 UTC
I've been having problems importing an Applixware spreadsheet.  I've 
managed to whittle the problem down to a 2-cell spreadsheet; I have 
two versions of this sheet, one which Gnumeric fails to import and one 
which it can import.

The sheet looks like this:
  A1: empty
  B1: 0.0

The problem seems to lie in the formatting of cell A1.  Version 1 of 
my test spreadsheet (which I'll attempt to attach as test1.as) has 
whatever formatting was leftover from the original spreadsheet that 
triggered the problem.  Version 2 (test2.as) differs from version 1 
only in that I have cleared everything from cell A1, ie. hit Ctrl-D on 
it (in Applixware!).  This presumably clears all formatting and 
content from the cell.

When I attempt to import test1.as to Gnumeric 1.0.2, I get an error 
dialog saying 
  Parse error while reading Applix file.

  Unknown font modifier

Importing test2.as works just fine.

Not surprisingly the text diff between test1.as and test2.as is very 
small:

--- test1.as    Fri Feb  1 18:08:02 2002
+++ test2.as    Fri Feb  1 18:08:02 2002
@@ -61 +60,0 @@
-<(CO2|TF0,fg|) >
@@ -130 +129 @@
-Row List A !1: 0-0:3 
+Row List A !1: 0-0:1 

I imagine someone who reads Applixware files would understand this; I 
don't.  ;-)

Anyways, I'll attempt to attach the two test files to this bug report 
so someone can play with them and see if Gnumeric can be persuaded to 
import test1.as.  It's just two cells, after all, and one of them's 
empty...
Comment 1 Greg Ward 2002-02-01 23:19:06 UTC
Created attachment 6580 [details]
Applix spreadsheet that Gnumeric fails to import
Comment 2 Greg Ward 2002-02-01 23:19:53 UTC
Created attachment 6581 [details]
Slight variation on test1.as which Gnumeric can import
Comment 3 Jody Goldberg 2002-02-02 22:40:31 UTC
Hmm, I'm going to need help from someone with Applix on this.
The issue is the TF0.  That indicates that the format is using font index '0'
However, my guess was that the index was ONE based.  TF1 is the lowest index
that should have been possible.

It would be very helpful if you can send me an applix workbook where each of
lets say 5 cells uses a different font.  Not just different sizes,or boldness.
Different actual faces.  This would help me track how the offset works.

Once that is know the fix should be pretty trivial.
Comment 4 Greg Ward 2002-02-10 17:25:51 UTC
Created attachment 6678 [details]
requested Applix spreadsheet: 5 cells, 5 fonts
Comment 5 Greg Ward 2002-02-10 17:32:11 UTC
OK, I've just uploaded 5fonts.as which, as requested, has 5 cells 
with 5 different typefaces:

A1: helvetica
A2: courier
A3: avant garde
A4: palatino
A5: times

Interestingly enough, Gnumeric imports this spreadsheet, but it 
gets the fonts wrong: 
  helvetica   -> Helvetica
  courier     -> Helvetica
  avant garde -> Times
  palatino    -> Morewingbats
  times       -> Zapf Dingbats
Comment 6 Jody Goldberg 2002-02-10 19:12:01 UTC
Perfect, that clarifies things nicely.  The index is 0 based rather than 1.
The patch is trivial and will be in 1.0.5 scheduled for Mar 1.

Index: applix-read.c
===================================================================
RCS file: /cvs/gnome/gnumeric/plugins/applix/applix-read.c,v
retrieving revision 1.40
diff -u -w -r1.40 applix-read.c
--- applix-read.c       2002/01/10 21:30:05     1.40
+++ applix-read.c       2002/02/10 19:11:03
@@ -553,10 +553,10 @@
                                        char *start = (sep += 2);
                                        int font_id = strtol (start, &sep, 10);
 
-                                       if (start == sep || font_id < 1 || font_id > (int)state->font_names->len)
+                                       if (start == sep || font_id < 0 || font_id >= (int)state->font_names->len)
                                                (void) applix_parse_error (state, "Unknown font modifier");
                                        else {
-                                               char const *name = g_ptr_array_index (state->font_names, font_id-1);
+                                               char const *name = g_ptr_array_index (state->font_names, font_id);
                                                mstyle_set_font_name (style, name);
                                        }
                                        break;