diff options
author | Eike Rathke <erack@redhat.com> | 2016-12-05 22:23:39 +0100 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2016-12-05 22:31:44 +0000 |
commit | cb482a351ad4410df1bc15a026891080cfec9af1 (patch) | |
tree | 52c49686373c584a46773cd5d83d8a892bdc5fb7 | |
parent | 962b53a3a36c388d7fa9706541e3d630292861c4 (diff) |
attempt to fix Linux-rpm_deb-x86_71-TDF tinderbox build for 5-2, tdf#101363
See http://tinderbox.libreoffice.org/cgi-bin/gunzip.cgi?tree=libreoffice-5-2&brief-log=1480964401.32227
(as long as it is there)
Change-Id: If119a19e2f5dbe53298f0b30b5749997d99bf884
(cherry picked from commit 39aa5c2c653f36393416a6aadd6e599051bbfe7b)
Reviewed-on: https://gerrit.libreoffice.org/31657
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Eike Rathke <erack@redhat.com>
-rw-r--r-- | sc/source/filter/excel/xetable.cxx | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sc/source/filter/excel/xetable.cxx b/sc/source/filter/excel/xetable.cxx index 287024a70553..06170a14e134 100644 --- a/sc/source/filter/excel/xetable.cxx +++ b/sc/source/filter/excel/xetable.cxx @@ -1679,7 +1679,14 @@ void XclExpColinfo::SaveXml( XclExpXmlStream& rStrm ) // 100 number - used to limit precision to 0.01 with formula =Truncate( {value}*100+0.5 ) / 100 // 0.5 number (0.005 to output value) - used to increase value before truncating, // to avoid situation when 2.997 will be truncated to 2.99 and not to 3.00 - const double nTruncatedExcelColumnWidth = std::trunc( nExcelColumnWidth * 100.0 + 0.5 ) / 100.0; + + // First create an integer value to not have a double floating point with + // something optimized away or into.. yes that was significant in a + // Linux-rpm_deb-x86_71-TDF tinderbox build that oddly produced 24.23 + // instead of 24 in a test case but only for 5-2 ... + const sal_Int32 nTruncatedInt = static_cast<sal_Int32>(std::trunc( nExcelColumnWidth * 100.0 + 0.5 )); + const double nTruncatedExcelColumnWidth = static_cast<double>(nTruncatedInt) / 100.0; + rStrm.GetCurrentStream()->singleElement( XML_col, // OOXTODO: XML_bestFit, XML_collapsed, XclXmlUtils::ToPsz( ::get_flag( mnFlags, EXC_COLINFO_COLLAPSED ) ), |