diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-02-28 20:45:49 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-02-28 20:47:57 +0000 |
commit | b018021d5a5e644f1d8aafd20432562621b33554 (patch) | |
tree | 7b203953f1520d328eb82d1bff874ee1786cf761 /filter | |
parent | 0b849247e11729707d46c214f53da7d4eb22c7e0 (diff) |
ofz: timeout on clamping big double to 0..360
Change-Id: Ica2aedc5275e5f523302f5793e3f3816b3ff65b4
Diffstat (limited to 'filter')
-rw-r--r-- | filter/qa/cppunit/data/dxf/pass/bigangle-1.dxf | 143 | ||||
-rw-r--r-- | filter/source/graphicfilter/idxf/dxf2mtf.cxx | 12 |
2 files changed, 148 insertions, 7 deletions
diff --git a/filter/qa/cppunit/data/dxf/pass/bigangle-1.dxf b/filter/qa/cppunit/data/dxf/pass/bigangle-1.dxf new file mode 100644 index 000000000000..3c4741447592 --- /dev/null +++ b/filter/qa/cppunit/data/dxf/pass/bigangle-1.dxf @@ -0,0 +1,143 @@ +99 +170141183460469231731687303715884105718 + 2
+BL0C
+ 0
+SECTION
+ 2
+ENTITIES
+ 0111
N9.0 +0 +ARC +111
N9
+ 1
+I +
39 +9 +130
+
+ 51
+1758770265ded1a13ecce6855794837535bf766a7fRC +111
N9.0007 +
39 +9 +130
+10 + 2
+BL0C
+ 0
+SECTION
+ 2
+ENTITIES
+ 0111
N9.0 +0 +ARC +111
N9
+ 1
+I +
39 +9 +130
+
+ 51
+9705 +0 +ARC +111
39 +9 +130
+
+ 51
+183460469231731687303715884105718 + 2
+BL0C
+ 0
+SECTION
+ 2
+ENTITIES
+ 0111
N9.0 +0 +ARC +111
N9
+ 1
+I +
39 +9 +130
+
+ 51
+1758770265ded1a13ecce6855794837535bf766a7fRC +111
N9.0007 +
39 +9 +130
+10 + 2
+BL0C
+ 0
+SECTION
+ 2
+ENTITIES
+ 0111
N9.0 +0 +ARC +111
N9
+ 1
+I +
39 +9 +130
+
+ 51
+9705 +0 +ARC +111
39 +9 +130
+
+ 51
+197 +0 +ARC +111
N9.00dL07 +
39 +9 +130
+
+ 56
+15
+ 8
+ +0 +EOF +111
N9.0
+ 56*
+15
+ 8
+ +0 +EO? +111
197 +0 +ARC +111
N9.00dL07 +
39 +9 +130
+
+ 56
+15
+ 8
+ +0 +EOF +111
N9.0
+ 56*
+15
+ 8
+ +0 +EO? +111
N9.000 +3
N 2S 79 799 diff --git a/filter/source/graphicfilter/idxf/dxf2mtf.cxx b/filter/source/graphicfilter/idxf/dxf2mtf.cxx index 9255fb9f5ec2..64ce94ce6068 100644 --- a/filter/source/graphicfilter/idxf/dxf2mtf.cxx +++ b/filter/source/graphicfilter/idxf/dxf2mtf.cxx @@ -296,19 +296,18 @@ void DXF2GDIMetaFile::DrawCircleEntity(const DXFCircleEntity & rE, const DXFTran } } - void DXF2GDIMetaFile::DrawArcEntity(const DXFArcEntity & rE, const DXFTransform & rTransform) { - double frx,fry,fA1,fdA; + double frx,fry; sal_uInt16 nPoints,i; DXFVector aC; Point aPS,aPE; if (!SetLineAttribute(rE)) return; - fA1=rE.fStart; - fdA=rE.fEnd-fA1; - while (fdA>=360.0) fdA-=360.0; - while (fdA<=0) fdA+=360.0; + double fA1=rE.fStart; + double fdA=rE.fEnd-fA1; + fdA = fmod(fdA, 360.0); + if (fdA<=0) fdA+=360.0; rTransform.Transform(rE.aP0,aC); if (rE.fThickness==0 && fdA>5.0 && rTransform.TransCircleToEllipse(rE.fRadius,frx,fry)) { DXFVector aVS(cos(fA1/180.0*3.14159265359),sin(fA1/180.0*3.14159265359),0.0); @@ -359,7 +358,6 @@ void DXF2GDIMetaFile::DrawArcEntity(const DXFArcEntity & rE, const DXFTransform } } - void DXF2GDIMetaFile::DrawTraceEntity(const DXFTraceEntity & rE, const DXFTransform & rTransform) { if (SetLineAttribute(rE)) { |