Asign correct column width when importing XLS file

Desktop / KDE / Calligra - David Llewellyn-Jones [jolla.com] - 30 October 2019 07:39 EDT

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

2. 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

e80856e8eb6 Asign correct column width when importing XLS file
filters/sheets/excel/sidewinder/sheet.cpp | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

Upstream: quickgit.kde.org


  • Share