[Libreoffice-commits] core.git: filter/qa filter/source

Caolán McNamara caolanm at redhat.com
Tue Feb 28 20:48:31 UTC 2017


 filter/qa/cppunit/data/dxf/pass/bigangle-1.dxf |  143 +++++++++++++++++++++++++
 filter/source/graphicfilter/idxf/dxf2mtf.cxx   |   12 --
 2 files changed, 148 insertions(+), 7 deletions(-)

New commits:
commit b018021d5a5e644f1d8aafd20432562621b33554
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Feb 28 20:45:49 2017 +0000

    ofz: timeout on clamping big double to 0..360
    
    Change-Id: Ica2aedc5275e5f523302f5793e3f3816b3ff65b4

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 0000000..3c47414
--- /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.00÷dL07
+
39
+9 
+130
+
+  56
+15
+  8
+
+0
+EOF
+111
N9.0
+  56*
+15
+  8
+
+0
+EO?
+111
197
+0
+ARC
+111
N9.00÷dL07
+
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 9255fb9..64ce94c 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)) {


More information about the Libreoffice-commits mailing list