diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2019-11-24 19:16:36 +0300 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2019-12-04 23:51:46 +0100 |
commit | 7dbfadc2396f2efd385f69b944b2324540b8b0c5 (patch) | |
tree | 9321e3d276ca8dbc79072602a663ad53773365a0 /include | |
parent | tdf#129098: parameters mixed in OPT_PROB_INMONEY (scaddins) (diff) | |
download | core-7dbfadc2396f2efd385f69b944b2324540b8b0c5.tar.gz core-7dbfadc2396f2efd385f69b944b2324540b8b0c5.zip |
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>
(cherry picked from commit 3e1f0c060f02db4515b2dc705bda17ee068d51b4)
Reviewed-on: https://gerrit.libreoffice.org/83616
Reviewed-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions