[Libreoffice-commits] core.git: writerfilter/source
Michael Stahl
mstahl at redhat.com
Thu Jul 3 15:44:37 PDT 2014
writerfilter/source/resourcemodel/Fraction.cxx | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
New commits:
commit dcbac37efebb9877a72f7c9914b63d60f46a5656
Author: Michael Stahl <mstahl at redhat.com>
Date: Fri Jul 4 00:29:55 2014 +0200
fdo#76803: writerfilter: fix image wrap polygon import again
The division in Fraction::init() should be a signed one, to prevent a
change in sign, e.g., -220869/9 = +477194047.
(regression from f8307e5ae11e8235fa1fb88ed52625bf9c650dc2)
Change-Id: Icbbd1721144ff42c53ae71312641bd601ba60762
diff --git a/writerfilter/source/resourcemodel/Fraction.cxx b/writerfilter/source/resourcemodel/Fraction.cxx
index 1f24bb3..ba76985 100644
--- a/writerfilter/source/resourcemodel/Fraction.cxx
+++ b/writerfilter/source/resourcemodel/Fraction.cxx
@@ -79,9 +79,11 @@ Fraction::~Fraction()
void Fraction::init(sal_Int32 nNumerator, sal_Int32 nDenominator)
{
- sal_uInt32 nGCD = gcd(abs(nNumerator), abs(nDenominator));
+ // fdo#41068 pass non-negative numbers to gcd
+ sal_Int32 const nGCD = gcd(abs(nNumerator), abs(nDenominator));
- mnNumerator = nNumerator/ nGCD;
+ // fdo#76803 do signed division
+ mnNumerator = nNumerator / nGCD;
mnDenominator = nDenominator / nGCD;
}
More information about the Libreoffice-commits
mailing list