https://bugs.freedesktop.org/show_bug.cgi?id=40713
Chris Severance <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] --- Comment #15 from Chris Severance <[email protected]> --- Created attachment 108475 --> https://bugs.freedesktop.org/attachment.cgi?id=108475&action=edit dBase DBF files with memo fields.zip Bug: LO-Calc save as DBF fails to create a memo file when columns contain a memo field. The DBF file is unusable because it contains memo references to a memo file that doesn't exist. Language is not relevant to this bug. Use CP850. This bug applies to all known versions of LO-Calc up to and including 4.3.2.2 Included are two pairs of test files, one created in dBase III and one created in Foxpro. LO-Calc imports both correctly, correctly detecting whether the memo is the dBase DBT or the Foxpro FPT. This means that code to read memo fields exists within LO-Calc. The bug lies in LO-Calc save as DBF. To test that you do not need the test files though they do serve as a handy reference. Create a new spreadsheet and paste this in using semicolon (;) as the column delimiter. MESSAGE,C,10;TEXT,M "MESSAGE";"Some memo text!" "MESSAGE2";"More memo text!" Save as DBF: test.dbf Expected result: TEST.DBF, TEST.DBT or TEST.FPT Actual result: TEST.DBF The first thing we notice is that LO-Calc does not ask us what memo format we want. Foxpro can read DBT but dBase3 cannot read FPT. It is acceptable to always write a DBT but a better implementation would ask which format is desired or have a "Settings" option that specifies which to use. Note that there are other memo implementations not available to me. The next thing we note is that a 140 byte DBF file is created but no DBT or FPT is created. The memo text has been lost on save. We can use Linux hexdump to see what's inside the dbf. http://www.dbase.com/KnowledgeBase/int/db7_file_fmt.htm hexdump -C test.dbf 00000000 83 0e 0a 1a 02 00 00 00 61 00 15 00 00 00 00 00 |........a.......| 00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000020 4d 45 53 53 41 47 45 00 00 00 00 43 00 00 00 00 |MESSAGE....C....| 00000030 0a 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000040 54 45 58 54 00 00 00 00 00 00 00 4d 00 00 00 00 |TEXT.......M....| 00000050 0a 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000060 0d 20 4d 45 53 53 41 47 45 20 20 20 30 30 30 30 |. MESSAGE 0000| 00000070 30 30 30 30 30 31 20 4d 45 53 53 41 47 45 32 20 |000001 MESSAGE2 | 00000080 20 30 30 30 30 30 30 30 30 30 32 1a | 0000000002.| If we view the DBF in a hex viewer we see that the first byte is 0x83. The 0x80 signifies that the DBF has standard memo fields. We also see on the right that the field "TEXT" is marked with an M for memo. We also see that the file pointers stored in the DBF data for the memo texts are 0000000001 and 0000000002 which are likely right. It seems that all of the code necessary for producing a DBF and it's memo file is present in LO-Calc. LO-Calc just doesn't create the memo file. LO-Calc can read the memo files but doesn't create them. Attempts to open the DBF with a missing memo file fail with errors. Foxpro: MEMO file is missing/invalid. dBase3: .DBT file cannot be opened. -- You are receiving this mail because: You are the assignee for the bug.
_______________________________________________ Libreoffice-bugs mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs
