From d7e5fa3bd8f4240665f13994589f5e72d362c097 Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Fri, 5 Feb 2021 09:36:59 +0300 Subject: Make sanitiseMm100ToTwip simpler and more correct The result's absolute value is always smaller than n. Returning an uncorrected value taken from reversing multiplication and division order when intermediate value would overflow is better than arbitrary constant. Also further deduplicate Twips <-> 100th-mm conversion, and make sure they all are in a single header. Using conversion implementation that handles negatives correctly improves accuracy, as seen in unit tests; e.g. in testPictureEffectPreservation (the original doc had "dir" equal to "8100000", while we tested that it was "8076614" after roundtrip). Change-Id: Icd027af6238a9f45f916f53f8684506cc959e696 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110433 Tested-by: Jenkins Reviewed-by: Mike Kaganski --- sw/source/filter/xml/xmlimp.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sw/source/filter/xml') diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx index cd5f2b18f115..e3ecbeac0d7e 100644 --- a/sw/source/filter/xml/xmlimp.cxx +++ b/sw/source/filter/xml/xmlimp.cxx @@ -64,7 +64,7 @@ #include #include #include -#include +#include #include #include -- cgit