ooo-build r12473 - in trunk: . patches/dev300



Author: thorstenb
Date: Tue May  6 10:03:38 2008
New Revision: 12473
URL: http://svn.gnome.org/viewvc/ooo-build?rev=12473&view=rev

Log:
	* patches/dev300/svg-import-basegfx.diff: adapted to dev300-m11



Modified:
   trunk/ChangeLog
   trunk/patches/dev300/svg-import-basegfx.diff

Modified: trunk/patches/dev300/svg-import-basegfx.diff
==============================================================================
--- trunk/patches/dev300/svg-import-basegfx.diff	(original)
+++ trunk/patches/dev300/svg-import-basegfx.diff	Tue May  6 10:03:38 2008
@@ -1,6 +1,6 @@
---- basegfx/inc/basegfx/polygon/b2dpolypolygontools.hxx
-+++ basegfx/inc/basegfx/polygon/b2dpolypolygontools.hxx
-@@ -127,19 +127,37 @@ namespace basegfx
+--- basegfx/inc/basegfx/polygon/b2dpolypolygontools.hxx	24 Apr 2008 15:04:45 -0000	1.18
++++ basegfx/inc/basegfx/polygon/b2dpolypolygontools.hxx	6 May 2008 09:59:47 -0000
+@@ -111,19 +111,37 @@ namespace basegfx
          /** Read poly-polygon from SVG.
  
          	This function imports a poly-polygon from an SVG-D
@@ -43,11 +43,11 @@
  
  		// create 3d PolyPolygon from given 2d PolyPolygon. The given fZCoordinate is used to expand the
  		// third coordinate.
---- basegfx/source/polygon/b2dsvgpolypolygon.cxx	18 Jul 2007 11:07:24 -0000	1.7
-+++ basegfx/source/polygon/b2dsvgpolypolygon.cxx	28 Feb 2008 11:11:31 -0000
-@@ -37,7 +37,9 @@
- #include "precompiled_basegfx.hxx"
+--- basegfx/source/polygon/b2dsvgpolypolygon.cxx	24 Apr 2008 15:07:05 -0000	1.9
++++ basegfx/source/polygon/b2dsvgpolypolygon.cxx	6 May 2008 09:59:47 -0000
+@@ -33,7 +33,9 @@
  
+ #include <basegfx/polygon/b2dpolygontools.hxx>
  #include <basegfx/polygon/b2dpolypolygontools.hxx>
 +#include <basegfx/polygon/b2dpolygontools.hxx>
  #include <basegfx/polygon/b2dpolypolygon.hxx>
@@ -55,7 +55,7 @@
  #include <rtl/ustring.hxx>
  #include <rtl/math.hxx>
  
-@@ -74,7 +76,7 @@
+@@ -65,7 +67,7 @@ namespace basegfx
                  }
              }
  
@@ -64,7 +64,7 @@
              {
                  const sal_Unicode aChar(rStr[nPos]);
  
-@@ -151,6 +153,37 @@
+@@ -142,6 +144,37 @@ namespace basegfx
                  return true;
              }
  
@@ -102,7 +102,7 @@
              void lcl_skipNumber(sal_Int32& 				io_rPos, 
                                  const ::rtl::OUString& 	rStr, 
                                  const sal_Int32 		nLen)
-@@ -623,24 +656,169 @@
+@@ -621,24 +654,169 @@ namespace basegfx
                          break;
                      }
  
@@ -283,7 +283,7 @@
                          }
                          break;
                      }
-@@ -665,6 +843,32 @@
+@@ -667,7 +845,33 @@ namespace basegfx
              return true;
          }
  
@@ -316,110 +316,3 @@
          ::rtl::OUString exportToSvgD(
  			const B2DPolyPolygon& rPolyPolygon,
  			bool bUseRelativeCoordinates, 
-@@ -678,13 +882,23 @@
-             {
-                 const B2DPolygon aPolygon(rPolyPolygon.getB2DPolygon(i));
-                 const sal_uInt32 nPointCount(aPolygon.count());
-+
-+                // simply skip empty polygons - avoids special-casing
-+                // this below for the n+1 fix for closed polygons
-+                if( !aPolygon.count() )
-+                    continue;
-+
-                 const bool bPolyUsesControlPoints(aPolygon.areControlPointsUsed());
-+                // to correctly write out closed curves, need to
-+                // output first point twice (so output one additional
-+                // point)
-+                const sal_uInt32 nExtendedPointCount(nPointCount + aPolygon.isClosed()*bPolyUsesControlPoints);
-                 sal_Unicode aLastSVGCommand(' '); // last SVG command char
- 				B2DPoint aLeft, aRight; // for quadratic bezier test
- 
--                for(sal_uInt32 j(0); j < nPointCount; j++)
-+                for(sal_uInt32 j(0); j<nExtendedPointCount; j++)
-                 {
--                    const B2DPoint aCurrent(aPolygon.getB2DPoint(j));
-+                    const B2DPoint aCurrent(aPolygon.getB2DPoint(j%nPointCount));
- 
-                     if(0 == j)
-                     {
-@@ -697,16 +911,18 @@
-                     else
-                     {
- 						// handle edge from j-1 to j
--						const bool bEdgeIsBezier(bPolyUsesControlPoints
--							&& (aPolygon.isNextControlPointUsed(j - 1) || aPolygon.isPrevControlPointUsed(j)));
--
-+						const bool bEdgeIsBezier(
-+                            bPolyUsesControlPoints
-+                            && (aPolygon.isNextControlPointUsed((j - 1)%nPointCount) 
-+                                || aPolygon.isPrevControlPointUsed(j%nPointCount)));
-+                        
-                         if(bEdgeIsBezier)
-                         {
-                             // handle bezier edge
--                            const B2DPoint aControl0(aPolygon.getNextControlPoint(j - 1));
--                            const B2DPoint aControl1(aPolygon.getPrevControlPoint(j));
--							const B2VectorContinuity aPrevCont(aPolygon.getContinuityInPoint(j - 1));
--							const bool bSymmetricControlVector(CONTINUITY_C2 == aPrevCont);
-+                            const B2DPoint aControl0(aPolygon.getNextControlPoint((j - 1)%nPointCount));
-+                            const B2DPoint aControl1(aPolygon.getPrevControlPoint(j%nPointCount));
-+							const B2VectorContinuity aPrevCont(aPolygon.getContinuityInPoint((j - 1)%nPointCount));
-+							const bool bSymmetricControlVector(j>1 && CONTINUITY_C2 == aPrevCont);
- 							bool bIsQuadraticBezier(false);
- 
- 							if(bDetectQuadraticBeziers)
-@@ -798,7 +1014,13 @@
-                         }
-                         else
-                         {
--                            // normal straight line points
-+                            // normal straight line points - no need
-+                            // to write extra segments for closed
-+                            // polygons here (see n+1 fix above for
-+                            // reasoning)
-+                            if( j==nPointCount )
-+                                continue;
-+
-                             if(aLastPoint.getX() == aCurrent.getX())
-                             {
- 								// export as vertical line
---- basegfx/test/basegfx2d.cxx	18 Jul 2007 11:08:37 -0000	1.9
-+++ basegfx/test/basegfx2d.cxx	28 Feb 2008 09:04:44 -0000
-@@ -470,6 +470,37 @@
-         aExport = tools::exportToSvgD( aPoly );
-         CPPUNIT_ASSERT_MESSAGE("exporting complex polygon to SVG-D (round-trip)", 
-                                !aExport.compareToAscii(sExportString2));
-+
-+        const B2DPolygon aCircle( 
-+            tools::createPolygonFromEllipse( B2DPoint(0,0),
-+                                             1.0, 2.0 ));
-+        aExport = tools::exportToSvgD( B2DPolyPolygon(aCircle), false, false);
-+
-+        const char* sExportString3 =
-+            "M1 0S0.552284749830794 2 0 2-1 1.10456949966159-1 0-0.552284749830794-2 0-2 1-1.10456949966159 1 0Z";
-+        CPPUNIT_ASSERT_MESSAGE("exporting bezier circle polygon to SVG-D", 
-+                               !aExport.compareToAscii(sExportString3));
-+
-+        ::std::ofstream output("elliptical_arc.gnuplot");
-+        DebugPlotter aPlotter( "elliptical arg testcases",
-+                               output );
-+
-+        tools::importFromSvgD( aPoly,
-+                               ::rtl::OUString::createFromAscii( 
-+                                   "M300,200 h-150 a150,150 0 1,0 150,-150 z") );
-+        aPlotter.plot( aPoly, "a" );
-+        tools::importFromSvgD( aPoly,
-+                               ::rtl::OUString::createFromAscii( 
-+                                   "M275,175 v-150 a150,150 0 0,0 -150,150 z") );
-+        aPlotter.plot( aPoly, "b" );
-+        tools::importFromSvgD( aPoly,
-+                               ::rtl::OUString::createFromAscii( 
-+            "M600,350 l 50,-25 "
-+            "a25,25 -30 0,1 50,-25 l 50,-25 "
-+            "a25,50 -30 0,1 50,-25 l 50,-25 "
-+            "a25,75 -30 0,1 50,-25 l 50,-25 "
-+            "a25,100 -30 0,1 50,-25 l 50,-25") );
-+        aPlotter.plot( aPoly, "c" );
-     }
- 
-     // Change the following lines only, if you add, remove or rename 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]