You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by al...@apache.org on 2013/10/30 17:13:42 UTC
svn commit: r1537155 [1/2] - in /openoffice/branches/alg/aw080/main:
basegfx/inc/basegfx/polygon/ basegfx/source/polygon/ xmloff/inc/
xmloff/source/draw/ xmloff/source/style/ xmloff/source/text/
Author: alg
Date: Wed Oct 30 16:13:41 2013
New Revision: 1537155
URL: http://svn.apache.org/r1537155
Log:
save adaptions to aw080 due to fixes done on trunk
Modified:
openoffice/branches/alg/aw080/main/basegfx/inc/basegfx/polygon/b2dpolygontools.hxx
openoffice/branches/alg/aw080/main/basegfx/inc/basegfx/polygon/b2dpolypolygontools.hxx
openoffice/branches/alg/aw080/main/basegfx/source/polygon/b2dpolygontools.cxx
openoffice/branches/alg/aw080/main/basegfx/source/polygon/b2dpolypolygontools.cxx
openoffice/branches/alg/aw080/main/basegfx/source/polygon/b2dsvgpolypolygon.cxx
openoffice/branches/alg/aw080/main/basegfx/source/polygon/b3dpolypolygontools.cxx
openoffice/branches/alg/aw080/main/xmloff/inc/xexptran.hxx
openoffice/branches/alg/aw080/main/xmloff/source/draw/XMLImageMapContext.cxx
openoffice/branches/alg/aw080/main/xmloff/source/draw/XMLImageMapExport.cxx
openoffice/branches/alg/aw080/main/xmloff/source/draw/shapeexport2.cxx
openoffice/branches/alg/aw080/main/xmloff/source/draw/shapeexport3.cxx
openoffice/branches/alg/aw080/main/xmloff/source/draw/xexptran.cxx
openoffice/branches/alg/aw080/main/xmloff/source/draw/ximp3dobject.cxx
openoffice/branches/alg/aw080/main/xmloff/source/draw/ximpshap.cxx
openoffice/branches/alg/aw080/main/xmloff/source/style/MarkerStyle.cxx
openoffice/branches/alg/aw080/main/xmloff/source/text/txtparae.cxx
Modified: openoffice/branches/alg/aw080/main/basegfx/inc/basegfx/polygon/b2dpolygontools.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg/aw080/main/basegfx/inc/basegfx/polygon/b2dpolygontools.hxx?rev=1537155&r1=1537154&r2=1537155&view=diff
==============================================================================
--- openoffice/branches/alg/aw080/main/basegfx/inc/basegfx/polygon/b2dpolygontools.hxx (original)
+++ openoffice/branches/alg/aw080/main/basegfx/inc/basegfx/polygon/b2dpolygontools.hxx Wed Oct 30 16:13:41 2013
@@ -537,9 +537,9 @@ namespace basegfx
const B2DPolygon& rPolygon,
com::sun::star::drawing::PointSequence& rPointSequenceRetval);
- /* converters for com::sun::star::drawing::PointSequence and
- com::sun::star::drawing::FlagSequence to B2DPolygon (curved polygons)
- */
+ /* converters for com::sun::star::drawing::PointSequence and
+ com::sun::star::drawing::FlagSequence to B2DPolygon (curved polygons)
+ */
B2DPolygon UnoPolygonBezierCoordsToB2DPolygon(
const com::sun::star::drawing::PointSequence& rPointSequenceSource,
const com::sun::star::drawing::FlagSequence& rFlagSequenceSource,
@@ -551,8 +551,8 @@ namespace basegfx
/** Read poly-polygon from SVG.
- This function imports a poly-polygon from an SVG points
- attribute (a plain list of coordinate pairs).
+ This function imports a poly-polygon from an SVG points
+ attribute (a plain list of coordinate pairs).
@param o_rPoly
The output polygon. Note that svg:points can only define a
@@ -568,8 +568,8 @@ namespace basegfx
/** Write poly-polygon to SVG.
- This function imports a non-bezier polygon to SVG points
- (a plain list of coordinate pairs).
+ This function imports a non-bezier polygon to SVG points
+ (a plain list of coordinate pairs).
@param rPoly
The polygon to export
Modified: openoffice/branches/alg/aw080/main/basegfx/inc/basegfx/polygon/b2dpolypolygontools.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg/aw080/main/basegfx/inc/basegfx/polygon/b2dpolypolygontools.hxx?rev=1537155&r1=1537154&r2=1537155&view=diff
==============================================================================
--- openoffice/branches/alg/aw080/main/basegfx/inc/basegfx/polygon/b2dpolypolygontools.hxx (original)
+++ openoffice/branches/alg/aw080/main/basegfx/inc/basegfx/polygon/b2dpolypolygontools.hxx Wed Oct 30 16:13:41 2013
@@ -19,8 +19,6 @@
*
*************************************************************/
-
-
#ifndef _BGFX_POLYPOLYGON_B2DPOLYGONTOOLS_HXX
#define _BGFX_POLYPOLYGON_B2DPOLYGONTOOLS_HXX
Modified: openoffice/branches/alg/aw080/main/basegfx/source/polygon/b2dpolygontools.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg/aw080/main/basegfx/source/polygon/b2dpolygontools.cxx?rev=1537155&r1=1537154&r2=1537155&view=diff
==============================================================================
--- openoffice/branches/alg/aw080/main/basegfx/source/polygon/b2dpolygontools.cxx (original)
+++ openoffice/branches/alg/aw080/main/basegfx/source/polygon/b2dpolygontools.cxx Wed Oct 30 16:13:41 2013
@@ -3626,350 +3626,350 @@ namespace basegfx
}
}
- //////////////////////////////////////////////////////////////////////////////
- // converters for com::sun::star::drawing::PointSequence
+ //////////////////////////////////////////////////////////////////////////////
+ // converters for com::sun::star::drawing::PointSequence
- B2DPolygon UnoPointSequenceToB2DPolygon(
- const com::sun::star::drawing::PointSequence& rPointSequenceSource,
- bool bCheckClosed)
- {
- B2DPolygon aRetval;
- const sal_uInt32 nLength(rPointSequenceSource.getLength());
-
- if(nLength)
- {
- aRetval.reserve(nLength);
- const com::sun::star::awt::Point* pArray = rPointSequenceSource.getConstArray();
- const com::sun::star::awt::Point* pArrayEnd = pArray + rPointSequenceSource.getLength();
-
- for(;pArray != pArrayEnd; pArray++)
- {
- aRetval.append(B2DPoint(pArray->X, pArray->Y));
- }
-
- if(bCheckClosed)
- {
- // check for closed state flag
- tools::checkClosed(aRetval);
- }
- }
-
- return aRetval;
- }
-
- void B2DPolygonToUnoPointSequence(
- const B2DPolygon& rPolygon,
- com::sun::star::drawing::PointSequence& rPointSequenceRetval)
- {
- B2DPolygon aPolygon(rPolygon);
-
- if(aPolygon.areControlPointsUsed())
- {
- OSL_ENSURE(false, "B2DPolygonToUnoPointSequence: Source contains bezier segments, wrong UNO API data type may be used (!)");
- aPolygon = aPolygon.getDefaultAdaptiveSubdivision();
- }
-
- const sal_uInt32 nPointCount(aPolygon.count());
-
- if(nPointCount)
- {
- // Take closed state into account, the API polygon still uses the old closed definition
- // with last/first point are identical (cannot hold information about open polygons with identical
- // first and last point, though)
- const bool bIsClosed(aPolygon.isClosed());
-
- rPointSequenceRetval.realloc(bIsClosed ? nPointCount + 1 : nPointCount);
- com::sun::star::awt::Point* pSequence = rPointSequenceRetval.getArray();
-
- for(sal_uInt32 b(0); b < nPointCount; b++)
- {
- const B2DPoint aPoint(aPolygon.getB2DPoint(b));
- const com::sun::star::awt::Point aAPIPoint(fround(aPoint.getX()), fround(aPoint.getY()));
-
- *pSequence = aAPIPoint;
- pSequence++;
- }
-
- // copy first point if closed
- if(bIsClosed)
- {
- *pSequence = *rPointSequenceRetval.getArray();
- }
- }
- else
- {
- rPointSequenceRetval.realloc(0);
- }
- }
-
- //////////////////////////////////////////////////////////////////////////////
- // converters for com::sun::star::drawing::PointSequence and
- // com::sun::star::drawing::FlagSequence to B2DPolygon (curved polygons)
-
- B2DPolygon UnoPolygonBezierCoordsToB2DPolygon(
- const com::sun::star::drawing::PointSequence& rPointSequenceSource,
- const com::sun::star::drawing::FlagSequence& rFlagSequenceSource,
- bool bCheckClosed)
- {
- const sal_uInt32 nCount((sal_uInt32)rPointSequenceSource.getLength());
- OSL_ENSURE(nCount == (sal_uInt32)rFlagSequenceSource.getLength(),
- "UnoPolygonBezierCoordsToB2DPolygon: Unequal count of Points and Flags (!)");
-
- // prepare new polygon
- B2DPolygon aRetval;
- const com::sun::star::awt::Point* pPointSequence = rPointSequenceSource.getConstArray();
- const com::sun::star::drawing::PolygonFlags* pFlagSequence = rFlagSequenceSource.getConstArray();
-
- // get first point and flag
- B2DPoint aNewCoordinatePair(pPointSequence->X, pPointSequence->Y); pPointSequence++;
- com::sun::star::drawing::PolygonFlags ePolygonFlag(*pFlagSequence); pFlagSequence++;
- B2DPoint aControlA;
- B2DPoint aControlB;
-
- // first point is not allowed to be a control point
- OSL_ENSURE(com::sun::star::drawing::PolygonFlags_CONTROL != ePolygonFlag,
- "UnoPolygonBezierCoordsToB2DPolygon: Start point is a control point, illegal input polygon (!)");
-
- // add first point as start point
- aRetval.append(aNewCoordinatePair);
-
- for(sal_uInt32 b(1); b < nCount;)
- {
- // prepare loop
- bool bControlA(false);
- bool bControlB(false);
-
- // get next point and flag
- aNewCoordinatePair = B2DPoint(pPointSequence->X, pPointSequence->Y);
- ePolygonFlag = *pFlagSequence;
- pPointSequence++; pFlagSequence++; b++;
-
- if(b < nCount && com::sun::star::drawing::PolygonFlags_CONTROL == ePolygonFlag)
- {
- aControlA = aNewCoordinatePair;
- bControlA = true;
-
- // get next point and flag
- aNewCoordinatePair = B2DPoint(pPointSequence->X, pPointSequence->Y);
- ePolygonFlag = *pFlagSequence;
- pPointSequence++; pFlagSequence++; b++;
- }
-
- if(b < nCount && com::sun::star::drawing::PolygonFlags_CONTROL == ePolygonFlag)
- {
- aControlB = aNewCoordinatePair;
- bControlB = true;
-
- // get next point and flag
- aNewCoordinatePair = B2DPoint(pPointSequence->X, pPointSequence->Y);
- ePolygonFlag = *pFlagSequence;
- pPointSequence++; pFlagSequence++; b++;
- }
-
- // two or no control points are consumed, another one would be an error.
- // It's also an error if only one control point was read
- OSL_ENSURE(com::sun::star::drawing::PolygonFlags_CONTROL != ePolygonFlag && bControlA == bControlB,
- "UnoPolygonBezierCoordsToB2DPolygon: Illegal source polygon (!)");
-
- // the previous writes used the B2DPolyPoygon -> PolyPolygon converter
- // which did not create minimal PolyPolygons, but created all control points
- // as null vectors (identical points). Because of the former P(CA)(CB)-norm of
- // B2DPolygon and it's unused sign of being the zero-vector and CA and CB being
- // relative to P, an empty edge was exported as P == CA == CB. Luckily, the new
- // export format can be read without errors by the old OOo-versions, so we need only
- // to correct here at read and do not need to export a wrong but compatible version
- // for the future.
- if(bControlA
- && aControlA.equal(aControlB)
- && aControlA.equal(aRetval.getB2DPoint(aRetval.count() - 1)))
- {
- bControlA = bControlB = false;
- }
-
- if(bControlA)
- {
- // add bezier edge
- aRetval.appendBezierSegment(aControlA, aControlB, aNewCoordinatePair);
- }
- else
- {
- // add edge
- aRetval.append(aNewCoordinatePair);
- }
- }
-
- // #i72807# API import uses old line start/end-equal definition for closed,
- // so we need to correct this to closed state here
- if(bCheckClosed)
- {
- checkClosed(aRetval);
- }
-
- return aRetval;
- }
-
- void B2DPolygonToUnoPolygonBezierCoords(
- const B2DPolygon& rPolygon,
- com::sun::star::drawing::PointSequence& rPointSequenceRetval,
- com::sun::star::drawing::FlagSequence& rFlagSequenceRetval)
- {
- const sal_uInt32 nPointCount(rPolygon.count());
-
- if(nPointCount)
- {
- const bool bCurve(rPolygon.areControlPointsUsed());
- const bool bClosed(rPolygon.isClosed());
-
- if(nPointCount)
- {
- if(bCurve)
- {
- // calculate target point count
- const sal_uInt32 nLoopCount(bClosed ? nPointCount : (nPointCount ? nPointCount - 1 : 0));
-
- if(nLoopCount)
- {
- // prepare target data. The real needed number of target points (and flags)
- // could only be calculated by using two loops, so use dynamic memory
- std::vector< com::sun::star::awt::Point > aCollectPoints;
- std::vector< com::sun::star::drawing::PolygonFlags > aCollectFlags;
-
- // reserve maximum creatable points
- const sal_uInt32 nMaxTargetCount((nLoopCount * 3) + 1);
- aCollectPoints.reserve(nMaxTargetCount);
- aCollectFlags.reserve(nMaxTargetCount);
-
- // prepare current bezier segment by setting start point
- B2DCubicBezier aBezierSegment;
- aBezierSegment.setStartPoint(rPolygon.getB2DPoint(0));
-
- for(sal_uInt32 a(0); a < nLoopCount; a++)
- {
- // add current point (always) and remember StartPointIndex for evtl. later corrections
- const sal_uInt32 nStartPointIndex(aCollectPoints.size());
- aCollectPoints.push_back(
- com::sun::star::awt::Point(
- fround(aBezierSegment.getStartPoint().getX()),
- fround(aBezierSegment.getStartPoint().getY())));
- aCollectFlags.push_back(com::sun::star::drawing::PolygonFlags_NORMAL);
-
- // prepare next segment
- const sal_uInt32 nNextIndex((a + 1) % nPointCount);
- aBezierSegment.setEndPoint(rPolygon.getB2DPoint(nNextIndex));
- aBezierSegment.setControlPointA(rPolygon.getNextControlPoint(a));
- aBezierSegment.setControlPointB(rPolygon.getPrevControlPoint(nNextIndex));
-
- if(aBezierSegment.isBezier())
- {
- // if bezier is used, add always two control points due to the old schema
- aCollectPoints.push_back(
- com::sun::star::awt::Point(
- fround(aBezierSegment.getControlPointA().getX()),
- fround(aBezierSegment.getControlPointA().getY())));
- aCollectFlags.push_back(com::sun::star::drawing::PolygonFlags_CONTROL);
-
- aCollectPoints.push_back(
- com::sun::star::awt::Point(
- fround(aBezierSegment.getControlPointB().getX()),
- fround(aBezierSegment.getControlPointB().getY())));
- aCollectFlags.push_back(com::sun::star::drawing::PolygonFlags_CONTROL);
- }
-
- // test continuity with previous control point to set flag value
- if(aBezierSegment.getControlPointA() != aBezierSegment.getStartPoint() && (bClosed || a))
- {
- const B2VectorContinuity eCont(rPolygon.getContinuityInPoint(a));
-
- if(CONTINUITY_C1 == eCont)
- {
- aCollectFlags[nStartPointIndex] = com::sun::star::drawing::PolygonFlags_SMOOTH;
- }
- else if(CONTINUITY_C2 == eCont)
- {
- aCollectFlags[nStartPointIndex] = com::sun::star::drawing::PolygonFlags_SYMMETRIC;
- }
- }
-
- // prepare next loop
- aBezierSegment.setStartPoint(aBezierSegment.getEndPoint());
- }
-
- if(bClosed)
- {
- // add first point again as closing point due to old definition
- aCollectPoints.push_back(aCollectPoints[0]);
- aCollectFlags.push_back(com::sun::star::drawing::PolygonFlags_NORMAL);
- }
- else
- {
- // add last point as closing point
- const B2DPoint aClosingPoint(rPolygon.getB2DPoint(nPointCount - 1L));
- aCollectPoints.push_back(
- com::sun::star::awt::Point(
- fround(aClosingPoint.getX()),
- fround(aClosingPoint.getY())));
- aCollectFlags.push_back(com::sun::star::drawing::PolygonFlags_NORMAL);
- }
-
- // copy collected data to target arrays
- const sal_uInt32 nTargetCount(aCollectPoints.size());
- OSL_ENSURE(nTargetCount == aCollectFlags.size(), "Unequal Point and Flag count (!)");
-
- rPointSequenceRetval.realloc((sal_Int32)nTargetCount);
- rFlagSequenceRetval.realloc((sal_Int32)nTargetCount);
- com::sun::star::awt::Point* pPointSequence = rPointSequenceRetval.getArray();
- com::sun::star::drawing::PolygonFlags* pFlagSequence = rFlagSequenceRetval.getArray();
-
- for(sal_uInt32 a(0); a < nTargetCount; a++)
- {
- *pPointSequence = aCollectPoints[a];
- *pFlagSequence = aCollectFlags[a];
- pPointSequence++;
- pFlagSequence++;
- }
- }
- }
- else
- {
- // straightforward point list creation
- const sal_uInt32 nTargetCount(nPointCount + (bClosed ? 1 : 0));
-
- rPointSequenceRetval.realloc((sal_Int32)nTargetCount);
- rFlagSequenceRetval.realloc((sal_Int32)nTargetCount);
-
- com::sun::star::awt::Point* pPointSequence = rPointSequenceRetval.getArray();
- com::sun::star::drawing::PolygonFlags* pFlagSequence = rFlagSequenceRetval.getArray();
-
- for(sal_uInt32 a(0); a < nPointCount; a++)
- {
- const B2DPoint aB2DPoint(rPolygon.getB2DPoint(a));
- const com::sun::star::awt::Point aAPIPoint(
- fround(aB2DPoint.getX()),
- fround(aB2DPoint.getY()));
-
- *pPointSequence = aAPIPoint;
- *pFlagSequence = com::sun::star::drawing::PolygonFlags_NORMAL;
- pPointSequence++;
- pFlagSequence++;
- }
-
- if(bClosed)
- {
- // add first point as closing point
- *pPointSequence = *rPointSequenceRetval.getConstArray();
- *pFlagSequence = com::sun::star::drawing::PolygonFlags_NORMAL;
- }
- }
- }
- }
- else
- {
- rPointSequenceRetval.realloc(0);
- rFlagSequenceRetval.realloc(0);
- }
- }
+ B2DPolygon UnoPointSequenceToB2DPolygon(
+ const com::sun::star::drawing::PointSequence& rPointSequenceSource,
+ bool bCheckClosed)
+ {
+ B2DPolygon aRetval;
+ const sal_uInt32 nLength(rPointSequenceSource.getLength());
+
+ if(nLength)
+ {
+ aRetval.reserve(nLength);
+ const com::sun::star::awt::Point* pArray = rPointSequenceSource.getConstArray();
+ const com::sun::star::awt::Point* pArrayEnd = pArray + rPointSequenceSource.getLength();
+
+ for(;pArray != pArrayEnd; pArray++)
+ {
+ aRetval.append(B2DPoint(pArray->X, pArray->Y));
+ }
+
+ if(bCheckClosed)
+ {
+ // check for closed state flag
+ tools::checkClosed(aRetval);
+ }
+ }
+
+ return aRetval;
+ }
+
+ void B2DPolygonToUnoPointSequence(
+ const B2DPolygon& rPolygon,
+ com::sun::star::drawing::PointSequence& rPointSequenceRetval)
+ {
+ B2DPolygon aPolygon(rPolygon);
+
+ if(aPolygon.areControlPointsUsed())
+ {
+ OSL_ENSURE(false, "B2DPolygonToUnoPointSequence: Source contains bezier segments, wrong UNO API data type may be used (!)");
+ aPolygon = aPolygon.getDefaultAdaptiveSubdivision();
+ }
+
+ const sal_uInt32 nPointCount(aPolygon.count());
+
+ if(nPointCount)
+ {
+ // Take closed state into account, the API polygon still uses the old closed definition
+ // with last/first point are identical (cannot hold information about open polygons with identical
+ // first and last point, though)
+ const bool bIsClosed(aPolygon.isClosed());
+
+ rPointSequenceRetval.realloc(bIsClosed ? nPointCount + 1 : nPointCount);
+ com::sun::star::awt::Point* pSequence = rPointSequenceRetval.getArray();
+
+ for(sal_uInt32 b(0); b < nPointCount; b++)
+ {
+ const B2DPoint aPoint(aPolygon.getB2DPoint(b));
+ const com::sun::star::awt::Point aAPIPoint(fround(aPoint.getX()), fround(aPoint.getY()));
+
+ *pSequence = aAPIPoint;
+ pSequence++;
+ }
+
+ // copy first point if closed
+ if(bIsClosed)
+ {
+ *pSequence = *rPointSequenceRetval.getArray();
+ }
+ }
+ else
+ {
+ rPointSequenceRetval.realloc(0);
+ }
+ }
+
+ //////////////////////////////////////////////////////////////////////////////
+ // converters for com::sun::star::drawing::PointSequence and
+ // com::sun::star::drawing::FlagSequence to B2DPolygon (curved polygons)
+
+ B2DPolygon UnoPolygonBezierCoordsToB2DPolygon(
+ const com::sun::star::drawing::PointSequence& rPointSequenceSource,
+ const com::sun::star::drawing::FlagSequence& rFlagSequenceSource,
+ bool bCheckClosed)
+ {
+ const sal_uInt32 nCount((sal_uInt32)rPointSequenceSource.getLength());
+ OSL_ENSURE(nCount == (sal_uInt32)rFlagSequenceSource.getLength(),
+ "UnoPolygonBezierCoordsToB2DPolygon: Unequal count of Points and Flags (!)");
+
+ // prepare new polygon
+ B2DPolygon aRetval;
+ const com::sun::star::awt::Point* pPointSequence = rPointSequenceSource.getConstArray();
+ const com::sun::star::drawing::PolygonFlags* pFlagSequence = rFlagSequenceSource.getConstArray();
+
+ // get first point and flag
+ B2DPoint aNewCoordinatePair(pPointSequence->X, pPointSequence->Y); pPointSequence++;
+ com::sun::star::drawing::PolygonFlags ePolygonFlag(*pFlagSequence); pFlagSequence++;
+ B2DPoint aControlA;
+ B2DPoint aControlB;
+
+ // first point is not allowed to be a control point
+ OSL_ENSURE(com::sun::star::drawing::PolygonFlags_CONTROL != ePolygonFlag,
+ "UnoPolygonBezierCoordsToB2DPolygon: Start point is a control point, illegal input polygon (!)");
+
+ // add first point as start point
+ aRetval.append(aNewCoordinatePair);
+
+ for(sal_uInt32 b(1); b < nCount;)
+ {
+ // prepare loop
+ bool bControlA(false);
+ bool bControlB(false);
+
+ // get next point and flag
+ aNewCoordinatePair = B2DPoint(pPointSequence->X, pPointSequence->Y);
+ ePolygonFlag = *pFlagSequence;
+ pPointSequence++; pFlagSequence++; b++;
+
+ if(b < nCount && com::sun::star::drawing::PolygonFlags_CONTROL == ePolygonFlag)
+ {
+ aControlA = aNewCoordinatePair;
+ bControlA = true;
+
+ // get next point and flag
+ aNewCoordinatePair = B2DPoint(pPointSequence->X, pPointSequence->Y);
+ ePolygonFlag = *pFlagSequence;
+ pPointSequence++; pFlagSequence++; b++;
+ }
+
+ if(b < nCount && com::sun::star::drawing::PolygonFlags_CONTROL == ePolygonFlag)
+ {
+ aControlB = aNewCoordinatePair;
+ bControlB = true;
+
+ // get next point and flag
+ aNewCoordinatePair = B2DPoint(pPointSequence->X, pPointSequence->Y);
+ ePolygonFlag = *pFlagSequence;
+ pPointSequence++; pFlagSequence++; b++;
+ }
+
+ // two or no control points are consumed, another one would be an error.
+ // It's also an error if only one control point was read
+ OSL_ENSURE(com::sun::star::drawing::PolygonFlags_CONTROL != ePolygonFlag && bControlA == bControlB,
+ "UnoPolygonBezierCoordsToB2DPolygon: Illegal source polygon (!)");
+
+ // the previous writes used the B2DPolyPoygon -> PolyPolygon converter
+ // which did not create minimal PolyPolygons, but created all control points
+ // as null vectors (identical points). Because of the former P(CA)(CB)-norm of
+ // B2DPolygon and it's unused sign of being the zero-vector and CA and CB being
+ // relative to P, an empty edge was exported as P == CA == CB. Luckily, the new
+ // export format can be read without errors by the old OOo-versions, so we need only
+ // to correct here at read and do not need to export a wrong but compatible version
+ // for the future.
+ if(bControlA
+ && aControlA.equal(aControlB)
+ && aControlA.equal(aRetval.getB2DPoint(aRetval.count() - 1)))
+ {
+ bControlA = bControlB = false;
+ }
+
+ if(bControlA)
+ {
+ // add bezier edge
+ aRetval.appendBezierSegment(aControlA, aControlB, aNewCoordinatePair);
+ }
+ else
+ {
+ // add edge
+ aRetval.append(aNewCoordinatePair);
+ }
+ }
+
+ // #i72807# API import uses old line start/end-equal definition for closed,
+ // so we need to correct this to closed state here
+ if(bCheckClosed)
+ {
+ checkClosed(aRetval);
+ }
+
+ return aRetval;
+ }
+
+ void B2DPolygonToUnoPolygonBezierCoords(
+ const B2DPolygon& rPolygon,
+ com::sun::star::drawing::PointSequence& rPointSequenceRetval,
+ com::sun::star::drawing::FlagSequence& rFlagSequenceRetval)
+ {
+ const sal_uInt32 nPointCount(rPolygon.count());
+
+ if(nPointCount)
+ {
+ const bool bCurve(rPolygon.areControlPointsUsed());
+ const bool bClosed(rPolygon.isClosed());
+
+ if(nPointCount)
+ {
+ if(bCurve)
+ {
+ // calculate target point count
+ const sal_uInt32 nLoopCount(bClosed ? nPointCount : (nPointCount ? nPointCount - 1 : 0));
+
+ if(nLoopCount)
+ {
+ // prepare target data. The real needed number of target points (and flags)
+ // could only be calculated by using two loops, so use dynamic memory
+ std::vector< com::sun::star::awt::Point > aCollectPoints;
+ std::vector< com::sun::star::drawing::PolygonFlags > aCollectFlags;
+
+ // reserve maximum creatable points
+ const sal_uInt32 nMaxTargetCount((nLoopCount * 3) + 1);
+ aCollectPoints.reserve(nMaxTargetCount);
+ aCollectFlags.reserve(nMaxTargetCount);
+
+ // prepare current bezier segment by setting start point
+ B2DCubicBezier aBezierSegment;
+ aBezierSegment.setStartPoint(rPolygon.getB2DPoint(0));
+
+ for(sal_uInt32 a(0); a < nLoopCount; a++)
+ {
+ // add current point (always) and remember StartPointIndex for evtl. later corrections
+ const sal_uInt32 nStartPointIndex(aCollectPoints.size());
+ aCollectPoints.push_back(
+ com::sun::star::awt::Point(
+ fround(aBezierSegment.getStartPoint().getX()),
+ fround(aBezierSegment.getStartPoint().getY())));
+ aCollectFlags.push_back(com::sun::star::drawing::PolygonFlags_NORMAL);
+
+ // prepare next segment
+ const sal_uInt32 nNextIndex((a + 1) % nPointCount);
+ aBezierSegment.setEndPoint(rPolygon.getB2DPoint(nNextIndex));
+ aBezierSegment.setControlPointA(rPolygon.getNextControlPoint(a));
+ aBezierSegment.setControlPointB(rPolygon.getPrevControlPoint(nNextIndex));
+
+ if(aBezierSegment.isBezier())
+ {
+ // if bezier is used, add always two control points due to the old schema
+ aCollectPoints.push_back(
+ com::sun::star::awt::Point(
+ fround(aBezierSegment.getControlPointA().getX()),
+ fround(aBezierSegment.getControlPointA().getY())));
+ aCollectFlags.push_back(com::sun::star::drawing::PolygonFlags_CONTROL);
+
+ aCollectPoints.push_back(
+ com::sun::star::awt::Point(
+ fround(aBezierSegment.getControlPointB().getX()),
+ fround(aBezierSegment.getControlPointB().getY())));
+ aCollectFlags.push_back(com::sun::star::drawing::PolygonFlags_CONTROL);
+ }
+
+ // test continuity with previous control point to set flag value
+ if(aBezierSegment.getControlPointA() != aBezierSegment.getStartPoint() && (bClosed || a))
+ {
+ const B2VectorContinuity eCont(rPolygon.getContinuityInPoint(a));
+
+ if(CONTINUITY_C1 == eCont)
+ {
+ aCollectFlags[nStartPointIndex] = com::sun::star::drawing::PolygonFlags_SMOOTH;
+ }
+ else if(CONTINUITY_C2 == eCont)
+ {
+ aCollectFlags[nStartPointIndex] = com::sun::star::drawing::PolygonFlags_SYMMETRIC;
+ }
+ }
+
+ // prepare next loop
+ aBezierSegment.setStartPoint(aBezierSegment.getEndPoint());
+ }
+
+ if(bClosed)
+ {
+ // add first point again as closing point due to old definition
+ aCollectPoints.push_back(aCollectPoints[0]);
+ aCollectFlags.push_back(com::sun::star::drawing::PolygonFlags_NORMAL);
+ }
+ else
+ {
+ // add last point as closing point
+ const B2DPoint aClosingPoint(rPolygon.getB2DPoint(nPointCount - 1L));
+ aCollectPoints.push_back(
+ com::sun::star::awt::Point(
+ fround(aClosingPoint.getX()),
+ fround(aClosingPoint.getY())));
+ aCollectFlags.push_back(com::sun::star::drawing::PolygonFlags_NORMAL);
+ }
+
+ // copy collected data to target arrays
+ const sal_uInt32 nTargetCount(aCollectPoints.size());
+ OSL_ENSURE(nTargetCount == aCollectFlags.size(), "Unequal Point and Flag count (!)");
+
+ rPointSequenceRetval.realloc((sal_Int32)nTargetCount);
+ rFlagSequenceRetval.realloc((sal_Int32)nTargetCount);
+ com::sun::star::awt::Point* pPointSequence = rPointSequenceRetval.getArray();
+ com::sun::star::drawing::PolygonFlags* pFlagSequence = rFlagSequenceRetval.getArray();
+
+ for(sal_uInt32 a(0); a < nTargetCount; a++)
+ {
+ *pPointSequence = aCollectPoints[a];
+ *pFlagSequence = aCollectFlags[a];
+ pPointSequence++;
+ pFlagSequence++;
+ }
+ }
+ }
+ else
+ {
+ // straightforward point list creation
+ const sal_uInt32 nTargetCount(nPointCount + (bClosed ? 1 : 0));
+
+ rPointSequenceRetval.realloc((sal_Int32)nTargetCount);
+ rFlagSequenceRetval.realloc((sal_Int32)nTargetCount);
+
+ com::sun::star::awt::Point* pPointSequence = rPointSequenceRetval.getArray();
+ com::sun::star::drawing::PolygonFlags* pFlagSequence = rFlagSequenceRetval.getArray();
+
+ for(sal_uInt32 a(0); a < nPointCount; a++)
+ {
+ const B2DPoint aB2DPoint(rPolygon.getB2DPoint(a));
+ const com::sun::star::awt::Point aAPIPoint(
+ fround(aB2DPoint.getX()),
+ fround(aB2DPoint.getY()));
+
+ *pPointSequence = aAPIPoint;
+ *pFlagSequence = com::sun::star::drawing::PolygonFlags_NORMAL;
+ pPointSequence++;
+ pFlagSequence++;
+ }
+
+ if(bClosed)
+ {
+ // add first point as closing point
+ *pPointSequence = *rPointSequenceRetval.getConstArray();
+ *pFlagSequence = com::sun::star::drawing::PolygonFlags_NORMAL;
+ }
+ }
+ }
+ }
+ else
+ {
+ rPointSequenceRetval.realloc(0);
+ rFlagSequenceRetval.realloc(0);
+ }
+ }
- } // end of namespace tools
+ } // end of namespace tools
} // end of namespace basegfx
//////////////////////////////////////////////////////////////////////////////
Modified: openoffice/branches/alg/aw080/main/basegfx/source/polygon/b2dpolypolygontools.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg/aw080/main/basegfx/source/polygon/b2dpolypolygontools.cxx?rev=1537155&r1=1537154&r2=1537155&view=diff
==============================================================================
--- openoffice/branches/alg/aw080/main/basegfx/source/polygon/b2dpolypolygontools.cxx (original)
+++ openoffice/branches/alg/aw080/main/basegfx/source/polygon/b2dpolypolygontools.cxx Wed Oct 30 16:13:41 2013
@@ -592,118 +592,118 @@ namespace basegfx
return aRetval;
}
- //////////////////////////////////////////////////////////////////////////////
- // converters for com::sun::star::drawing::PointSequence
+ //////////////////////////////////////////////////////////////////////////////
+ // converters for com::sun::star::drawing::PointSequence
- B2DPolyPolygon UnoPointSequenceSequenceToB2DPolyPolygon(
- const com::sun::star::drawing::PointSequenceSequence& rPointSequenceSequenceSource,
- bool bCheckClosed)
- {
- B2DPolyPolygon aRetval;
- const com::sun::star::drawing::PointSequence* pPointSequence = rPointSequenceSequenceSource.getConstArray();
- const com::sun::star::drawing::PointSequence* pPointSeqEnd = pPointSequence + rPointSequenceSequenceSource.getLength();
-
- for(;pPointSequence != pPointSeqEnd; pPointSequence++)
- {
- const B2DPolygon aNewPolygon = UnoPointSequenceToB2DPolygon(*pPointSequence, bCheckClosed);
- aRetval.append(aNewPolygon);
- }
-
- return aRetval;
- }
-
- void B2DPolyPolygonToUnoPointSequenceSequence(
- const B2DPolyPolygon& rPolyPolygon,
- com::sun::star::drawing::PointSequenceSequence& rPointSequenceSequenceRetval)
- {
- const sal_uInt32 nCount(rPolyPolygon.count());
-
- if(nCount)
- {
- rPointSequenceSequenceRetval.realloc(nCount);
- com::sun::star::drawing::PointSequence* pPointSequence = rPointSequenceSequenceRetval.getArray();
-
- for(sal_uInt32 a(0); a < nCount; a++)
- {
- const B2DPolygon aPolygon(rPolyPolygon.getB2DPolygon(a));
-
- B2DPolygonToUnoPointSequence(aPolygon, *pPointSequence);
- pPointSequence++;
- }
- }
- else
- {
- rPointSequenceSequenceRetval.realloc(0);
- }
- }
-
- //////////////////////////////////////////////////////////////////////////////
- // converters for com::sun::star::drawing::PolyPolygonBezierCoords (curved polygons)
-
- B2DPolyPolygon UnoPolyPolygonBezierCoordsToB2DPolyPolygon(
- const com::sun::star::drawing::PolyPolygonBezierCoords& rPolyPolygonBezierCoordsSource,
- bool bCheckClosed)
- {
- B2DPolyPolygon aRetval;
- const sal_uInt32 nSequenceCount((sal_uInt32)rPolyPolygonBezierCoordsSource.Coordinates.getLength());
-
- if(nSequenceCount)
- {
- OSL_ENSURE(nSequenceCount == (sal_uInt32)rPolyPolygonBezierCoordsSource.Flags.getLength(),
- "UnoPolyPolygonBezierCoordsToB2DPolyPolygon: unequal number of Points and Flags (!)");
- const com::sun::star::drawing::PointSequence* pPointSequence = rPolyPolygonBezierCoordsSource.Coordinates.getConstArray();
- const com::sun::star::drawing::FlagSequence* pFlagSequence = rPolyPolygonBezierCoordsSource.Flags.getConstArray();
-
- for(sal_uInt32 a(0); a < nSequenceCount; a++)
- {
- const B2DPolygon aNewPolygon(UnoPolygonBezierCoordsToB2DPolygon(
- *pPointSequence,
- *pFlagSequence,
- bCheckClosed));
-
- pPointSequence++;
- pFlagSequence++;
- aRetval.append(aNewPolygon);
- }
- }
-
- return aRetval;
- }
-
- void B2DPolyPolygonToUnoPolyPolygonBezierCoords(
- const B2DPolyPolygon& rPolyPolygon,
- com::sun::star::drawing::PolyPolygonBezierCoords& rPolyPolygonBezierCoordsRetval)
- {
- const sal_uInt32 nCount(rPolyPolygon.count());
-
- if(nCount)
- {
- // prepare return value memory
- rPolyPolygonBezierCoordsRetval.Coordinates.realloc((sal_Int32)nCount);
- rPolyPolygonBezierCoordsRetval.Flags.realloc((sal_Int32)nCount);
-
- // get pointers to arrays
- com::sun::star::drawing::PointSequence* pPointSequence = rPolyPolygonBezierCoordsRetval.Coordinates.getArray();
- com::sun::star::drawing::FlagSequence* pFlagSequence = rPolyPolygonBezierCoordsRetval.Flags.getArray();
-
- for(sal_uInt32 a(0); a < nCount; a++)
- {
- const B2DPolygon aSource(rPolyPolygon.getB2DPolygon(a));
-
- B2DPolygonToUnoPolygonBezierCoords(
- aSource,
- *pPointSequence,
- *pFlagSequence);
- pPointSequence++;
- pFlagSequence++;
- }
- }
- else
- {
- rPolyPolygonBezierCoordsRetval.Coordinates.realloc(0);
- rPolyPolygonBezierCoordsRetval.Flags.realloc(0);
- }
- }
+ B2DPolyPolygon UnoPointSequenceSequenceToB2DPolyPolygon(
+ const com::sun::star::drawing::PointSequenceSequence& rPointSequenceSequenceSource,
+ bool bCheckClosed)
+ {
+ B2DPolyPolygon aRetval;
+ const com::sun::star::drawing::PointSequence* pPointSequence = rPointSequenceSequenceSource.getConstArray();
+ const com::sun::star::drawing::PointSequence* pPointSeqEnd = pPointSequence + rPointSequenceSequenceSource.getLength();
+
+ for(;pPointSequence != pPointSeqEnd; pPointSequence++)
+ {
+ const B2DPolygon aNewPolygon = UnoPointSequenceToB2DPolygon(*pPointSequence, bCheckClosed);
+ aRetval.append(aNewPolygon);
+ }
+
+ return aRetval;
+ }
+
+ void B2DPolyPolygonToUnoPointSequenceSequence(
+ const B2DPolyPolygon& rPolyPolygon,
+ com::sun::star::drawing::PointSequenceSequence& rPointSequenceSequenceRetval)
+ {
+ const sal_uInt32 nCount(rPolyPolygon.count());
+
+ if(nCount)
+ {
+ rPointSequenceSequenceRetval.realloc(nCount);
+ com::sun::star::drawing::PointSequence* pPointSequence = rPointSequenceSequenceRetval.getArray();
+
+ for(sal_uInt32 a(0); a < nCount; a++)
+ {
+ const B2DPolygon aPolygon(rPolyPolygon.getB2DPolygon(a));
+
+ B2DPolygonToUnoPointSequence(aPolygon, *pPointSequence);
+ pPointSequence++;
+ }
+ }
+ else
+ {
+ rPointSequenceSequenceRetval.realloc(0);
+ }
+ }
+
+ //////////////////////////////////////////////////////////////////////////////
+ // converters for com::sun::star::drawing::PolyPolygonBezierCoords (curved polygons)
+
+ B2DPolyPolygon UnoPolyPolygonBezierCoordsToB2DPolyPolygon(
+ const com::sun::star::drawing::PolyPolygonBezierCoords& rPolyPolygonBezierCoordsSource,
+ bool bCheckClosed)
+ {
+ B2DPolyPolygon aRetval;
+ const sal_uInt32 nSequenceCount((sal_uInt32)rPolyPolygonBezierCoordsSource.Coordinates.getLength());
+
+ if(nSequenceCount)
+ {
+ OSL_ENSURE(nSequenceCount == (sal_uInt32)rPolyPolygonBezierCoordsSource.Flags.getLength(),
+ "UnoPolyPolygonBezierCoordsToB2DPolyPolygon: unequal number of Points and Flags (!)");
+ const com::sun::star::drawing::PointSequence* pPointSequence = rPolyPolygonBezierCoordsSource.Coordinates.getConstArray();
+ const com::sun::star::drawing::FlagSequence* pFlagSequence = rPolyPolygonBezierCoordsSource.Flags.getConstArray();
+
+ for(sal_uInt32 a(0); a < nSequenceCount; a++)
+ {
+ const B2DPolygon aNewPolygon(UnoPolygonBezierCoordsToB2DPolygon(
+ *pPointSequence,
+ *pFlagSequence,
+ bCheckClosed));
+
+ pPointSequence++;
+ pFlagSequence++;
+ aRetval.append(aNewPolygon);
+ }
+ }
+
+ return aRetval;
+ }
+
+ void B2DPolyPolygonToUnoPolyPolygonBezierCoords(
+ const B2DPolyPolygon& rPolyPolygon,
+ com::sun::star::drawing::PolyPolygonBezierCoords& rPolyPolygonBezierCoordsRetval)
+ {
+ const sal_uInt32 nCount(rPolyPolygon.count());
+
+ if(nCount)
+ {
+ // prepare return value memory
+ rPolyPolygonBezierCoordsRetval.Coordinates.realloc((sal_Int32)nCount);
+ rPolyPolygonBezierCoordsRetval.Flags.realloc((sal_Int32)nCount);
+
+ // get pointers to arrays
+ com::sun::star::drawing::PointSequence* pPointSequence = rPolyPolygonBezierCoordsRetval.Coordinates.getArray();
+ com::sun::star::drawing::FlagSequence* pFlagSequence = rPolyPolygonBezierCoordsRetval.Flags.getArray();
+
+ for(sal_uInt32 a(0); a < nCount; a++)
+ {
+ const B2DPolygon aSource(rPolyPolygon.getB2DPolygon(a));
+
+ B2DPolygonToUnoPolygonBezierCoords(
+ aSource,
+ *pPointSequence,
+ *pFlagSequence);
+ pPointSequence++;
+ pFlagSequence++;
+ }
+ }
+ else
+ {
+ rPolyPolygonBezierCoordsRetval.Coordinates.realloc(0);
+ rPolyPolygonBezierCoordsRetval.Flags.realloc(0);
+ }
+ }
} // end of namespace tools
} // end of namespace basegfx
Modified: openoffice/branches/alg/aw080/main/basegfx/source/polygon/b2dsvgpolypolygon.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg/aw080/main/basegfx/source/polygon/b2dsvgpolypolygon.cxx?rev=1537155&r1=1537154&r2=1537155&view=diff
==============================================================================
--- openoffice/branches/alg/aw080/main/basegfx/source/polygon/b2dsvgpolypolygon.cxx (original)
+++ openoffice/branches/alg/aw080/main/basegfx/source/polygon/b2dsvgpolypolygon.cxx Wed Oct 30 16:13:41 2013
@@ -92,7 +92,10 @@ namespace basegfx
// add current polygon
if(bIsClosed)
{
- closeWithGeometryChange(aCurrPoly);
+ // #123465# no need to do the old closeWithGeometryChange
+ // corerection on SVG polygons; this even may lead to wrong
+ // results e.g. for marker processing
+ aCurrPoly.setClosed(true);
}
o_rPolyPolygon.append(aCurrPoly);
@@ -612,7 +615,10 @@ namespace basegfx
// end-process last poly
if(bIsClosed)
{
- closeWithGeometryChange(aCurrPoly);
+ // #123465# no need to do the old closeWithGeometryChange
+ // corerection on SVG polygons; this even may lead to wrong
+ // results e.g. for marker processing
+ aCurrPoly.setClosed(true);
}
o_rPolyPolygon.append(aCurrPoly);
Modified: openoffice/branches/alg/aw080/main/basegfx/source/polygon/b3dpolypolygontools.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg/aw080/main/basegfx/source/polygon/b3dpolypolygontools.cxx?rev=1537155&r1=1537154&r2=1537155&view=diff
==============================================================================
--- openoffice/branches/alg/aw080/main/basegfx/source/polygon/b3dpolypolygontools.cxx (original)
+++ openoffice/branches/alg/aw080/main/basegfx/source/polygon/b3dpolypolygontools.cxx Wed Oct 30 16:13:41 2013
@@ -545,125 +545,125 @@ namespace basegfx
B3DPolyPolygon UnoPolyPolygonShape3DToB3DPolyPolygon(
const com::sun::star::drawing::PolyPolygonShape3D& rPolyPolygonShape3DSource,
bool bCheckClosed)
- {
- B3DPolyPolygon aRetval;
- const sal_Int32 nOuterSequenceCount(rPolyPolygonShape3DSource.SequenceX.getLength());
-
- if(nOuterSequenceCount)
- {
- OSL_ENSURE(nOuterSequenceCount == rPolyPolygonShape3DSource.SequenceY.getLength()
- && nOuterSequenceCount == rPolyPolygonShape3DSource.SequenceZ.getLength(),
- "UnoPolyPolygonShape3DToB3DPolygon: Not all double sequences have the same length (!)");
-
- const com::sun::star::drawing::DoubleSequence* pInnerSequenceX = rPolyPolygonShape3DSource.SequenceX.getConstArray();
- const com::sun::star::drawing::DoubleSequence* pInnerSequenceY = rPolyPolygonShape3DSource.SequenceY.getConstArray();
- const com::sun::star::drawing::DoubleSequence* pInnerSequenceZ = rPolyPolygonShape3DSource.SequenceZ.getConstArray();
-
- for(sal_Int32 a(0); a < nOuterSequenceCount; a++)
- {
- basegfx::B3DPolygon aNewPolygon;
- const sal_Int32 nInnerSequenceCount(pInnerSequenceX->getLength());
- OSL_ENSURE(nInnerSequenceCount == pInnerSequenceY->getLength()
- && nInnerSequenceCount == pInnerSequenceZ->getLength(),
- "UnoPolyPolygonShape3DToB3DPolygon: Not all double sequences have the same length (!)");
-
- const double* pArrayX = pInnerSequenceX->getConstArray();
- const double* pArrayY = pInnerSequenceY->getConstArray();
- const double* pArrayZ = pInnerSequenceZ->getConstArray();
-
- for(sal_Int32 b(0); b < nInnerSequenceCount; b++)
- {
- aNewPolygon.append(basegfx::B3DPoint(*pArrayX++,*pArrayY++,*pArrayZ++));
- }
-
- pInnerSequenceX++;
- pInnerSequenceY++;
- pInnerSequenceZ++;
-
- // #i101520# correction is needed for imported polygons of old format,
- // see callers
- if(bCheckClosed)
- {
- basegfx::tools::checkClosed(aNewPolygon);
- }
-
- aRetval.append(aNewPolygon);
- }
- }
+ {
+ B3DPolyPolygon aRetval;
+ const sal_Int32 nOuterSequenceCount(rPolyPolygonShape3DSource.SequenceX.getLength());
+
+ if(nOuterSequenceCount)
+ {
+ OSL_ENSURE(nOuterSequenceCount == rPolyPolygonShape3DSource.SequenceY.getLength()
+ && nOuterSequenceCount == rPolyPolygonShape3DSource.SequenceZ.getLength(),
+ "UnoPolyPolygonShape3DToB3DPolygon: Not all double sequences have the same length (!)");
+
+ const com::sun::star::drawing::DoubleSequence* pInnerSequenceX = rPolyPolygonShape3DSource.SequenceX.getConstArray();
+ const com::sun::star::drawing::DoubleSequence* pInnerSequenceY = rPolyPolygonShape3DSource.SequenceY.getConstArray();
+ const com::sun::star::drawing::DoubleSequence* pInnerSequenceZ = rPolyPolygonShape3DSource.SequenceZ.getConstArray();
+
+ for(sal_Int32 a(0); a < nOuterSequenceCount; a++)
+ {
+ basegfx::B3DPolygon aNewPolygon;
+ const sal_Int32 nInnerSequenceCount(pInnerSequenceX->getLength());
+ OSL_ENSURE(nInnerSequenceCount == pInnerSequenceY->getLength()
+ && nInnerSequenceCount == pInnerSequenceZ->getLength(),
+ "UnoPolyPolygonShape3DToB3DPolygon: Not all double sequences have the same length (!)");
+
+ const double* pArrayX = pInnerSequenceX->getConstArray();
+ const double* pArrayY = pInnerSequenceY->getConstArray();
+ const double* pArrayZ = pInnerSequenceZ->getConstArray();
+
+ for(sal_Int32 b(0); b < nInnerSequenceCount; b++)
+ {
+ aNewPolygon.append(basegfx::B3DPoint(*pArrayX++,*pArrayY++,*pArrayZ++));
+ }
+
+ pInnerSequenceX++;
+ pInnerSequenceY++;
+ pInnerSequenceZ++;
+
+ // #i101520# correction is needed for imported polygons of old format,
+ // see callers
+ if(bCheckClosed)
+ {
+ basegfx::tools::checkClosed(aNewPolygon);
+ }
+
+ aRetval.append(aNewPolygon);
+ }
+ }
- return aRetval;
- }
+ return aRetval;
+ }
void B3DPolyPolygonToUnoPolyPolygonShape3D(
const B3DPolyPolygon& rPolyPolygonSource,
com::sun::star::drawing::PolyPolygonShape3D& rPolyPolygonShape3DRetval)
- {
- const sal_uInt32 nPolygonCount(rPolyPolygonSource.count());
+ {
+ const sal_uInt32 nPolygonCount(rPolyPolygonSource.count());
- if(nPolygonCount)
- {
- rPolyPolygonShape3DRetval.SequenceX.realloc(nPolygonCount);
- rPolyPolygonShape3DRetval.SequenceY.realloc(nPolygonCount);
- rPolyPolygonShape3DRetval.SequenceZ.realloc(nPolygonCount);
-
- com::sun::star::drawing::DoubleSequence* pOuterSequenceX = rPolyPolygonShape3DRetval.SequenceX.getArray();
- com::sun::star::drawing::DoubleSequence* pOuterSequenceY = rPolyPolygonShape3DRetval.SequenceY.getArray();
- com::sun::star::drawing::DoubleSequence* pOuterSequenceZ = rPolyPolygonShape3DRetval.SequenceZ.getArray();
-
- for(sal_uInt32 a(0); a < nPolygonCount; a++)
- {
- const basegfx::B3DPolygon aPoly(rPolyPolygonSource.getB3DPolygon(a));
- const sal_uInt32 nPointCount(aPoly.count());
-
- if(nPointCount)
- {
- const bool bIsClosed(aPoly.isClosed());
- const sal_uInt32 nTargetCount(bIsClosed ? nPointCount + 1 : nPointCount);
- pOuterSequenceX->realloc(nTargetCount);
- pOuterSequenceY->realloc(nTargetCount);
- pOuterSequenceZ->realloc(nTargetCount);
-
- double* pInnerSequenceX = pOuterSequenceX->getArray();
- double* pInnerSequenceY = pOuterSequenceY->getArray();
- double* pInnerSequenceZ = pOuterSequenceZ->getArray();
-
- for(sal_uInt32 b(0); b < nPointCount; b++)
- {
- const basegfx::B3DPoint aPoint(aPoly.getB3DPoint(b));
-
- *pInnerSequenceX++ = aPoint.getX();
- *pInnerSequenceY++ = aPoint.getY();
- *pInnerSequenceZ++ = aPoint.getZ();
- }
-
- if(bIsClosed)
- {
- const basegfx::B3DPoint aPoint(aPoly.getB3DPoint(0));
-
- *pInnerSequenceX++ = aPoint.getX();
- *pInnerSequenceY++ = aPoint.getY();
- *pInnerSequenceZ++ = aPoint.getZ();
- }
- }
- else
- {
- pOuterSequenceX->realloc(0);
- pOuterSequenceY->realloc(0);
- pOuterSequenceZ->realloc(0);
- }
-
- pOuterSequenceX++;
- pOuterSequenceY++;
- pOuterSequenceZ++;
- }
- }
- else
- {
- rPolyPolygonShape3DRetval.SequenceX.realloc(0);
- rPolyPolygonShape3DRetval.SequenceY.realloc(0);
- rPolyPolygonShape3DRetval.SequenceZ.realloc(0);
- }
- }
+ if(nPolygonCount)
+ {
+ rPolyPolygonShape3DRetval.SequenceX.realloc(nPolygonCount);
+ rPolyPolygonShape3DRetval.SequenceY.realloc(nPolygonCount);
+ rPolyPolygonShape3DRetval.SequenceZ.realloc(nPolygonCount);
+
+ com::sun::star::drawing::DoubleSequence* pOuterSequenceX = rPolyPolygonShape3DRetval.SequenceX.getArray();
+ com::sun::star::drawing::DoubleSequence* pOuterSequenceY = rPolyPolygonShape3DRetval.SequenceY.getArray();
+ com::sun::star::drawing::DoubleSequence* pOuterSequenceZ = rPolyPolygonShape3DRetval.SequenceZ.getArray();
+
+ for(sal_uInt32 a(0); a < nPolygonCount; a++)
+ {
+ const basegfx::B3DPolygon aPoly(rPolyPolygonSource.getB3DPolygon(a));
+ const sal_uInt32 nPointCount(aPoly.count());
+
+ if(nPointCount)
+ {
+ const bool bIsClosed(aPoly.isClosed());
+ const sal_uInt32 nTargetCount(bIsClosed ? nPointCount + 1 : nPointCount);
+ pOuterSequenceX->realloc(nTargetCount);
+ pOuterSequenceY->realloc(nTargetCount);
+ pOuterSequenceZ->realloc(nTargetCount);
+
+ double* pInnerSequenceX = pOuterSequenceX->getArray();
+ double* pInnerSequenceY = pOuterSequenceY->getArray();
+ double* pInnerSequenceZ = pOuterSequenceZ->getArray();
+
+ for(sal_uInt32 b(0); b < nPointCount; b++)
+ {
+ const basegfx::B3DPoint aPoint(aPoly.getB3DPoint(b));
+
+ *pInnerSequenceX++ = aPoint.getX();
+ *pInnerSequenceY++ = aPoint.getY();
+ *pInnerSequenceZ++ = aPoint.getZ();
+ }
+
+ if(bIsClosed)
+ {
+ const basegfx::B3DPoint aPoint(aPoly.getB3DPoint(0));
+
+ *pInnerSequenceX++ = aPoint.getX();
+ *pInnerSequenceY++ = aPoint.getY();
+ *pInnerSequenceZ++ = aPoint.getZ();
+ }
+ }
+ else
+ {
+ pOuterSequenceX->realloc(0);
+ pOuterSequenceY->realloc(0);
+ pOuterSequenceZ->realloc(0);
+ }
+
+ pOuterSequenceX++;
+ pOuterSequenceY++;
+ pOuterSequenceZ++;
+ }
+ }
+ else
+ {
+ rPolyPolygonShape3DRetval.SequenceX.realloc(0);
+ rPolyPolygonShape3DRetval.SequenceY.realloc(0);
+ rPolyPolygonShape3DRetval.SequenceZ.realloc(0);
+ }
+ }
} // end of namespace tools
} // end of namespace basegfx
Modified: openoffice/branches/alg/aw080/main/xmloff/inc/xexptran.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg/aw080/main/xmloff/inc/xexptran.hxx?rev=1537155&r1=1537154&r2=1537155&view=diff
==============================================================================
--- openoffice/branches/alg/aw080/main/xmloff/inc/xexptran.hxx (original)
+++ openoffice/branches/alg/aw080/main/xmloff/inc/xexptran.hxx Wed Oct 30 16:13:41 2013
@@ -115,84 +115,22 @@ public:
class SdXMLImExViewBox
{
- rtl::OUString msString;
- double mfX;
- double mfY;
- double mfW;
- double mfH;
+ rtl::OUString msString;
+ double mfX;
+ double mfY;
+ double mfW;
+ double mfH;
public:
- SdXMLImExViewBox(double fX = 0.0, double fY = 0.0, double fW = 1000.0, double fH = 1000.0);
- SdXMLImExViewBox(const rtl::OUString& rNew, const SvXMLUnitConverter& rConv);
+ SdXMLImExViewBox(double fX = 0.0, double fY = 0.0, double fW = 1000.0, double fH = 1000.0);
+ SdXMLImExViewBox(const rtl::OUString& rNew, const SvXMLUnitConverter& rConv);
- double GetX() const { return mfX; }
- double GetY() const { return mfY; }
- double GetWidth() const { return mfW; }
- double GetHeight() const { return mfH; }
- const rtl::OUString& GetExportString();
+ double GetX() const { return mfX; }
+ double GetY() const { return mfY; }
+ double GetWidth() const { return mfW; }
+ double GetHeight() const { return mfH; }
+ const rtl::OUString& GetExportString();
};
-//////////////////////////////////////////////////////////////////////////////
-//
-//class SdXMLImExPointsElement
-//{
-// rtl::OUString msString;
-// com::sun::star::drawing::PointSequenceSequence maPoly;
-//
-//public:
-// SdXMLImExPointsElement(com::sun::star::drawing::PointSequence* pPoints,
-// const SdXMLImExViewBox& rViewBox,
-// const com::sun::star::awt::Point& rObjectPos,
-// const com::sun::star::awt::Size& rObjectSize,
-// const bool bClosed);
-// SdXMLImExPointsElement(const rtl::OUString& rNew,
-// const SdXMLImExViewBox& rViewBox,
-// const com::sun::star::awt::Point& rObjectPos,
-// const com::sun::star::awt::Size& rObjectSize,
-// const SvXMLUnitConverter& rConv,
-// const bool bClosed);
-//
-// const rtl::OUString& GetExportString() const { return msString; }
-// const com::sun::star::drawing::PointSequenceSequence& GetPointSequenceSequence() const { return maPoly; }
-//};
-//
-//////////////////////////////////////////////////////////////////////////////
-//
-//class SdXMLImExSvgDElement
-//{
-// rtl::OUString msString;
-// const SdXMLImExViewBox& mrViewBox;
-// bool mbIsClosed;
-// bool mbIsCurve;
-//
-// sal_Int32 mnLastX;
-// sal_Int32 mnLastY;
-//
-// com::sun::star::drawing::PointSequenceSequence maPoly;
-// com::sun::star::drawing::FlagSequenceSequence maFlag;
-//
-//public:
-// SdXMLImExSvgDElement(const SdXMLImExViewBox& rViewBox);
-// SdXMLImExSvgDElement(const rtl::OUString& rNew,
-// const SdXMLImExViewBox& rViewBox,
-// const com::sun::star::awt::Point& rObjectPos,
-// const com::sun::star::awt::Size& rObjectSize,
-// const SvXMLUnitConverter& rConv);
-//
-// void AddPolygon(
-// com::sun::star::drawing::PointSequence* pPoints,
-// com::sun::star::drawing::FlagSequence* pFlags,
-// const com::sun::star::awt::Point& rObjectPos,
-// const com::sun::star::awt::Size& rObjectSize,
-// bool bClosed = false, bool bRelative = true);
-//
-// const rtl::OUString& GetExportString() const { return msString; }
-// bool IsClosed() const { return mbIsClosed; }
-// bool IsCurve() const { return mbIsCurve; }
-// const com::sun::star::drawing::PointSequenceSequence& GetPointSequenceSequence() const { return maPoly; }
-// const com::sun::star::drawing::FlagSequenceSequence& GetFlagSequenceSequence() const { return maFlag; }
-//};
-//
-
#endif // _XEXPTRANSFORM_HXX
// eof
Modified: openoffice/branches/alg/aw080/main/xmloff/source/draw/XMLImageMapContext.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg/aw080/main/xmloff/source/draw/XMLImageMapContext.cxx?rev=1537155&r1=1537154&r2=1537155&view=diff
==============================================================================
--- openoffice/branches/alg/aw080/main/xmloff/source/draw/XMLImageMapContext.cxx (original)
+++ openoffice/branches/alg/aw080/main/xmloff/source/draw/XMLImageMapContext.cxx Wed Oct 30 16:13:41 2013
@@ -508,18 +508,6 @@ void XMLImageMapPolygonContext::Prepare(
rPropertySet->setPropertyValue(sPolygon, aAny);
}
}
- //awt::Point aPoint(aViewBox.GetX(), aViewBox.GetY());
- //awt::Size aSize(aViewBox.GetWidth(), aViewBox.GetHeight());
- //SdXMLImExPointsElement aPoints( sPointsString, aViewBox, aPoint, aSize, GetImport().GetMM100UnitConverter(), true );
- //PointSequenceSequence aPointSeqSeq = aPoints.GetPointSequenceSequence();
- //
- //// only use first element of sequence-sequence
- //if (aPointSeqSeq.getLength() > 0)
- //{
- // Any aAny;
- // aAny <<= aPointSeqSeq[0];
- // rPropertySet->setPropertyValue(sPolygon, aAny);
- //}
// parent properties
XMLImageMapObjectContext::Prepare(rPropertySet);
Modified: openoffice/branches/alg/aw080/main/xmloff/source/draw/XMLImageMapExport.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg/aw080/main/xmloff/source/draw/XMLImageMapExport.cxx?rev=1537155&r1=1537154&r2=1537155&view=diff
==============================================================================
--- openoffice/branches/alg/aw080/main/xmloff/source/draw/XMLImageMapExport.cxx (original)
+++ openoffice/branches/alg/aw080/main/xmloff/source/draw/XMLImageMapExport.cxx Wed Oct 30 16:13:41 2013
@@ -318,8 +318,7 @@ void XMLImageMapExport::ExportCircle(
aBuffer.makeStringAndClear() );
}
-void XMLImageMapExport::ExportPolygon(
- const Reference<XPropertySet> & rPropertySet)
+void XMLImageMapExport::ExportPolygon(const Reference<XPropertySet> & rPropertySet)
{
// polygons get exported as bounding box, viewbox, and coordinate
// pair sequence. The bounding box is always the entire image.
@@ -334,27 +333,6 @@ void XMLImageMapExport::ExportPolygon(
aPoly));
const basegfx::B2DRange aPolygonRange(aPolygon.getB2DRange());
-// TTTT:
-// // get bounding box (assume top-left to be 0,0)
-// sal_Int32 nWidth = 0;
-// sal_Int32 nHeight = 0;
-// sal_Int32 nLength = aPoly.getLength();
-// const struct awt::Point* pPointPtr = aPoly.getConstArray();
-// for ( sal_Int32 i = 0; i < nLength; i++ )
-// {
-// sal_Int32 nPolyX = pPointPtr->X;
-// sal_Int32 nPolyY = pPointPtr->Y;
-//
-// if ( nPolyX > nWidth )
-// nWidth = nPolyX;
-// if ( nPolyY > nHeight )
-// nHeight = nPolyY;
-//
-// pPointPtr++;
-// }
-// DBG_ASSERT(nWidth > 0, "impossible Polygon found");
-// DBG_ASSERT(nHeight > 0, "impossible Polygon found");
-
// parameters svg:x, svg:y, svg:width, svg:height
OUStringBuffer aBuffer;
@@ -377,12 +355,6 @@ void XMLImageMapExport::ExportPolygon(
aPolygon));
mrExport.AddAttribute(XML_NAMESPACE_DRAW, XML_POINTS, aPointString);
-
- // TTTT:
- //awt::Point aPoint(0, 0);
- //awt::Size aSize(nWidth, nHeight);
- //SdXMLImExPointsElement aPoints( &aPoly, aViewBox, aPoint, aSize, true);
- //mrExport.AddAttribute( XML_NAMESPACE_DRAW, XML_POINTS, aPoints.GetExportString());
}
// eof
Modified: openoffice/branches/alg/aw080/main/xmloff/source/draw/shapeexport2.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg/aw080/main/xmloff/source/draw/shapeexport2.cxx?rev=1537155&r1=1537154&r2=1537155&view=diff
==============================================================================
--- openoffice/branches/alg/aw080/main/xmloff/source/draw/shapeexport2.cxx (original)
+++ openoffice/branches/alg/aw080/main/xmloff/source/draw/shapeexport2.cxx Wed Oct 30 16:13:41 2013
@@ -949,44 +949,39 @@ void XMLShapeExport::ImpExportEllipseSha
sal_Bool bCreateNewline( (nFeatures & SEF_EXPORT_NO_WS) == 0 ); // #86116#/#92210#
- if(bCircle)
- {
- // write circle
- SvXMLElementExport aOBJ(mrExport, XML_NAMESPACE_DRAW, XML_CIRCLE, bCreateNewline, sal_True);
+ // prepare name (with most used)
+ enum ::xmloff::token::XMLTokenEnum eName(XML_CIRCLE);
- ImpExportDescription( xShape ); // #i68101#
- ImpExportEvents( xShape );
- ImpExportGluePoints( xShape );
- ImpExportText( xShape );
- }
- else
- {
- // write ellipse
- SvXMLElementExport aOBJ(mrExport, XML_NAMESPACE_DRAW, XML_ELLIPSE, bCreateNewline, sal_True);
+ if(bCircle)
+ {
+ // name already set
+ }
+ else
+ {
+ // set name
+ eName = XML_ELLIPSE;
+ }
- ImpExportDescription( xShape ); // #i68101#
- ImpExportEvents( xShape );
- ImpExportGluePoints( xShape );
- ImpExportText( xShape );
- }
- }
+ // write ellipse or circle
+ SvXMLElementExport aOBJ(mrExport, XML_NAMESPACE_DRAW, eName, bCreateNewline, sal_True);
+
+ ImpExportDescription( xShape ); // #i68101#
+ ImpExportEvents( xShape );
+ ImpExportGluePoints( xShape );
+ ImpExportText( xShape );
+ }
}
//////////////////////////////////////////////////////////////////////////////
void XMLShapeExport::ImpExportPolygonShape(
const uno::Reference< drawing::XShape >& xShape,
- XmlShapeType /*eShapeType*/, sal_Int32 nFeatures, awt::Point* pRefPoint) // TTTT: eShapeType
+ XmlShapeType /*eShapeType*/, sal_Int32 nFeatures, awt::Point* pRefPoint)
{
const uno::Reference< beans::XPropertySet > xPropSet(xShape, uno::UNO_QUERY);
if(xPropSet.is())
{
-// sal_Bool bClosed(eShapeType == XmlShapeTypeDrawPolyPolygonShape
-// || eShapeType == XmlShapeTypeDrawClosedBezierShape);
-// sal_Bool bBezier(eShapeType == XmlShapeTypeDrawClosedBezierShape
-// || eShapeType == XmlShapeTypeDrawOpenBezierShape);
-
// get matrix
::basegfx::B2DHomMatrix aMatrix;
ImpExportNewTrans_GetB2DHomMatrix(aMatrix, xPropSet);
@@ -1001,9 +996,6 @@ void XMLShapeExport::ImpExportPolygonSha
// use features and write
ImpExportNewTrans_FeaturesAndWrite(aTRScale, fTRShear, fTRRotate, aTRTranslate, nFeatures);
- //awt::Point aPoint(0, 0);
- //awt::Size aSize(FRound(fabs(aTRScale.getX())), FRound(fabs(aTRScale.getY())));
-
// create and export ViewBox. caution! for svg:ViewBox, use the absolute values (!)
SdXMLImExViewBox aViewBox(0.0, 0.0, fabs(aTRScale.getX()), fabs(aTRScale.getY()));
@@ -1014,6 +1006,9 @@ void XMLShapeExport::ImpExportPolygonSha
basegfx::B2DPolyPolygon aPolyPolygon;
const bool bCreateNewline( (nFeatures & SEF_EXPORT_NO_WS) == 0 ); // #86116#/#92210#
+ // prepare name (with most used)
+ enum ::xmloff::token::XMLTokenEnum eName(XML_PATH);
+
if(aAny.getValueType().equals(getCppuType((drawing::PolyPolygonBezierCoords*)0)))
{
aPolyPolygon = basegfx::tools::UnoPolyPolygonBezierCoordsToB2DPolyPolygon(*(drawing::PolyPolygonBezierCoords*)aAny.getValue());
@@ -1032,13 +1027,8 @@ void XMLShapeExport::ImpExportPolygonSha
// write point array
mrExport.AddAttribute(XML_NAMESPACE_DRAW, XML_POINTS, aPointString);
- // write object now
- SvXMLElementExport aOBJ(
- mrExport,
- XML_NAMESPACE_DRAW,
- aPolygon.isClosed() ? XML_POLYGON : XML_POLYLINE,
- bCreateNewline,
- sal_True);
+ // set name
+ eName = aPolygon.isClosed() ? XML_POLYGON : XML_POLYLINE;
}
else
{
@@ -1051,135 +1041,22 @@ void XMLShapeExport::ImpExportPolygonSha
// write point array
mrExport.AddAttribute(XML_NAMESPACE_SVG, XML_D, aPolygonString);
-
- // write object now
- SvXMLElementExport aOBJ(
- mrExport,
- XML_NAMESPACE_DRAW,
- XML_PATH,
- bCreateNewline,
- sal_True);
}
+ // write object, but after attributes are added since this call will
+ // consume all of these added attributes and the destructor will close the
+ // scope. Also before text is added; this may add sub-scopes as needed
+ SvXMLElementExport aOBJ(
+ mrExport,
+ XML_NAMESPACE_DRAW,
+ eName,
+ bCreateNewline,
+ sal_True);
+
ImpExportDescription( xShape ); // #i68101#
ImpExportEvents( xShape );
ImpExportGluePoints( xShape );
ImpExportText( xShape );
-
-// TTTT
-// if(bBezier)
-// {
-// // get PolygonBezier
-// uno::Any aAny( xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("Geometry"))) );
-// drawing::PolyPolygonBezierCoords* pSourcePolyPolygon =
-// (drawing::PolyPolygonBezierCoords*)aAny.getValue();
-//
-// if(pSourcePolyPolygon && pSourcePolyPolygon->Coordinates.getLength())
-// {
-// sal_Int32 nOuterCnt(pSourcePolyPolygon->Coordinates.getLength());
-// drawing::PointSequence* pOuterSequence = pSourcePolyPolygon->Coordinates.getArray();
-// drawing::FlagSequence* pOuterFlags = pSourcePolyPolygon->Flags.getArray();
-//
-// if(pOuterSequence && pOuterFlags)
-// {
-// // prepare svx:d element export
-// SdXMLImExSvgDElement aSvgDElement(aViewBox);
-//
-// for(sal_Int32 a(0L); a < nOuterCnt; a++)
-// {
-// drawing::PointSequence* pSequence = pOuterSequence++;
-// drawing::FlagSequence* pFlags = pOuterFlags++;
-//
-// if(pSequence && pFlags)
-// {
-// aSvgDElement.AddPolygon(pSequence, pFlags,
-// aPoint, aSize, bClosed);
-// }
-// }
-//
-// // write point array
-// mrExport.AddAttribute(XML_NAMESPACE_SVG, XML_D, aSvgDElement.GetExportString());
-// }
-//
-// // write object now
-// SvXMLElementExport aOBJ(mrExport, XML_NAMESPACE_DRAW, XML_PATH, bCreateNewline, sal_True);
-//
-// ImpExportDescription( xShape ); // #i68101#
-// ImpExportEvents( xShape );
-// ImpExportGluePoints( xShape );
-// ImpExportText( xShape );
-// }
-// }
-// else
-// {
-// // get non-bezier polygon
-// uno::Any aAny( xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("Geometry"))) );
-// drawing::PointSequenceSequence* pSourcePolyPolygon = (drawing::PointSequenceSequence*)aAny.getValue();
-//
-// if(pSourcePolyPolygon && pSourcePolyPolygon->getLength())
-// {
-// sal_Int32 nOuterCnt(pSourcePolyPolygon->getLength());
-//
-// if(1L == nOuterCnt && !bBezier)
-// {
-// // simple polygon shape, can be written as svg:points sequence
-// drawing::PointSequence* pSequence = pSourcePolyPolygon->getArray();
-// if(pSequence)
-// {
-// const basegfx::B2DPolygon aPolygon(
-// basegfx::tools::UnoPointSequenceToB2DPolygon(
-// *pSequence));
-// const ::rtl::OUString aPointString(
-// basegfx::tools::exportToSvgPoints(
-// aPolygon));
-// // SdXMLImExPointsElement aPoints(pSequence, aViewBox, aPoint, aSize, bClosed);
-//
-// // write point array
-// mrExport.AddAttribute(XML_NAMESPACE_DRAW, XML_POINTS, aPointString);
-// }
-//
-// // write object now
-// SvXMLElementExport aOBJ(mrExport, XML_NAMESPACE_DRAW,
-// bClosed ? XML_POLYGON : XML_POLYLINE , bCreateNewline, sal_True);
-//
-// ImpExportDescription( xShape ); // #i68101#
-// ImpExportEvents( xShape );
-// ImpExportGluePoints( xShape );
-// ImpExportText( xShape );
-// }
-// else
-// {
-// // polypolygon or bezier, needs to be written as a svg:path sequence
-// drawing::PointSequence* pOuterSequence = pSourcePolyPolygon->getArray();
-// if(pOuterSequence)
-// {
-// // prepare svx:d element export
-// SdXMLImExSvgDElement aSvgDElement(aViewBox);
-//
-// for(sal_Int32 a(0L); a < nOuterCnt; a++)
-// {
-// drawing::PointSequence* pSequence = pOuterSequence++;
-// if(pSequence)
-// {
-// aSvgDElement.AddPolygon(pSequence, 0L, aPoint,
-// aSize, bClosed);
-// }
-// }
-//
-// // write point array
-// mrExport.AddAttribute(XML_NAMESPACE_SVG, XML_D, aSvgDElement.GetExportString());
-// }
-//
-// // write object now
-// SvXMLElementExport aOBJ(mrExport, XML_NAMESPACE_DRAW, XML_PATH, bCreateNewline, sal_True);
-//
-// ImpExportDescription( xShape ); // #i68101#
-// ImpExportEvents( xShape );
-// ImpExportGluePoints( xShape );
-// ImpExportText( xShape );
-// }
-// }
-// }
}
}
@@ -1538,34 +1415,6 @@ void XMLShapeExport::ImpExportConnectorS
// write svg:d
mrExport.AddAttribute(XML_NAMESPACE_SVG, XML_D, aPolygonString);
-// TTTT
-// sal_Int32 nOuterCnt(pSourcePolyPolygon->Coordinates.getLength());
-// drawing::PointSequence* pOuterSequence = pSourcePolyPolygon->Coordinates.getArray();
-// drawing::FlagSequence* pOuterFlags = pSourcePolyPolygon->Flags.getArray();
-//
-// if(pOuterSequence && pOuterFlags)
-// {
-// // prepare svx:d element export
-// awt::Point aPoint( 0, 0 );
-// awt::Size aSize( 1, 1 );
-// SdXMLImExViewBox aViewBox( 0.0, 0.0, 1.0, 1.0 );
-// SdXMLImExSvgDElement aSvgDElement(aViewBox);
-//
-// for(sal_Int32 a(0L); a < nOuterCnt; a++)
-// {
-// drawing::PointSequence* pSequence = pOuterSequence++;
-// drawing::FlagSequence* pFlags = pOuterFlags++;
-//
-// if(pSequence && pFlags)
-// {
-// aSvgDElement.AddPolygon(pSequence, pFlags,
-// aPoint, aSize, sal_False );
-// }
-// }
-//
-// // write point array
-// mrExport.AddAttribute(XML_NAMESPACE_SVG, XML_D, aSvgDElement.GetExportString());
-// }
}
}
Modified: openoffice/branches/alg/aw080/main/xmloff/source/draw/shapeexport3.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg/aw080/main/xmloff/source/draw/shapeexport3.cxx?rev=1537155&r1=1537154&r2=1537155&view=diff
==============================================================================
--- openoffice/branches/alg/aw080/main/xmloff/source/draw/shapeexport3.cxx (original)
+++ openoffice/branches/alg/aw080/main/xmloff/source/draw/shapeexport3.cxx Wed Oct 30 16:13:41 2013
@@ -237,99 +237,6 @@ void XMLShapeExport::ImpExport3DShape(
// write point array
mrExport.AddAttribute(XML_NAMESPACE_SVG, XML_D, aPolygonString);
- // TTTT
- //// look for maximal values
- //double fXMin = 0;
- //double fXMax = 0;
- //double fYMin = 0;
- //double fYMax = 0;
- //sal_Bool bInit(sal_False);
- //sal_Int32 nOuterSequenceCount(xPolyPolygon3D.SequenceX.getLength());
- //drawing::DoubleSequence* pInnerSequenceX = xPolyPolygon3D.SequenceX.getArray();
- //drawing::DoubleSequence* pInnerSequenceY = xPolyPolygon3D.SequenceY.getArray();
- //
- //sal_Int32 a;
- //for (a = 0; a < nOuterSequenceCount; a++)
- //{
- // sal_Int32 nInnerSequenceCount(pInnerSequenceX->getLength());
- // double* pArrayX = pInnerSequenceX->getArray();
- // double* pArrayY = pInnerSequenceY->getArray();
- //
- // for(sal_Int32 b(0L); b < nInnerSequenceCount; b++)
- // {
- // double fX = *pArrayX++;
- // double fY = *pArrayY++;
- //
- // if(bInit)
- // {
- // if(fX > fXMax)
- // fXMax = fX;
- //
- // if(fX < fXMin)
- // fXMin = fX;
- //
- // if(fY > fYMax)
- // fYMax = fY;
- //
- // if(fY < fYMin)
- // fYMin = fY;
- // }
- // else
- // {
- // fXMin = fXMax = fX;
- // fYMin = fYMax = fY;
- // bInit = sal_True;
- // }
- // }
- //
- // pInnerSequenceX++;
- // pInnerSequenceY++;
- //}
- //
- //// export ViewBox
- //awt::Point aMinPoint(FRound(fXMin), FRound(fYMin));
- //awt::Size aMaxSize(FRound(fXMax) - aMinPoint.X, FRound(fYMax) - aMinPoint.Y);
- //SdXMLImExViewBox aViewBox(fXMin, fYMin, fXMax - fXMin, fYMax - fYMin);
- //mrExport.AddAttribute(XML_NAMESPACE_SVG, XML_VIEWBOX, aViewBox.GetExportString());
- //
- //// prepare svx:d element export
- //SdXMLImExSvgDElement aSvgDElement(aViewBox);
- //pInnerSequenceX = xPolyPolygon3D.SequenceX.getArray();
- //pInnerSequenceY = xPolyPolygon3D.SequenceY.getArray();
- //
- //for (a = 0; a < nOuterSequenceCount; a++)
- //{
- // sal_Int32 nInnerSequenceCount(pInnerSequenceX->getLength());
- // double* pArrayX = pInnerSequenceX->getArray();
- // double* pArrayY = pInnerSequenceY->getArray();
- // drawing::PointSequence aPoly(nInnerSequenceCount);
- // awt::Point* pInnerSequence = aPoly.getArray();
- //
- // for(sal_Int32 b(0L); b < nInnerSequenceCount; b++)
- // {
- // double fX = *pArrayX++;
- // double fY = *pArrayY++;
- //
- // *pInnerSequence = awt::Point(FRound(fX), FRound(fY));
- // pInnerSequence++;
- // }
- //
- // // calculate closed flag
- // awt::Point* pFirst = aPoly.getArray();
- // awt::Point* pLast = pFirst + (nInnerSequenceCount - 1);
- // sal_Bool bClosed = (pFirst->X == pLast->X && pFirst->Y == pLast->Y);
- //
- // aSvgDElement.AddPolygon(&aPoly, 0L, aMinPoint,
- // aMaxSize, bClosed);
- //
- // // #80594# corrected error in PolyPolygon3D export for 3D XML
- // pInnerSequenceX++;
- // pInnerSequenceY++;
- //}
- //
- //// write point array
- //mrExport.AddAttribute(XML_NAMESPACE_SVG, XML_D, aSvgDElement.GetExportString());
-
if(eShapeType == XmlShapeTypeDraw3DLatheObject)
{
// write 3DLathe shape