Asign correct column width when importing XLS file

Authored by davidllewellynjones on Oct 30 2019, 7:37 AM.

Description

Asign correct column width when importing XLS file

Summary:
When importing an Excel 97-2003 .xls file (using the excel importer) the column widths don't match those from the file exported from Excel (or LibreOffice). Moreover, the widths of the columns depend on the dpi of the device in use, even though this doesn't affect the contents of the cells.

For any screen that is higher than 96 dpi the columns will be too narrow and cell contents are likely to be truncated.

This patch fixes the issue so that the correct column widths are assigned. As far as I can tell, this is the only situation where QWidget.physicalDpiX() is being explicitly used in the code.

http://www.flypig.co.uk/dnload/dnload/other/calligra-column-widths.zip

Test Plan:

  1. Download the following archive and extract the test-widths.xls and test-widths.xlsx files.

http://www.flypig.co.uk/dnload/dnload/other/calligra-column-widths.zip

  1. Open the files. The column widths should be the same.

The archive also contains screenshots of the patched and unpatched versions of Calligra using two different dpi screens.

Reviewers: #calligra:_3.0, pvuorela

Reviewed By: pvuorela

Subscribers: dcaliste, davidllewellynjones, Calligra-Devel-list

Tags: #calligra:_3.0

Differential Revision: https://phabricator.kde.org/D24761

Details

Committed
pvuorelaOct 30 2019, 7:39 AM
Reviewer
pvuorela
Differential Revision
D24761: Asign correct column width when importing XLS file
Parents
R8:1b17db1a98ec: Better charset, unicode and image support for RTF files
Branches
Unknown
Tags
Unknown