Kaydet (Commit) 9a5fe91a authored tarafından Armin Le Grand's avatar Armin Le Grand

#118783# Corrected errors in ID strings, corrected Svg line/fill export,…

#118783# Corrected errors in ID strings, corrected Svg line/fill export, corrected polygon close state
üst 0b23dadb
...@@ -689,7 +689,7 @@ sal_Bool SVGFilter::implExportPages( const Reference< XDrawPages >& rxPages, ...@@ -689,7 +689,7 @@ sal_Bool SVGFilter::implExportPages( const Reference< XDrawPages >& rxPages,
aId = ( B2UCONST( "Slide_" ) ) += ::rtl::OUString::valueOf( ++mnSlideId ); aId = ( B2UCONST( "Slide_" ) ) += ::rtl::OUString::valueOf( ++mnSlideId );
if( aSlideName.getLength() ) if( aSlideName.getLength() )
( ( aId += B2UCONST( "(" ) ) += aSlideName ) += B2UCONST( ")" ); ( aId += B2UCONST( "_" ) ) += aSlideName;
mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "id", aId ); mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "id", aId );
...@@ -825,7 +825,7 @@ sal_Bool SVGFilter::implExportShape( const Reference< XShape >& rxShape ) ...@@ -825,7 +825,7 @@ sal_Bool SVGFilter::implExportShape( const Reference< XShape >& rxShape )
aId += ::rtl::OUString::valueOf( ++mnDrawingGroupId ); aId += ::rtl::OUString::valueOf( ++mnDrawingGroupId );
if( aObjName.getLength() ) if( aObjName.getLength() )
( ( aId += B2UCONST( "(" ) ) += aObjName ) += B2UCONST( ")" ); ( aId += B2UCONST( "_" ) ) += aObjName;
mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "id", aId ); mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "id", aId );
...@@ -855,7 +855,7 @@ sal_Bool SVGFilter::implExportShape( const Reference< XShape >& rxShape ) ...@@ -855,7 +855,7 @@ sal_Bool SVGFilter::implExportShape( const Reference< XShape >& rxShape )
aId += ::rtl::OUString::valueOf( ++mnDrawingId ); aId += ::rtl::OUString::valueOf( ++mnDrawingId );
if( aObjName.getLength() ) if( aObjName.getLength() )
( ( aId += B2UCONST( "(" ) ) += aObjName ) += B2UCONST( ")" ); ( aId += B2UCONST( "_" ) ) += aObjName;
{ {
if( ( aShapeType.lastIndexOf( B2UCONST( "drawing.OLE2Shape" ) ) != -1 ) || if( ( aShapeType.lastIndexOf( B2UCONST( "drawing.OLE2Shape" ) ) != -1 ) ||
......
...@@ -489,8 +489,8 @@ PolyPolygon& SVGActionWriter::ImplMap( const PolyPolygon& rPolyPoly, PolyPolygon ...@@ -489,8 +489,8 @@ PolyPolygon& SVGActionWriter::ImplMap( const PolyPolygon& rPolyPoly, PolyPolygon
aPathData += ::rtl::OUString::valueOf( ( aPolyPoint = rPoly[ 0 ] ).X() ); aPathData += ::rtl::OUString::valueOf( ( aPolyPoint = rPoly[ 0 ] ).X() );
aPathData += aComma; aPathData += aComma;
aPathData += ::rtl::OUString::valueOf( aPolyPoint.Y() ); aPathData += ::rtl::OUString::valueOf( aPolyPoint.Y() );
sal_Char nCurrentMode = 0; sal_Char nCurrentMode = 0;
const bool bClose(!bLine || rPoly[0] == rPoly[nSize - 1]);
while( n < nSize ) while( n < nSize )
{ {
...@@ -525,7 +525,7 @@ PolyPolygon& SVGActionWriter::ImplMap( const PolyPolygon& rPolyPoly, PolyPolygon ...@@ -525,7 +525,7 @@ PolyPolygon& SVGActionWriter::ImplMap( const PolyPolygon& rPolyPoly, PolyPolygon
} }
} }
if( !bLine ) if(bClose)
aPathData += B2UCONST( " Z" ); aPathData += B2UCONST( " Z" );
if( i < ( nCount - 1 ) ) if( i < ( nCount - 1 ) )
...@@ -1039,6 +1039,10 @@ void SVGActionWriter::ImplWriteActions( const GDIMetaFile& rMtf, ...@@ -1039,6 +1039,10 @@ void SVGActionWriter::ImplWriteActions( const GDIMetaFile& rMtf,
sal_uInt32 nWriteFlags, sal_uInt32 nWriteFlags,
const ::rtl::OUString* pElementId ) const ::rtl::OUString* pElementId )
{ {
// need a counter fo rthe actions written per shape to avoid double ID
// generation
sal_Int32 nEntryCount(0);
if( mnInnerMtfCount ) if( mnInnerMtfCount )
nWriteFlags |= SVGWRITER_NO_SHAPE_COMMENTS; nWriteFlags |= SVGWRITER_NO_SHAPE_COMMENTS;
...@@ -1381,7 +1385,9 @@ void SVGActionWriter::ImplWriteActions( const GDIMetaFile& rMtf, ...@@ -1381,7 +1385,9 @@ void SVGActionWriter::ImplWriteActions( const GDIMetaFile& rMtf,
mapCurShape.reset( new SVGShapeDescriptor ); mapCurShape.reset( new SVGShapeDescriptor );
if( pElementId ) if( pElementId )
mapCurShape->maId = *pElementId; {
mapCurShape->maId = *pElementId + B2UCONST("_") + ::rtl::OUString::valueOf(nEntryCount++);
}
mapCurShape->maShapePolyPoly = aShapePolyPoly; mapCurShape->maShapePolyPoly = aShapePolyPoly;
mapCurShape->maShapeFillColor = aFill.getFillColor(); mapCurShape->maShapeFillColor = aFill.getFillColor();
...@@ -1447,16 +1453,32 @@ void SVGActionWriter::ImplWriteActions( const GDIMetaFile& rMtf, ...@@ -1447,16 +1453,32 @@ void SVGActionWriter::ImplWriteActions( const GDIMetaFile& rMtf,
if( bSkip ) if( bSkip )
{ {
Polygon aPoly;
aStroke.getPath(aPoly);
if(mapCurShape.get())
{
if(1 != mapCurShape->maShapePolyPoly.Count()
|| !mapCurShape->maShapePolyPoly[0].IsEqual(aPoly))
{
// this path action is not covering the same path than the already existing
// fill polypolygon, so write out the fill polygon
ImplWriteShape( *mapCurShape );
mapCurShape.reset();
}
}
if( !mapCurShape.get() ) if( !mapCurShape.get() )
{ {
Polygon aPoly;
mapCurShape.reset( new SVGShapeDescriptor ); mapCurShape.reset( new SVGShapeDescriptor );
if( pElementId ) if( pElementId )
mapCurShape->maId = *pElementId; {
mapCurShape->maId = *pElementId + B2UCONST("_") + ::rtl::OUString::valueOf(nEntryCount++);
}
aStroke.getPath( aPoly );
mapCurShape->maShapePolyPoly = aPoly; mapCurShape->maShapePolyPoly = aPoly;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment