Bug 56875 - LibreOffice Calc corrupts .dbf files
Summary: LibreOffice Calc corrupts .dbf files
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
3.5.4 release
Hardware: All All
: medium major
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2012-11-08 13:45 UTC by Robin Lovelace
Modified: 2012-11-11 05:29 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Zip folder of shape files with and without modified .dbf files to illustrate corruption problem (26.59 KB, application/x-zip)
2012-11-08 13:45 UTC, Robin Lovelace
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Robin Lovelace 2012-11-08 13:45:37 UTC
Created attachment 69698 [details]
Zip folder of shape files with and without modified .dbf files to illustrate corruption problem

Simple: when you open a .dbf file associated with a shapefile (.shp), it works fine, you can edit and save and (sometimes successfully) re-open in Calc.

However, when you open the edited shapefile in a GIS program such as QGIS the data has be garbled (only showing numeric data).

This bug has emerged recently: I used to use OO and LO for editing .dbf files all the time and it worked fine for GIS applications. There are a number of tutorials on the internet that recommend using this technique.

I've tested this behavior with the latest version of LibreOffice on a Windows 7 VM, on Ubuntu 12.04. Interestingly, I checked OpenOffice Calc and found that the latest version of OO also corrupts .dbf files for use in QGIS.
Also note the .dbt file that is created every time a .dbf file is saved. Suspect this is at the root of the problem.

Replicable example: extract this .zip file (below), open "points.dbf", edit it, save it, and then load it in QGIS. The results should look like "points-edited-open-office.dbf" when opened in QGIS: the attributes are scrambled.

Replicable dataset to test this on and see what I mean is attached.
Comment 1 Urmas 2012-11-08 16:48:20 UTC
Your file is invalid. The maximum length of a C field is 254 symbols, not 255.