From 1af3d8a211852da5a1f130aa22e00ab329301ee7 Mon Sep 17 00:00:00 2001 From: Adam Co Date: Sun, 8 Jun 2014 16:35:32 +0300 Subject: Rewrite import and export of custom dashes in ooxml filter (fix) The import mechanism of custom-dash (a:custDash) was wrong, and imported wrong values, which causes that if you would import-export-import-export - you would get inflated values, which might cause a corruption. The attributes for custom-dash nodes (a:ds) are of type 'PositivePercentage'. Office will read percentages formatted with a trailing percent sign or formatted as 1000th of a percent without a trailing percent sign, but only write percentages as 1000th's of a percent without a trailing percent sign. During import - LO did not check if it was in '%' format or in '1000th of a percent' format. So that was fixed. Also - when exporting - it always exports now in '1000th of a percent' format. Reviewed-on: https://gerrit.libreoffice.org/9681 Reviewed-by: Miklos Vajna Tested-by: Miklos Vajna (cherry picked from commit 2211a67cc5e577f8abdcc96c9c63865be5fb988d) Conflicts: oox/source/export/drawingml.cxx Change-Id: I6bd74df26951974f85173227c832386c70034afb --- include/oox/export/utils.hxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/oox/export/utils.hxx b/include/oox/export/utils.hxx index 588d231a0491..2c4fcec3b480 100644 --- a/include/oox/export/utils.hxx +++ b/include/oox/export/utils.hxx @@ -50,9 +50,9 @@ static inline sal_Int64 TwipsToEMU( sal_Int32 nTwips ) } template -OString writePercentage(T number) +OString write1000thOfAPercent(T number) { - return OString::number(number) + "%"; + return OString::number( number * 1000 ); } #endif -- cgit v1.2.3