ofz: floating point exception in values close to zero
Change-Id: Idd8c7d4dd42c63f4f4a67ba61b9f3760ec04f2f1
This commit is contained in:
@@ -171,7 +171,21 @@ bool ImplReadMapMode(SvStream& rIStm, MapMode& rMapMode)
|
||||
return false;
|
||||
}
|
||||
|
||||
rMapMode = MapMode( (MapUnit) nUnit, aOrg, Fraction( nXNum, nXDenom ), Fraction( nYNum, nYDenom ) );
|
||||
Fraction aX(nXNum, nXDenom);
|
||||
if (!aX.IsValid() || rtl::math::round(aX, 6) == 0.0)
|
||||
{
|
||||
SAL_WARN("vcl.gdi", "Parsing error: invalid mapmode fraction");
|
||||
return false;
|
||||
}
|
||||
|
||||
Fraction aY(nYNum, nYDenom);
|
||||
if (!aY.IsValid() || rtl::math::round(aY, 6) == 0.0)
|
||||
{
|
||||
SAL_WARN("vcl.gdi", "Parsing error: invalid mapmode fraction");
|
||||
return false;
|
||||
}
|
||||
|
||||
rMapMode = MapMode((MapUnit) nUnit, aOrg, aX, aY);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user