diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2019-11-24 19:16:36 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2019-11-24 19:28:38 +0100 |
commit | 3e1f0c060f02db4515b2dc705bda17ee068d51b4 (patch) | |
tree | 0493bd0d5b8a32a2f43a2b7912759656328f2dd9 /fpicker | |
parent | b004a1bd7bf3885613d52aba70dea79766eae639 (diff) |
tdf#128976: properly calculate default value when writing XLS
XLS stores default column width as 16-bit unsigned integer in the range
from 0 to 255 inclusive ([MS-XLS] 2.4.89 DefColWidth), unlike in OOXML
where any floating-point value is valid. Additionally, some correction
is used, introduced in commit 555d702903fb0857122024e1ab78a72d122d3f16
(basis of empirical formula in XclTools::GetXclDefColWidthCorrection
is unclear). So in XLS, when the default is calculated, we need to take
into account if the resulting stored value will actually represent our
calculated value. If not, then just ignore the calculated value, and
use arbitrary 8 as the default.
With that, following IsDefWidth will correctly check if passed width
is represented by the stored default or not. All widths that can't be
represented as integral count chars in DefColWidth will have fUserSet
set in corresponding ColInfo records, thus correctly keeping widths.
Change-Id: Iedcc5583c861f5b18a422a9b279c48cff729cbc5
Reviewed-on: https://gerrit.libreoffice.org/83613
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'fpicker')
0 files changed, 0 insertions, 0 deletions